Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/3019#discussion_r244276214
  
    --- Diff: 
integration/presto/src/main/java/org/apache/carbondata/presto/PrestoFilterUtil.java
 ---
    @@ -78,32 +72,33 @@
       private static final String HIVE_DEFAULT_DYNAMIC_PARTITION = 
"__HIVE_DEFAULT_PARTITION__";
     
       /**
    -   * @param carbondataColumnHandle
    +   * @param columnHandle
        * @return
        */
    -  private static DataType spi2CarbondataTypeMapper(CarbondataColumnHandle 
carbondataColumnHandle) {
    -    Type colType = carbondataColumnHandle.getColumnType();
    -    if (colType == BooleanType.BOOLEAN) {
    +  private static DataType spi2CarbondataTypeMapper(HiveColumnHandle 
columnHandle) {
    +    HiveType colType = columnHandle.getHiveType();
    +    if (colType.equals(HiveType.HIVE_BOOLEAN)) {
           return DataTypes.BOOLEAN;
    -    } else if (colType == SmallintType.SMALLINT) {
    +    } else if (colType.equals(HiveType.HIVE_SHORT)) {
           return DataTypes.SHORT;
    -    } else if (colType == IntegerType.INTEGER) {
    +    } else if (colType.equals(HiveType.HIVE_INT)) {
           return DataTypes.INT;
    -    } else if (colType == BigintType.BIGINT) {
    +    } else if (colType.equals(HiveType.HIVE_LONG)) {
           return DataTypes.LONG;
    -    } else if (colType == DoubleType.DOUBLE) {
    +    } else if (colType.equals(HiveType.HIVE_DOUBLE)) {
           return DataTypes.DOUBLE;
    -    } else if (colType == VarcharType.VARCHAR) {
    +    } else if (colType.equals(HiveType.HIVE_STRING)) {
           return DataTypes.STRING;
    -    } else if (colType == DateType.DATE) {
    +    } else if (colType.equals(HiveType.HIVE_DATE)) {
           return DataTypes.DATE;
    -    } else if (colType == TimestampType.TIMESTAMP) {
    +    } else if (colType.equals(HiveType.HIVE_TIMESTAMP)) {
           return DataTypes.TIMESTAMP;
    -    } else if 
(colType.equals(DecimalType.createDecimalType(carbondataColumnHandle.getPrecision(),
    -        carbondataColumnHandle.getScale()))) {
    -      return 
DataTypes.createDecimalType(carbondataColumnHandle.getPrecision(),
    -          carbondataColumnHandle.getScale());
    -    } else {
    +    }
    +    else if (colType.getTypeInfo() instanceof DecimalTypeInfo) {
    +      DecimalTypeInfo typeInfo = (DecimalTypeInfo) colType.getTypeInfo();
    +      return 
DataTypes.createDecimalType(typeInfo.getPrecision(),typeInfo.getScale());
    +    }
    +    else {
    --- End diff --
    
    ok


---

Reply via email to