public static DirectDictionaryGenerator getDirectDictionaryGenerator(DataType dataType) { return getDirectDictionaryGenerator(dataType, CarbonUtil.getFormatFromProperty(dataType)); } }
/** * get dateformat * @param carbonDimension * @return */ private String getDateFormat(CarbonDimension carbonDimension) { String format; String dateFormat = null; if (this.carbonDimension.getDataType() == DataTypes.DATE) { dateFormat = carbonDimension.getDateFormat(); } if (dateFormat != null && !dateFormat.trim().isEmpty()) { format = dateFormat; } else { format = CarbonUtil.getFormatFromProperty(dataType); } return format; }
(Boolean.parseBoolean(dictionaryVal)), (Boolean.parseBoolean(memberVal))); } else if (dataType == DataTypes.DATE || dataType == DataTypes.TIMESTAMP) { String format = CarbonUtil.getFormatFromProperty(dataType); SimpleDateFormat parser = new SimpleDateFormat(format); Date dateToStr;
String format = CarbonUtil.getFormatFromProperty(dataType); SimpleDateFormat parser = new SimpleDateFormat(format); Date date1 = null;
DataType dataType = this.getDataType(); if (dataType == DataTypes.DATE || dataType == DataTypes.TIMESTAMP) { String format = CarbonUtil.getFormatFromProperty(this.getDataType()); SimpleDateFormat parser = new SimpleDateFormat(format); if (this.getDataType() == DataTypes.DATE) {
@Override public int compareTo(ExpressionResult o) { try { DataType type = o.dataType; if (type == DataTypes.SHORT || type == DataTypes.INT || type == DataTypes.LONG || type == DataTypes.DOUBLE) { Double d1 = this.getDouble(); Double d2 = o.getDouble(); return d1.compareTo(d2); } else if (DataTypes.isDecimal(type)) { java.math.BigDecimal val1 = this.getDecimal(); java.math.BigDecimal val2 = o.getDecimal(); return val1.compareTo(val2); } else if (type == DataTypes.DATE || type == DataTypes.TIMESTAMP) { String format = CarbonUtil.getFormatFromProperty(o.dataType); SimpleDateFormat parser = new SimpleDateFormat(format); Date date1 = parser.parse(this.getString()); Date date2 = parser.parse(o.getString()); return date1.compareTo(date2); } else { return this.getString().compareTo(o.getString()); } } catch (ParseException | FilterIllegalMemberException e) { return -1; } }