You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2020/01/03 07:52:04 UTC
[GitHub] [samza] atoomula commented on a change in pull request #1242:
SAMZA-2425: Add support for sub-query in joins
atoomula commented on a change in pull request #1242: SAMZA-2425: Add support for sub-query in joins
URL: https://github.com/apache/samza/pull/1242#discussion_r362726531
##########
File path: samza-sql/src/main/java/org/apache/samza/sql/translator/JoinTranslator.java
##########
@@ -292,17 +294,27 @@ private String dumpRelPlanForNode(RelNode relNode) {
SqlExplainLevel.EXPPLAN_ATTRIBUTES);
}
- private SqlIOConfig resolveSourceConfigForTable(RelNode relNode, TranslatorContext context) {
+ private SqlIOConfig resolveSQlIOForTable(RelNode relNode, TranslatorContext context) {
+ // Let's recursively get to the TableScan node to identify IO for the table.
if (relNode instanceof LogicalProject) {
- return resolveSourceConfigForTable(((LogicalProject) relNode).getInput(), context);
+ return resolveSQlIOForTable(((LogicalProject) relNode).getInput(), context);
}
- // We are returning the sourceConfig for the table as null when the table is in another join rather than an output
- // table, that's because the output of stream-table join is considered a stream.
- if (relNode.getInputs().size() > 1) {
+ if (relNode instanceof LogicalFilter) {
+ return resolveSQlIOForTable(((LogicalFilter) relNode).getInput(), context);
+ }
+
+ // 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) {
Review comment:
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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services