-
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
sql, distsql, opt: fixing serialization of empty array #26090
Conversation
Review status: 0 of 5 files reviewed at latest revision, all discussions resolved, some commit checks failed. pkg/sql/opt/exec/execbuilder/scalar_builder.go, line 293 at r1 (raw file):
What if this is an array of const tuples? Does this need to recursively check if the entire expression tree is constant? Comments from Reviewable |
Review status: 0 of 5 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. pkg/sql/opt/exec/execbuilder/scalar_builder.go, line 293 at r1 (raw file): Previously, andy-kimball (Andy Kimball) wrote…
Hm, good question. The same question applies for buildTuples (and potentially other uses of MatchesTupleOfConstants). I'll look at it and try to add that. Comments from Reviewable |
`DArray.AmbiguousFormat` now returns true if the array is empty. This fixes a serialization issue. The optimizer code now creates a `DArray` instead of an `Array` whenever possible (most importantly, for empty arrays). Fixes cockroachdb#26087. Release note (bug fix): Fixed an error caused by empty arrays in some cases.
I moved the const DArray and DTuple construction to ExtractConstDatum, and made the check recursive, PTAL |
Review status: 0 of 7 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful. pkg/sql/opt/memo/extract.go, line 32 at r2 (raw file):
Can you review all the places that call this, and make sure this is the right method for them to be calling, now that it's so much more extensive? For example, Comments from Reviewable |
Release note: None
I added a commit relaxing one of the Review status: 0 of 9 files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/opt/memo/extract.go, line 32 at r2 (raw file): Previously, andy-kimball (Andy Kimball) wrote…
Hm, I looked at the paths using If we find that we generate the same objects many times, we can cache the datum in the tuple's private. Comments from Reviewable |
Review status: 0 of 9 files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. pkg/sql/opt/memo/extract.go, line 32 at r2 (raw file): Previously, RaduBerinde wrote…
ok, sounds reasonable, i didn't catch that Comments from Reviewable |
bors r+ |
26090: sql, distsql, opt: fixing serialization of empty array r=RaduBerinde a=RaduBerinde `DArray.AmbiguousFormat` now returns true if the array is empty. This fixes a serialization issue. The optimizer code now creates a `DArray` instead of an `Array` whenever possible (most importantly, for empty arrays). Fixes #26087. Release note (bug fix): Fixed an error caused by empty arrays in some cases. Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
Build succeeded |
DArray.AmbiguousFormat
now returns true if the array is empty. Thisfixes a serialization issue.
The optimizer code now creates a
DArray
instead of anArray
whenever possible (most importantly, for empty arrays).
Fixes #26087.
Release note (bug fix): Fixed an error caused by empty arrays in some
cases.