public static HiveToken hiveToken(RelDataType calciteType) {
    HiveToken ht = null;

    switch (calciteType.getSqlTypeName()) {
    case CHAR: {
      ht = new HiveToken(HiveParser.TOK_CHAR, "TOK_CHAR", String.valueOf(calciteType.getPrecision()));
    }
      break;
    case VARCHAR: {
      if (calciteType.getPrecision() == Integer.MAX_VALUE)
        ht = new HiveToken(HiveParser.TOK_STRING, "TOK_STRING", String.valueOf(calciteType
            .getPrecision()));
      else
        ht = new HiveToken(HiveParser.TOK_VARCHAR, "TOK_VARCHAR", String.valueOf(calciteType
            .getPrecision()));
    }
      break;
    case DECIMAL: {
      ht = new HiveToken(HiveParser.TOK_DECIMAL, "TOK_DECIMAL", String.valueOf(calciteType
          .getPrecision()), String.valueOf(calciteType.getScale()));
    }
      break;
    case TIMESTAMP_WITH_LOCAL_TIME_ZONE: {
      ht = new HiveToken(HiveParser.TOK_TIMESTAMPLOCALTZ, "TOK_TIMESTAMPLOCALTZ");
    }
      break;
    default:
      ht = calciteToHiveTypeNameMap.get(calciteType.getSqlTypeName().getName());
    }

    return ht;
  }
******************** Convert Calcite Types To Hive Types **********************
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/TypeConverter.java