soumyakanti3578 commented on code in PR #5057:
URL: https://github.com/apache/hive/pull/5057#discussion_r1478725902
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/type/RexNodeExprFactory.java:
##########
@@ -165,22 +165,23 @@ protected RexNode createColumnRefExpr(ColumnInfo colInfo,
List<RowResolver> rowR
private int getPosition(ColumnInfo colInfo, List<RowResolver>
rowResolverList)
throws SemanticException {
- ColumnInfo tmp;
- ColumnInfo cInfoToRet = null;
int position = 0;
- for (RowResolver rr : rowResolverList) {
- tmp = rr.get(colInfo.getTabAlias(), colInfo.getAlias());
- if (tmp != null) {
- if (cInfoToRet != null) {
- throw new CalciteSemanticException("Could not resolve column name");
- }
- cInfoToRet = tmp;
- position += rr.getPosition(cInfoToRet.getInternalName());
- } else if (cInfoToRet == null) {
+
+ for (RowResolver rr: rowResolverList) {
+ ColumnInfo tmp = rr.get(colInfo.getTabAlias(), colInfo.getAlias());
+ if (tmp == null) {
+ // if column in not present in the RR, increment position by size of RR
Review Comment:
Yes! I will fix it! Thanks for catching it :)
--
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]