-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
MySQL compatibility: support 'is not distinct from' in join on section, pt1 #53755
Conversation
b39a9c4
to
08c4b37
Compare
This is an automated comment for commit df281fa with description of existing statuses. It's updated for the latest CI running
|
89b8739
to
57991fb
Compare
5f93659
to
a1c9938
Compare
a1c9938
to
dbdcea3
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.
LGTM
Hm, so it's implemented as simple: tuple(null_column) = tuple(null_column) |
yes, initial idea was to introduce some new type of column or wrapper for CollumnNullable that will not be treated by algorithms in a special way. Wrapping with |
Does it affect performance? (ie more complex hashtable) |
It can a bit, since for tuples
Potentiality yes, especially in cases when we just do not handle added step during plan optimization. With filter push-down it works fine: EXPLAIN PLANEXPLAIN PLAN SELECT * FROM t1 JOIN t2 ON t1.key = t2.key WHERE t1.key = 1 AND t2.key = 1;
┌─explain───────────────────────────────────────────────────────────────────────────────────────┐
│ Expression ((Projection + (Before ORDER BY + ))) │
│ Join (JOIN FillRightFirst) │
│ Filter (( + Before JOIN)) │
│ ReadFromMergeTree (default.t1) │
│ Filter (( + (Joined actions + (Rename joined columns + (Projection + Before ORDER BY))))) │
│ ReadFromMergeTree (default.t2) │
└───────────────────────────────────────────────────────────────────────────────────────────────┘
EXPLAIN PLAN SELECT * FROM t1 JOIN t2 ON t1.key <=> t2.key WHERE t1.key = 1 AND t2.key = 1;
┌─explain─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Expression ((Projection + (Before ORDER BY + ))) │
│ Join (JOIN FillRightFirst) │
│ Expression (( + (Convert JOIN columns + Before JOIN))) │
│ Filter ((( + (Convert JOIN columns + Before JOIN)))[split]) │
│ ReadFromMergeTree (default.t1) │
│ Expression (( + (Convert joined columns + (Joined actions + (Rename joined columns + (Projection + Before ORDER BY)))))) │
│ Filter ((( + (Convert joined columns + (Joined actions + (Rename joined columns + (Projection + Before ORDER BY))))))[split]) │
│ ReadFromMergeTree (default.t2) │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
But I assume it can break in case of Basically it works the same as with joining different types, e.g. |
I assume, it will also break with #53443 |
Tests will catch it |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
isNotDistinctFrom
in join on section for null-safe comparison, ref MySQL compatibility: <=> support and JOIN ON conditions #53061Comment for reviewer: PR contains bunch of added lines, but significant part of them related to test reference file, or to moving
FunctionTuple
into header file, essential changes in code is not really big.Test reference is taken from the result of the same test queries from another dbms that supports
<=>
operator in JOIN ON.TODO:
a <=> b
anda IS NOT DISTINCT FROM b
(next PR) Parse IS NOT DISTINCT and <=> operators #54067