miklosgergely commented on a change in pull request #887: HIVE-22746
URL: https://github.com/apache/hive/pull/887#discussion_r370708452
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/plan/ExprNodeDescUtils.java
 ##########
 @@ -1001,17 +1002,10 @@ public static boolean isSame(List<ExprNodeDesc> first, 
List<ExprNodeDesc> second
   // Given an expression this method figures out if the type for the 
expression belongs to string group
   // e.g. (String, Char, Varchar etc)
   public static boolean isStringType(ExprNodeDesc expr) {
-    TypeInfo typeInfo = expr.getTypeInfo();
-    if (typeInfo.getCategory() == ObjectInspector.Category.PRIMITIVE) {
-      PrimitiveObjectInspector.PrimitiveCategory primitiveCategory = 
((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory();
-      if 
(PrimitiveObjectInspectorUtils.getPrimitiveGrouping(primitiveCategory) ==
-          PrimitiveObjectInspectorUtils.PrimitiveGrouping.STRING_GROUP) {
-        return true;
-      }
-    }
-    return false;
+    return TypeCheckProcFactory.isStringType(expr.getTypeInfo());
 
 Review comment:
   ExprNodeDescUtils.isStringType is only redirecting to 
TypeCheckProcFactory.isStringType, therefore it can be removed, and it's 
callers may call TypeCheckProcFactory.isStringType directly.

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