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 2020/12/15 14:19:55 UTC

[GitHub] [hive] zabetak commented on a change in pull request #1780: HIVE-24534: Prevent comparisons between characters and decimals types when strict checks enabled

zabetak commented on a change in pull request #1780:
URL: https://github.com/apache/hive/pull/1780#discussion_r543384168



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/type/TypeCheckProcFactory.java
##########
@@ -801,6 +797,22 @@ private boolean unSafeCompareWithBigInt(TypeInfo otherTypeInfo, TypeInfo bigintC
       }
       return false;
     }
+    
+    private boolean isDecimalCharacterComparison(TypeInfo type1, TypeInfo type2) {
+      if(type1 instanceof PrimitiveTypeInfo && type2 instanceof PrimitiveTypeInfo) {
+        Set<Set<PrimitiveObjectInspector.PrimitiveCategory>> comparisons = new HashSet<>(3);
+        comparisons.add(EnumSet.of(
+            PrimitiveObjectInspector.PrimitiveCategory.DECIMAL, PrimitiveObjectInspector.PrimitiveCategory.CHAR));
+        comparisons.add(EnumSet.of(
+            PrimitiveObjectInspector.PrimitiveCategory.DECIMAL, PrimitiveObjectInspector.PrimitiveCategory.VARCHAR));
+        comparisons.add(EnumSet.of(

Review comment:
       Fixed in https://github.com/apache/hive/pull/1780/commits/ab7432b6f8af27755acc28b2034fd2d3870c0207. Overall there is more refactoring to be done but I want to keep it in a separate issue.




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