Skip to content

SAMZA-2425: Add support for sub-query in joins#1242

Merged
atoomula merged 1 commit intoapache:masterfrom
atoomula:join_subquery
Jan 2, 2020
Merged

SAMZA-2425: Add support for sub-query in joins#1242
atoomula merged 1 commit intoapache:masterfrom
atoomula:join_subquery

Conversation

@atoomula
Copy link
Contributor

@atoomula atoomula commented Jan 2, 2020

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.

@atoomula atoomula merged commit beb5e1b into apache:master 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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. There're other kinds of RelNode which are not covered by instanceOf checks in recursive function. Do we need to handle other kinds of RelNode here? If not, why?
  2. Can you please add a unit-test in JoinTranslator for these changes?
  3. Just curious. Would the schema validations be applied on the result of the sub-queries within joins?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good questions.

  1. In Samza Sql, we currently support only filters, projection and joins along with scan. Hence, only they are handled in this function.
  2. There are end-to-end tests for each of these if conditions and for the new addition.
  3. Schema validations for joins is not yet implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants