zabetak commented on code in PR #4478:
URL: https://github.com/apache/hive/pull/4478#discussion_r1268639871
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java:
##########
@@ -2631,6 +2631,21 @@ private RelNode genJoinRelNode(RelNode leftRel, String
leftTableAlias, RelNode r
unparseTranslator.addIdentifierTranslation((ASTNode) child);
}
namedColumns.add(columnName);
+
+ // if leftTableAlias is null, set it to the last tableAlias that
contains the
+ // column columnName
+ if (leftTableAlias == null) {
+ Map<String, Map<String, ColumnInfo>> leftRslvMap =
leftRR.getRslvMap();
+ for (String tableAlias: leftRR.getTableNames()) {
+ if (!leftRslvMap.containsKey(tableAlias)) {
+ continue;
+ }
+ if (leftRslvMap.get(tableAlias).containsKey(columnName)) {
+ leftTableAlias = tableAlias;
Review Comment:
I didn't mean to check the query plans but the validity of the queries and
the actual query results.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]