kgyrtkirk commented on a change in pull request #970: Hive 23100
URL: https://github.com/apache/hive/pull/970#discussion_r408724580
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/type/TypeCheckProcFactory.java
 ##########
 @@ -972,55 +1005,42 @@ protected T getXpathOrFuncExprNodeDesc(ASTNode expr,
           }
         }
         if (genericUDF instanceof GenericUDFIn) {
-
-          T columnDesc = children.get(0);
-          List<T> outputOpList = children.subList(1, children.size());
-          List<T> inOperands = new ArrayList<>(outputOpList);
-          outputOpList.clear();
-
-          boolean hasNullValue = false;
-          for (T oldChild : inOperands) {
-            if (oldChild == null) {
-              hasNullValue = true;
-              continue;
-            }
-            T newChild = interpretNodeAsStruct(columnDesc, oldChild);
-            if (newChild == null) {
-              hasNullValue = true;
-              continue;
-            }
-            outputOpList.add(newChild);
-          }
-
-          if (hasNullValue) {
-            T nullConst = 
exprFactory.createConstantExpr(exprFactory.getTypeInfo(columnDesc), null);
-            if (outputOpList.size() == 0) {
-              // we have found only null values...remove the IN ; it will be 
null all the time.
-              return nullConst;
+          ListMultimap<TypeInfo, T> expressions = ArrayListMultimap.create();
+          for (int i = 1; i < children.size(); i++) {
+            T columnDesc = children.get(0);
+            T valueDesc = interpretNodeAsConstantStruct(columnDesc, 
children.get(i));
+            if (valueDesc == null) {
+              TypeInfo targetType = exprFactory.getTypeInfo(columnDesc);
+              if (!expressions.containsKey(targetType)) {
 
 Review comment:
   this is twisted!
   I don't think this should be neccessary...could you please move the 
"initialization" outside of the children processing ?
   by doing I beleive you will be also able to demote the multi-map to a plain 
list

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to