tarak271 commented on code in PR #4653:
URL: https://github.com/apache/hive/pull/4653#discussion_r1374716288


##########
serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java:
##########
@@ -1263,6 +1267,33 @@ public static int compare(Object o1, ObjectInspector 
oi1, Object o2,
     }
   }
 
+  public static boolean isConversionSupported(ObjectInspector oi1, 
ObjectInspector oi2) {
+    if (oi1.getCategory() == oi2.getCategory()) {
+      if (oi1.getCategory() == Category.PRIMITIVE) {
+        PrimitiveObjectInspector poi1 = ((PrimitiveObjectInspector) oi1);
+        PrimitiveObjectInspector poi2 = ((PrimitiveObjectInspector) oi2);
+        if 
((poi1.getPrimitiveCategory().equals(PrimitiveObjectInspector.PrimitiveCategory.VARCHAR)
+            && 
poi2.getPrimitiveCategory().equals(PrimitiveObjectInspector.PrimitiveCategory.STRING))
 || (
+            
poi1.getPrimitiveCategory().equals(PrimitiveObjectInspector.PrimitiveCategory.STRING)
+                && 
poi2.getPrimitiveCategory().equals(PrimitiveObjectInspector.PrimitiveCategory.VARCHAR)))
 {
+          return true;

Review Comment:
   Varchar and string should be convertible and be able to compare. Moving this 
to base class of Array UDFs, AbstractGenericUDFArrayBase



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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to