-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Add index lookup join node #12163
Conversation
This pull request was exported from Phabricator. Differential Revision: D68429744 |
✅ Deploy Preview for meta-velox canceled.
|
9f8c5e3
to
edee917
Compare
This pull request was exported from Phabricator. Differential Revision: D68429744 |
Summary: Add index lookup join plan node and add a method in table handle to indicate if the table support index lookup or not. Differential Revision: D68429744
edee917
to
a396606
Compare
This pull request was exported from Phabricator. Differential Revision: D68429744 |
Summary: Add index lookup join plan node and add a method in table handle to indicate if the table support index lookup or not. Differential Revision: D68429744
a396606
to
d1834ea
Compare
This pull request was exported from Phabricator. Differential Revision: D68429744 |
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.
@xiaoxmeng Looks great % a few comments. Thank you for adding index join capabilities to Velox.
velox/core/PlanNode.h
Outdated
/// SELECT t.sid, t.day_ts, u.event_type | ||
/// FROM t LEFT JOIN u | ||
/// ON t.sid = u.sid | ||
/// AND u.event_type in t.event_list |
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.
u.event_type in t.event_list
This is not a valid SQL because IN requires a list of literals. Let's change to
contains(t.event_list, u.event_type)
See https://facebookincubator.github.io/velox/functions/presto/array.html#contains
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.
Thanks and updated.
/// input is translated to a connector::IndexSource within | ||
/// exec::IndexLookupJoin. | ||
/// | ||
/// Take the following query for example, t is left table, r is the right table |
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.
It might be easier to read if query comes first and break down of its parts after.
Example:
SELECT ....
Here,
- 'joinType' is JoinType::kLeft
- 'left' describes scan of t with a filter on 'ds': t.ds BETWEEN '2024-01-01' AND '2024-01-07';
- 'right' describes indexed table 'u' with ndex keys sid, event_type (and maybe some more)
- 'leftKeys' is a list of one key 't.sid'
- 'rightKeys' is a list of one key 'u.sid'
- 'joinConditions' is a list of one expression: contains(t.event_list, u.event_type)
- 'outputType' contains 3 columns: t.sid, t.day_ts, u.event_type
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.
Nice. Thanks for the suggestions!
velox/core/PlanNode.h
Outdated
leftKeys, | ||
rightKeys, | ||
/*filter=*/nullptr, | ||
left, |
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.
nit: std::move for left and right (or change signature to take these as const &(
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.
Use move
testSerde(plan); | ||
} | ||
|
||
// bad join type. |
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.
These are nice tests, but they do not belong to 'serde' test. Perhaps, move then into IndexLookupJoinTest.cpp 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.
Will move. Thanks!
auto mockIndexConnectorHandle = | ||
std::make_shared<MockIndexConnectorHandle>("MockIndexConnectorHandle"); | ||
auto mockNonIndexConnectorHandle = | ||
std::make_shared<MockNonIndexConnectorHandle>( |
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.
MockNonIndexConnectorHandle
Do we need this? I assume we use the existing Hive connector, no?
See TEST_F(PlanNodeSerdeTest, scan)
MockNonIndexConnectorHandle::registerSerDe(); | ||
MockIndexConnectorHandle::registerSerDe(); | ||
|
||
auto mockIndexConnectorHandle = |
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.
mockIndexConnectorHandle
This name is rather long. It is a bit difficult to read and distinguish it from similarly looking mockNonIndexConnectorHandle. Consider renaming mockIndexConnectorHandle to indexHandle and using regular Hive connector for mockNonIndexConnectorHandle.
Summary: Add index lookup join plan node and add a method in table handle to indicate if the table support index lookup or not. Reviewed By: mbasmanova Differential Revision: D68429744
d1834ea
to
83e865f
Compare
This pull request was exported from Phabricator. Differential Revision: D68429744 |
Summary: Add index lookup join plan node and add a method in table handle to indicate if the table support index lookup or not. Reviewed By: mbasmanova Differential Revision: D68429744
83e865f
to
213d5a9
Compare
Summary: Add index lookup join plan node and add a method in table handle to indicate if the table support index lookup or not. Reviewed By: mbasmanova Differential Revision: D68429744
213d5a9
to
d32dc20
Compare
This pull request was exported from Phabricator. Differential Revision: D68429744 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D68429744 |
Summary: Add index lookup join plan node and add a method in table handle to indicate if the table support index lookup or not. Reviewed By: mbasmanova Differential Revision: D68429744
d32dc20
to
78b036b
Compare
This pull request was exported from Phabricator. Differential Revision: D68429744 |
Summary: Add index lookup join plan node and add a method in table handle to indicate if the table support index lookup or not. Reviewed By: mbasmanova Differential Revision: D68429744
78b036b
to
52c457c
Compare
This pull request was exported from Phabricator. Differential Revision: D68429744 |
Summary: Add index lookup join plan node and add a method in table handle to indicate if the table support index lookup or not. Reviewed By: mbasmanova Differential Revision: D68429744
52c457c
to
eb29398
Compare
This pull request was exported from Phabricator. Differential Revision: D68429744 |
Summary: Add index lookup join plan node and add a method in table handle to indicate if the table support index lookup or not. Reviewed By: mbasmanova Differential Revision: D68429744
eb29398
to
b7b14f1
Compare
This pull request was exported from Phabricator. Differential Revision: D68429744 |
Summary: Add index lookup join plan node and add a method in table handle to indicate if the table support index lookup or not. Reviewed By: mbasmanova Differential Revision: D68429744
b7b14f1
to
4e3c080
Compare
This pull request was exported from Phabricator. Differential Revision: D68429744 |
This pull request has been merged in cac8000. |
Conbench analyzed the 0 benchmark runs that triggered this notification. None of the specified runs were found on the Conbench server. The full Conbench report has more details. |
Summary:
Add index lookup join node and add a method in table handle to indicate if the table support index lookup
or not.
Differential Revision: D68429744