in java/clickhouse-connector/src/main/java/com/epam/deltix/timebase/connector/clickhouse/algos/RawDecoder.java [31:67]
public static Object readField(DataType type, ReadableValue rv) {
try {
if (type instanceof IntegerDataType) {
return readInteger((IntegerDataType) type, rv);
} else if (type instanceof FloatDataType)
return readFloat((FloatDataType) type, rv);
else if (type instanceof CharDataType)
return rv.getChar();
else if (type instanceof EnumDataType || type instanceof VarcharDataType)
return rv.getString();
else if (type instanceof BooleanDataType)
return rv.getBoolean();
else if (type instanceof DateTimeDataType)
return readDateTime((DateTimeDataType)type, rv);
else if (type instanceof TimeOfDayDataType)
return rv.getInt();
else if (type instanceof ArrayDataType)
return readArray((ArrayDataType) type, rv);
else if (type instanceof ClassDataType)
return readObjectValues(rv);
else if (type instanceof BinaryDataType) {
try {
final int size = rv.getBinaryLength();
final byte[] bin = new byte[size];
rv.getBinary(0, size, bin, 0);
return bin;
} catch (NullValueException e) {
return null;
}
} else
throw new RuntimeException("Unrecognized dataType: " + type);
} catch (NullValueException e) {
return null;
}
}