-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opt: fix implicit lateral for SRFs when using JOIN syntax #71396
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @rytaft)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @RaduBerinde)
pkg/sql/opt/optbuilder/join.go, line 44 at r1 (raw file):
// the left side. if t, ok := join.Right.(*tree.AliasedTableExpr); ok && t.Lateral { telemetry.Inc(sqltelemetry.LateralJoinUseCounter)
do we still need this telemetry?
9d01659
to
7cc05b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @mgartner and @rytaft)
pkg/sql/opt/optbuilder/join.go, line 44 at r1 (raw file):
Previously, rytaft (Rebecca Taft) wrote…
do we still need this telemetry?
Yeah, I removed it accidentally (and some tests failed on CI because of it). Moved it to exprIsLateral
.
When SRFs are used as a table, they imply that the join is lateral. This works for the multiple table syntax, but not for the JOIN syntax. This commit addresses this omission. Fixes cockroachdb#70342. Release note (bug fix): Fixes an incorrect "no data source matches prefix" error for queries that use a set-returning function on the right-hand side of a `JOIN` (unless `LATERAL` is explicitly specified).
7cc05b4
to
9e8d9be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @RaduBerinde)
bors r+ |
Build succeeded: |
When SRFs are used as a table, they imply that the join is lateral.
This works for the multiple table syntax, but not for the JOIN syntax.
This commit addresses this omission.
Fixes #70342.
Release note (bug fix): Fixes an incorrect "no data source matches
prefix" error for queries that use a set-returning function on the
right-hand side of a
JOIN
(unlessLATERAL
is explicitlyspecified).