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/11/24 08:18:15 UTC

[GitHub] [hive] kgyrtkirk commented on a change in pull request #2811: HIVE-25734: Wrongly-typed constant in case expression leads to incorrect empty result.

kgyrtkirk commented on a change in pull request #2811:
URL: https://github.com/apache/hive/pull/2811#discussion_r755789803



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/type/TypeCheckProcFactory.java
##########
@@ -985,6 +986,11 @@ protected T getXpathOrFuncExprNodeDesc(ASTNode node,
             children.set(constIdx, newChild);
           }
         }
+        if(funcText.equalsIgnoreCase("case")) {
+          ListMultimap<TypeInfo, T> expressions = getTypeInfoTListMultimap((List<T>) children);

Review comment:
       making this for CASE doesn't look right - this `getTypeInfoTListMultimap` which was extracted from the IN part below - main purpose was to make all the IN values conform to the type of the value being looked up;
   
   in case of CASE the 1st argument is a boolean condition - forcing all the other childs in that node to be boolean doesn't make sense in all cases.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/type/TypeCheckProcFactory.java
##########
@@ -74,6 +74,7 @@
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
 import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils;
+import org.jetbrains.annotations.NotNull;

Review comment:
       `javax.annotation.NotNull`




-- 
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-unsubscribe@hive.apache.org

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