static String toAnsiSqlType(ClickHouseDataType dataType, int precision, int scale, TimeZone tz) {
            final String typeName;
            switch (dataType) {
                case Bool:
                    typeName = "BOOLEAN"; // or BIT(1)?
                    break;
                case Date:
                case Date32:
                    typeName = "DATE";
                    break;
                case DateTime:
                case DateTime32:
                case DateTime64:
                    typeName = (scale <= 0 ? new StringBuilder("TIMESTAMP")
                            : new StringBuilder("TIMESTAMP(").append(scale).append(')'))
                            .append(tz != null ? " WITH TIMEZONE" : "").toString();
                    break;
                case Int8:
                    typeName = "BYTE"; // NON-standard
                    break;
                case UInt8:
                case Int16:
                    typeName = "SMALLINT";
                    break;
                case UInt16:
                case Int32:
                    typeName = "INTEGER";
                    break;
                case UInt32:
                case Int64:
                case IntervalYear:
                case IntervalQuarter:
                case IntervalMonth:
                case IntervalWeek:
                case IntervalDay:
                case IntervalHour:
                case IntervalMinute:
                case IntervalSecond:
                case IntervalMicrosecond:
                case IntervalMillisecond:
                case IntervalNanosecond:
                    typeName = "BIGINT";
                    break;
                case UInt64:
                case Int128:
                case UInt128:
                case Int256:
                case UInt256:
                case Decimal:
                case Decimal32:
                case Decimal64:
                case Decimal128:
                case Decimal256:
                    typeName = new StringBuilder("DECIMAL(").append(precision).append(',')
                            .append(scale).append(')').toString();
                    break;
                case Float32:
                    typeName = "REAL";
                    break;
                case Float64:
                    typeName = "DOUBLE PRECISION";
                    break;
                case Point:
                case Ring:
                case Polygon:
                case MultiPolygon:
                    typeName = "ARRAY";
                    break;
                case Enum8:
                case Enum16:
                case IPv4:
                case IPv6:
                case JSON:
                case Object:
                case FixedString:
                case String:
                case UUID:
                    typeName = "VARCHAR";
                    break;
                default:
                    typeName = "BINARY";
                    break;
            }
            return typeName;
        }
This class defines mappings among {@link Types}, {@link JDBCType},
{@link ClickHouseDataType}, {@link ClickHouseColumn}, and {@link Class}. It
does not impact serialization and deserialization, which is handled
separately by {@link com.clickhouse.data.ClickHouseDataProcessor}.
clickhouse-jdbc/src/main/java/com/clickhouse/jdbc/JdbcTypeMapping.java