You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/02/04 15:58:31 UTC

[GitHub] [hive] pgaref commented on a change in pull request #1286: HIVE-23882: Compiler should skip MJ keyExpr for probe optimization

pgaref commented on a change in pull request #1286:
URL: https://github.com/apache/hive/pull/1286#discussion_r570340192



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/OperatorUtils.java
##########
@@ -654,11 +655,18 @@ public static String findTableColNameOf(Operator<?> start, String internalColNam
         continue;
       }
       // If columnName is the output of a ColumnExpr get the original columnName from the Expr Map
-      if (currentOp.getColumnExprMap() != null && currentOp.getColumnExprMap().containsKey(internalColName)
-              && currentOp.getColumnExprMap().get(internalColName) instanceof ExprNodeColumnDesc) {
-        internalColName = ((ExprNodeColumnDesc) currentOp.getColumnExprMap().get(internalColName)).getColumn();
+      if (currentOp.getColumnExprMap() != null && currentOp.getColumnExprMap().containsKey(internalColName)) {
+        // Only use colInfo that is ExprNodeColumnDesc (could even be a UDF on the key at this point)
+        if (currentOp.getColumnExprMap().get(internalColName) instanceof ExprNodeColumnDesc) {
+          internalColName = ((ExprNodeColumnDesc) currentOp.getColumnExprMap().get(internalColName)).getColumn();
+          keyColInfo = currentOp.getSchema().getColumnInfo(internalColName);

Review comment:
       Thanks for the comments @kgyrtkirk ! Updated the PR to make use of backtracking logic -- had to update it a bit to branch-out in a multi-parent scenario. Let me know what you think




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

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



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