public static boolean areColTypesCompatible(String from, String to) {
    if (from.equals(to)) return true;

    if (PrimitiveTypes.contains(from) && PrimitiveTypes.contains(to)) {
      // They aren't the same, but we may be able to do a cast

      // If they are both types of strings, that should be fine
      if (StringTypes.contains(from) && StringTypes.contains(to)) return true;

      // If both are numeric, make sure the new type is larger than the old.
      if (NumericTypes.contains(from) && NumericTypes.contains(to)) {
        return NumericCastOrder.get(from) < NumericCastOrder.get(to);
      }

      // Void can go to anything
      if (from.equals(VOID_TYPE_NAME)) return true;

      // Allow date to string casts.  NOTE: I suspect this is the reverse of what we actually
      // want, but it matches the code in o.a.h.h.serde2.typeinfo.TypeInfoUtils.  I can't see how
      // users would be altering date columns into string columns.  The other I easily see since
      // Hive did not originally support datetime types.  Also, the comment in the Hive code
      // says string to date, even though the code does the opposite.  But for now I'm keeping
      // this as is so the functionality matches.
      if (DateTimeTypes.contains(from) && StringTypes.contains(to)) return true;

      // Allow numeric to string
      if (NumericTypes.contains(from) && StringTypes.contains(to)) return true;

    }
    return false;
  }
Given a type string return the type name.  For example, passing in the type string
<pre>varchar(256)</pre> will return <pre>varchar</pre>.
@param typeString Type string
@return type name, guaranteed to be in lower case
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/ColumnType.java