dengzhhu653 commented on a change in pull request #992:
URL: https://github.com/apache/hive/pull/992#discussion_r414159331



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/type/TypeCheckProcFactory.java
##########
@@ -789,12 +791,25 @@ protected void validateUDF(ASTNode expr, boolean 
isFunction, TypeCheckCtx ctx, F
 
         LogHelper console = new LogHelper(LOG);
 
+        Set<PrimitiveObjectInspector.PrimitiveCategory> unsafeConventionTyps = 
Sets.newHashSet(
+            PrimitiveObjectInspector.PrimitiveCategory.STRING,
+            PrimitiveObjectInspector.PrimitiveCategory.VARCHAR,
+            PrimitiveObjectInspector.PrimitiveCategory.CHAR);
         // For now, if a bigint is going to be cast to a double throw an error 
or warning
-        if ((oiTypeInfo0.equals(TypeInfoFactory.stringTypeInfo) && 
oiTypeInfo1.equals(TypeInfoFactory.longTypeInfo)) ||
-            (oiTypeInfo0.equals(TypeInfoFactory.longTypeInfo) && 
oiTypeInfo1.equals(TypeInfoFactory.stringTypeInfo))) {
+        if ((oiTypeInfo0 instanceof PrimitiveTypeInfo &&

Review comment:
       Move the conditions to method unSafeCompareWithBigInt.




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



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

Reply via email to