soumyakanti3578 commented on code in PR #4478:
URL: https://github.com/apache/hive/pull/4478#discussion_r1265680863


##########
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

Review Comment:
   I think this is exactly what's happening now. For the second join, I try to 
find the right most (last) table containing the column name. Note that 
`leftRR.getTableNames()` returns the tables in order as it is a 
`LinkedHashMap#keySet`.
   
   We can also see the same in the generated optimized sql, 
[here](https://github.com/apache/hive/pull/4478/files#diff-b95714ea51eebdd9e91612e7927d98ee8258a47d033535ce28f6a25ae5db620cR107).



-- 
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]

Reply via email to