public static Object convertDataTypeToDefaultValue()

in java/clickhouse-connector/src/main/java/com/epam/deltix/timebase/connector/clickhouse/algos/SchemaProcessor.java [463:506]


    public static Object convertDataTypeToDefaultValue(SqlDataType dataType) {
        Object essentialDataType;

        if (dataType instanceof NullableDataType) {
            essentialDataType = null;
        } else if (dataType instanceof ArraySqlType) {
            essentialDataType = EMPTY_ARRAY;
//        } else if (dataType instanceof BinaryDataType) {
//            essentialDataType = ClickHouseDataType.String;
        } else if (dataType instanceof UInt8DataType) {
            essentialDataType = 0;
        } else if (dataType instanceof StringDataType) {
            essentialDataType = "";
//        } else if (dataType instanceof ClassDataType) {
//            throw new NotImplementedException();
        } else if (dataType instanceof DateDataType) {
            essentialDataType = ClickHouseDateValue.of(0);
        } else if (dataType instanceof DateTime64DataType) {
            essentialDataType = new Timestamp(0);
        } else if (dataType instanceof Enum16DataType) {
            essentialDataType = ((Enum16DataType) dataType).getValues().get(0).getName();
        } else if (dataType instanceof Float32DataType) {
            essentialDataType = 0.0;
        } else if (dataType instanceof Float64DataType) {
            essentialDataType = 0.0;
        } else if (dataType instanceof DecimalDataType) {
            essentialDataType = Decimal64Utils.ZERO;
        } else if (dataType instanceof Int8DataType) {
            essentialDataType = 0;
        } else if (dataType instanceof Int16DataType) {
            essentialDataType = 0;
        } else if (dataType instanceof Int32DataType) {
            essentialDataType = 0;
        } else if (dataType instanceof Int64DataType) {
            essentialDataType = 0;
        } else if (dataType instanceof NestedDataType) {
            essentialDataType = null;
        } else if (dataType instanceof ObjectDataType) {
            essentialDataType = null;
        } else {
            throw new UnsupportedOperationException(String.format("Cannot convert data type '%s'", dataType.getClass().getName()));
        }
        return essentialDataType;
    }