Michael Smith has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/21945 )
Change subject: IMPALA-13459: Handle duplicate table in same query ...................................................................... IMPALA-13459: Handle duplicate table in same query WHen there are 2 references of the same table in a query, there needs to be a unique alias name used within the TableRef object. Code has been added to generate an alias. IMPALA-13460 has been filed because we should use the user provided alias name rather than a generated alias name. This is a little more difficult to implement because Calcite has a limitation in that their table object at validation time is equivalent to a FeTable in that there is only one object for the multiple tables. In order to fix IMPALA-13460, there is a Calcite bug that has to be fixed. We'd have to generate our own TableScan object underneath their LogicalTableScan that would hold an alias. This TableScan can be generated through their RelBuilder Factory object. But the current code creates the LogicalTableScan directly rather than go through a factory, so that would need to be fixed first. There are no unit tests attached to this Jira, but there are some tpcds queries that will start working when this gets committed. Change-Id: Ib9997bc642c320c2e26294d7d02a05bccbba6a0d Reviewed-on: http://gerrit.cloudera.org:8080/21945 Tested-by: Impala Public Jenkins <[email protected]> Reviewed-by: Michael Smith <[email protected]> --- M java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaHdfsScanRel.java A java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/util/ImpalaBaseTableRef.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/schema/CalciteTable.java M java/calcite-planner/src/main/java/org/apache/impala/calcite/util/SimplifiedAnalyzer.java 4 files changed, 93 insertions(+), 3 deletions(-) Approvals: Impala Public Jenkins: Verified Michael Smith: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/21945 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ib9997bc642c320c2e26294d7d02a05bccbba6a0d Gerrit-Change-Number: 21945 Gerrit-PatchSet: 5 Gerrit-Owner: Steve Carlin <[email protected]> Gerrit-Reviewer: Aman Sinha <[email protected]> Gerrit-Reviewer: Anonymous Coward (816) Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Steve Carlin <[email protected]>
