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


##########
ql/src/java/org/apache/hadoop/hive/ql/Context.java:
##########
@@ -361,8 +361,16 @@ private DestClausePrefix getMergeDestClausePrefix(ASTNode 
curNode) {
     assert insert != null && insert.getType() == HiveParser.TOK_INSERT;
     ASTNode query = (ASTNode) insert.getParent();
     assert query != null && query.getType() == HiveParser.TOK_QUERY;
-
-    int tokFromIdx = 
query.getFirstChildWithType(HiveParser.TOK_FROM).getChildIndex();
+    ASTNode from = (ASTNode) query.getFirstChildWithType(HiveParser.TOK_FROM);

Review Comment:
   I looked at several different places and thought that this was the place to 
fix it, but I am not very familiar with this so maybe I have missed something.
   
   CBO plan is a HiveValues node for the failing query, and the AST looks fine 
for the plan. The query fails in `doPhase1`, so it might be possible to 
intercept it before:
   ```
   case HiveParser.TOK_DESTINATION:
           ctx_1.dest = this.ctx.getDestNamePrefix(ast, qb).toString() + 
ctx_1.nextNum;
   ```
   as it fails in `this.ctx.getDestNamePrefix(ast, qb)`. I will have to look 
into 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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to