SAMZA-2425: Add support for sub-query in joins#1242
Merged
atoomula merged 1 commit intoapache:masterfrom Jan 2, 2020
Merged
Conversation
weiqingy
approved these changes
Jan 2, 2020
shanthoosh
reviewed
Jan 2, 2020
|
|
||
| // We return null for table IO as the table seems to be involved in another join. The output of stream-table join | ||
| // is considered a stream. Hence, we return null for the table. | ||
| if (relNode instanceof LogicalJoin && relNode.getInputs().size() > 1) { |
Contributor
There was a problem hiding this comment.
- There're other kinds of
RelNodewhich are not covered byinstanceOfchecks in recursive function. Do we need to handle other kinds ofRelNodehere? If not, why? - Can you please add a unit-test in JoinTranslator for these changes?
- Just curious. Would the schema validations be applied on the result of the sub-queries within joins?
Contributor
Author
There was a problem hiding this comment.
Very good questions.
- In Samza Sql, we currently support only filters, projection and joins along with scan. Hence, only they are handled in this function.
- There are end-to-end tests for each of these if conditions and for the new addition.
- Schema validations for joins is not yet implemented.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom: Using sub-query with a join fails today with an unsupported exception.
Cause: We have never supported sub-query in joins due to the way we have been parsing sql statements which was fixed recently.
Fix: A simple code enhancement to handle logical filter while traversing the calcite logical plan to get the table IO.
Tests: Added a Sql End-To-End test for sub-query and join.