Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upopt: build IS OF (...) expression #31393
Conversation
justinj
requested review from
knz and
rytaft
Oct 15, 2018
justinj
requested review from
cockroachdb/sql-opt-prs
as
code owners
Oct 15, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
rytaft
approved these changes
Oct 15, 2018
Maybe you should open an issue for the bug?
Reviewed 5 of 5 files at r1.
Reviewable status:complete! 0 of 0 LGTMs obtained (and 1 stale)
knz
approved these changes
Oct 15, 2018
cool thanks!
you can also mention in the commit message or comments that this is also done statically in postgres (transformAExprOf() in src/backend/parser/parse_expr.c)
pkg/sql/sem/tree/eval_test.go Outdated
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
TFTRs! bors r+ |
bot
pushed a commit
that referenced
this pull request
Oct 16, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
craig
bot
commented
Oct 16, 2018
Build succeeded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
justinj commentedOct 15, 2018
This commit builds expressions of the form x IS OF (...). This is an
optbuilder-only change since the value of such an expression is always
known at plan time.
This commit also partially fixes a bug in the heuristic planner's
implementation of this feature by using
Equivalentinstead ofFamilyEqualto compare types, resulting inINT[]being considereddistinct from
STRING[]. It also exposes a bug that I think isdifficult to fix at the moment, which is that the lack of a 1-1 mapping
between datum and column types means the following is incorrectly
reported as true:
I've added relevant test cases and added a TODO for that case.
Tagging @knz for the heuristic planner change and also to put the
remaining type-related bug on his radar.
Release note (bug fix): Fixed IS OF (...) expressions to no longer
report arrays with different element types as being the same.