public static boolean isStringType(TypeInfo typeInfo) {
    if (typeInfo.getCategory() == ObjectInspector.Category.PRIMITIVE) {
      PrimitiveObjectInspector.PrimitiveCategory primitiveCategory = ((PrimitiveTypeInfo) typeInfo).getPrimitiveCategory();
      if (PrimitiveObjectInspectorUtils.getPrimitiveGrouping(primitiveCategory) ==
          PrimitiveObjectInspectorUtils.PrimitiveGrouping.STRING_GROUP) {
        return true;
      }
    }
    return false;
  }
Function to do groupby subexpression elimination. This is called by all the
processors initially. As an example, consider the query select a+b,
count(1) from T group by a+b; Then a+b is already precomputed in the group
by operators key, so we substitute a+b in the select list with the internal
column name of the a+b expression that appears in the in input row
resolver.

@param nd      The node that is being inspected.
@param procCtx The processor context.
@return exprNodeColumnDesc.
ql/src/java/org/apache/hadoop/hive/ql/parse/type/TypeCheckProcFactory.java