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/03 06:37:17 UTC

[GitHub] [hive] kasakrisz commented on a change in pull request #1892: HIVE-24664: Support column aliases in Values clause

kasakrisz commented on a change in pull request #1892:
URL: https://github.com/apache/hive/pull/1892#discussion_r569163684



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/type/RexNodeExprFactory.java
##########
@@ -1000,6 +1003,21 @@ protected FunctionInfo getFunctionInfo(String funcName) throws SemanticException
     return functionHelper.getFunctionInfo(funcName);
   }
 
+  @Override
+  protected RexNode replaceFieldNamesInStruct(RexNode expr, List<String> newFieldNames) {
+    if (newFieldNames.isEmpty()) {
+      return expr;
+    }
+
+    RexCall structCall = (RexCall) expr;
+    List<RexNode> newOperands = structCall.operands.stream()
+            .filter(rexNode -> "_UTF-16LE'tok_alias':VARCHAR(2147483647) CHARACTER SET \"UTF-16LE\"".compareTo(rexNode.toString()) != 0)

Review comment:
       It cannot be skipped because `TypeCheckProcFactory` uses `SemanticGraphWalker` which requires a return value other than `null` from `SemanticNodeProcessor.process`.
   I introduced a placeholder and filter it out when collecting the children of a function node.




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