public static RelDataType getType(RelOptCluster cluster, RowResolver rr, List<String> neededCols) {
    RexBuilder rexBuilder = cluster.getRexBuilder();
    RelDataTypeFactory dtFactory = rexBuilder.getTypeFactory();
    RowSchema rs = rr.getRowSchema();
    List<RelDataType> fieldTypes = new LinkedList<>();
    List<String> fieldNames = new LinkedList<>();

    for (ColumnInfo ci : rs.getSignature()) {
      if (neededCols == null || neededCols.contains(ci.getInternalName())) {
        fieldTypes.add(convert(ci.getType(), ci.isNullable(), dtFactory));
        fieldNames.add(ci.getInternalName());
      }
    }
    return dtFactory.createStructType(fieldTypes, fieldNames);
  }
******************** Convert Hive Types To Calcite Types **********************
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/TypeConverter.java