public static boolean isMapType(DataType dataType) { return dataType.getId() == MAP_TYPE_ID; }
public static boolean isStructType(DataType dataType) { return dataType.getId() == STRUCT_TYPE_ID; }
public static boolean isDecimal(DataType dataType) { return dataType.getId() == DECIMAL_TYPE_ID; }
public static boolean isArrayType(DataType dataType) { return dataType.getId() == ARRAY_TYPE_ID; }
if (dataType.getId() == DataTypes.BOOLEAN.getId()) { return org.apache.carbondata.format.DataType.BOOLEAN; } else if (dataType.getId() == DataTypes.STRING.getId()) { return org.apache.carbondata.format.DataType.STRING; } else if (dataType.getId() == DataTypes.INT.getId()) { return org.apache.carbondata.format.DataType.INT; } else if (dataType.getId() == DataTypes.SHORT.getId()) { return org.apache.carbondata.format.DataType.SHORT; } else if (dataType.getId() == DataTypes.LONG.getId()) { return org.apache.carbondata.format.DataType.LONG; } else if (dataType.getId() == DataTypes.DOUBLE.getId()) { return org.apache.carbondata.format.DataType.DOUBLE; } else if (DataTypes.isDecimal(dataType)) { return org.apache.carbondata.format.DataType.DECIMAL; } else if (dataType.getId() == DataTypes.DATE.getId()) { return org.apache.carbondata.format.DataType.DATE; } else if (dataType.getId() == DataTypes.TIMESTAMP.getId()) { return org.apache.carbondata.format.DataType.TIMESTAMP; } else if (DataTypes.isArrayType(dataType)) { } else if (DataTypes.isMapType(dataType)) { return org.apache.carbondata.format.DataType.MAP; } else if (dataType.getId() == DataTypes.VARCHAR.getId()) { return org.apache.carbondata.format.DataType.VARCHAR; } else if (dataType.getId() == DataTypes.FLOAT.getId()) { return org.apache.carbondata.format.DataType.FLOAT; } else if (dataType.getId() == DataTypes.BYTE.getId()) { return org.apache.carbondata.format.DataType.BYTE; } else {
if (id == STRING.getId()) { return STRING; } else if (id == DATE.getId()) { return DATE; } else if (id == TIMESTAMP.getId()) { return TIMESTAMP; } else if (id == BOOLEAN.getId()) { return BOOLEAN; } else if (id == BYTE.getId()) { return BYTE; } else if (id == SHORT.getId()) { return SHORT; } else if (id == SHORT_INT.getId()) { return SHORT_INT; } else if (id == INT.getId()) { return INT; } else if (id == LONG.getId()) { return LONG; } else if (id == LEGACY_LONG.getId()) { return LEGACY_LONG; } else if (id == FLOAT.getId()) { return FLOAT; } else if (id == DOUBLE.getId()) { return DOUBLE; } else if (id == NULL.getId()) { return NULL; } else if (id == DECIMAL_TYPE_ID) { } else if (id == MAP_TYPE_ID) {
@Override public void write(DataOutput out) throws IOException { out.writeUTF(fieldName); out.writeByte(schemaDataType.getId()); out.writeByte(columnType.ordinal()); if (DataTypes.isDecimal(schemaDataType)) { DecimalType decimalType = (DecimalType) schemaDataType; out.writeInt(decimalType.getScale()); out.writeInt(decimalType.getPrecision()); } else { out.writeInt(-1); out.writeInt(-1); } }
@Override public void write(DataOutput out) throws IOException { columnSpec.write(out); out.writeByte(storeDataType.getId()); out.writeInt(getDecimal()); out.writeByte(getDataTypeSelected()); writeMinMax(out); out.writeUTF(compressorName); }
@Override public void write(DataOutput out) throws IOException { out.writeShort(dataType.getId()); out.writeUTF(columnName); out.writeUTF(columnUniqueId);
/** * Match the columns for transactional and non transactional tables * @param isTransactionalTable * @param queryColumn * @param tableColumn * @return */ private static boolean isColumnMatches(boolean isTransactionalTable, CarbonColumn queryColumn, CarbonColumn tableColumn) { // If it is non transactional table just check the column names, no need to validate // column id as multiple sdk's output placed in a single folder doesn't have same // column ID but can have same column name if (tableColumn.getDataType().isComplexType() && !(tableColumn.getDataType().getId() == DataTypes.ARRAY_TYPE_ID)) { if (tableColumn.getColumnId().equalsIgnoreCase(queryColumn.getColumnId())) { return true; } else { return isColumnMatchesStruct(tableColumn, queryColumn); } } else { return (tableColumn.getColumnId().equalsIgnoreCase(queryColumn.getColumnId()) || ( !isTransactionalTable && tableColumn.getColName() .equalsIgnoreCase(queryColumn.getColName()))); } }