integration/presto/src/main/prestodb/org/apache/carbondata/presto/PrestoFilterUtil.java [288:326]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static Object convertDataByType(Object rawData, HiveType type) {
    if (type.equals(HiveType.HIVE_INT) || type.equals(HiveType.HIVE_SHORT)) {
      return Integer.valueOf(rawData.toString());
    } else if (type.equals(HiveType.HIVE_FLOAT)) {
      return Float.intBitsToFloat((int) ((Long) rawData).longValue());
    } else if (type.equals(HiveType.HIVE_LONG)) {
      return rawData;
    } else if (type.equals(HiveType.HIVE_STRING) || type.equals(HiveType.HIVE_BINARY)) {
      if (rawData instanceof Slice) {
        return ((Slice) rawData).toStringUtf8();
      } else {
        return rawData;
      }
    } else if (type.equals(HiveType.HIVE_BOOLEAN)) {
      return rawData;
    } else if (type.equals(HiveType.HIVE_DATE)) {
      Calendar c = Calendar.getInstance();
      c.setTime(new Date(0));
      c.add(Calendar.DAY_OF_YEAR, ((Long) rawData).intValue());
      Date date = c.getTime();
      return date.getTime() * 1000;
    }
    else if (type.getTypeInfo() instanceof DecimalTypeInfo) {
      if (rawData instanceof Double) {
        return new BigDecimal((Double) rawData);
      } else if (rawData instanceof Long) {
        return new BigDecimal(new BigInteger(String.valueOf(rawData)),
            ((DecimalTypeInfo) type.getTypeInfo()).getScale());
      } else if (rawData instanceof Slice) {
        return new BigDecimal(Decimals.decodeUnscaledValue((Slice) rawData),
            ((DecimalTypeInfo) type.getTypeInfo()).getScale());
      }
    }
    else if (type.equals(HiveType.HIVE_TIMESTAMP)) {
      return (Long) rawData * 1000;
    }

    return rawData;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



integration/presto/src/main/prestosql/org/apache/carbondata/presto/PrestoFilterUtil.java [201:239]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private static Object convertDataByType(Object rawData, HiveType type) {
    if (type.equals(HiveType.HIVE_INT) || type.equals(HiveType.HIVE_SHORT)) {
      return Integer.valueOf(rawData.toString());
    } else if (type.equals(HiveType.HIVE_FLOAT)) {
      return Float.intBitsToFloat((int) ((Long) rawData).longValue());
    } else if (type.equals(HiveType.HIVE_LONG)) {
      return rawData;
    } else if (type.equals(HiveType.HIVE_STRING) || type.equals(HiveType.HIVE_BINARY)) {
      if (rawData instanceof Slice) {
        return ((Slice) rawData).toStringUtf8();
      } else {
        return rawData;
      }
    } else if (type.equals(HiveType.HIVE_BOOLEAN)) {
      return rawData;
    } else if (type.equals(HiveType.HIVE_DATE)) {
      Calendar c = Calendar.getInstance();
      c.setTime(new Date(0));
      c.add(Calendar.DAY_OF_YEAR, ((Long) rawData).intValue());
      Date date = c.getTime();
      return date.getTime() * 1000;
    }
    else if (type.getTypeInfo() instanceof DecimalTypeInfo) {
      if (rawData instanceof Double) {
        return new BigDecimal((Double) rawData);
      } else if (rawData instanceof Long) {
        return new BigDecimal(new BigInteger(String.valueOf(rawData)),
            ((DecimalTypeInfo) type.getTypeInfo()).getScale());
      } else if (rawData instanceof Slice) {
        return new BigDecimal(Decimals.decodeUnscaledValue((Slice) rawData),
            ((DecimalTypeInfo) type.getTypeInfo()).getScale());
      }
    }
    else if (type.equals(HiveType.HIVE_TIMESTAMP)) {
      return (Long) rawData * 1000;
    }

    return rawData;
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



