-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 constant columns bug in zig-zag join rule #48128
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 6 of 6 files at r1.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @andy-kimball and @rytaft)
a discussion (no related file):
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! 2 of 0 LGTMs obtained (waiting on @RaduBerinde and @rytaft)
a discussion (no related file):
Previously, mgartner (Marcus Gartner) wrote…
:lgtm:
pkg/sql/opt/constraint/constraint_set.go, line 294 at r1 (raw file):
// ExtractValueForConstColumn extracts the value for a constant column returned // by ExtractConstCols. func (s *Set) ExtractValueForConstColumn(evalCtx *tree.EvalContext, col opt.ColumnID) tree.Datum {
NIT: would call this ExtractValueForConstCol
for symmetry.
This is a fix for a regression introduced by cockroachdb#47412. We were using `ExtractConstCols` to get the list of possible fixed columns, and later we were using `findConstantFilter` to get the values. The latter has more restrictive semantics so we wouldn't always find the value we need. The fix is to use logic consistent with `ExtractConstCols`, which is now added as `ExtractValueForConstColumn`. The zig-zag join code now also verifies that we fill in all the columns so we get a better error earlier. Fixes cockroachdb#48003. Release note (bug fix): Fixed "non-values node passed as fixed value to zigzag join" internal error.
0f0f18b
to
2210d93
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.
TFTRs!
bors r+
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @mgartner and @rytaft)
Build succeeded |
This is a fix for a regression introduced by #47412.
We were using
ExtractConstCols
to get the list of possible fixedcolumns, and later we were using
findConstantFilter
to get the values.The latter has more restrictive semantics so we wouldn't always find
the value we need.
The fix is to use logic consistent with
ExtractConstCols
, which isnow added as
ExtractValueForConstColumn
. The zig-zag join code nowalso verifies that we fill in all the columns so we get a better error
earlier.
Fixes #48003.
Release note (bug fix): Fixed "non-values node passed as fixed value
to zigzag join" internal error.