public static int getSqlElementType()

in java/clickhouse-client/src/main/java/com/epam/deltix/clickhouse/writer/codec/CodecUtil.java [102:132]


    public static int getSqlElementType(Class<?> elementType) {
        if (ParseHelper.convertibleToStringDataType(elementType)) {
            return Types.VARCHAR;
        } else if (ParseHelper.convertibleToUInt8DataType(elementType)) {
            return Types.BOOLEAN;
        } else if (ParseHelper.convertibleToInt8DataType(elementType)) {
            return Types.TINYINT;
        } else if (ParseHelper.convertibleToInt16DataType(elementType)) {
            return Types.SMALLINT;
        } else if (ParseHelper.convertibleToInt32DataType(elementType)) {
            return Types.INTEGER;
        } else if (ParseHelper.convertibleToInt64DataType(elementType)) {
            return Types.BIGINT;
        } else if (ParseHelper.convertibleToFloat32DataType(elementType)) {
            return Types.FLOAT;
        } else if (ParseHelper.convertibleToFloat64DataType(elementType)) {
            return Types.DOUBLE;
        } else if (ParseHelper.convertibleToDecimalDataType(elementType)) {
            return Types.DECIMAL;
        } else if (elementType.isEnum())
            return Types.VARCHAR;

        // todo support date/time
/*        else if (Date.class.isAssignableFrom(elementType)) {
            return Types.DATE;
        } else if (Time.class.isAssignableFrom(elementType)) {
            return Types.TIME;
        }*/

        throw new UnsupportedOperationException(String.format("Unsupported type: %s", elementType));
    }