public ClickHouseColumn toColumn(int sqlType, int scaleOrLength) {
        ClickHouseDataType dataType = getDataType(sqlType);
        ClickHouseColumn column = null;
        if (scaleOrLength > 0) {
            if (sqlType == Types.BIT && scaleOrLength == 1) {
                dataType = ClickHouseDataType.UInt8;
            } else if (sqlType == Types.NUMERIC || sqlType == Types.DECIMAL) {
                for (ClickHouseDataType t : new ClickHouseDataType[] {}) {
                    if (scaleOrLength <= t.getMaxScale() / 2) {
                        column = ClickHouseColumn.of("", t, false, t.getMaxPrecision() - t.getMaxScale(),
                                scaleOrLength);
                        break;
                    }
                }
            } else if (dataType == ClickHouseDataType.Date) {
                if (scaleOrLength > 2) {
                    dataType = ClickHouseDataType.Date32;
                }
            } else if (dataType == ClickHouseDataType.DateTime) {
                column = ClickHouseColumn.of("", ClickHouseDataType.DateTime64, false, 0, scaleOrLength);
            } else if (dataType == ClickHouseDataType.String) {
                column = ClickHouseColumn.of("", ClickHouseDataType.FixedString, false, scaleOrLength, 0);
            }
        }

        return column == null ? ClickHouseColumn.of("", dataType, false, false) : column;
    }
Converts {@link Types} to ClickHouse column.

@param sqlType       generic SQL types defined in JDBC
@param scaleOrLength scale or length
@return non-null ClickHouse column
clickhouse-jdbc/src/main/java/com/clickhouse/jdbc/JdbcTypeMapping.java