Here you can find the source of toSqlType(String clickshouseType)
public static int toSqlType(String clickshouseType)
//package com.java2s; //License from project: Apache License import java.sql.Types; public class Main { public static int toSqlType(String clickshouseType) { if (isNullable(clickshouseType)) { clickshouseType = unwrapNullable(clickshouseType); }/* w w w . ja v a 2 s . co m*/ if (clickshouseType.startsWith("Int") || clickshouseType.startsWith("UInt")) { return clickshouseType.endsWith("64") ? Types.BIGINT : Types.INTEGER; } if ("String".equals(clickshouseType)) return Types.VARCHAR; if (clickshouseType.startsWith("Float32")) return Types.FLOAT; if (clickshouseType.startsWith("Float64")) return Types.DOUBLE; if ("Date".equals(clickshouseType)) return Types.DATE; if ("DateTime".equals(clickshouseType)) return Types.TIMESTAMP; if ("FixedString".equals(clickshouseType)) return Types.BLOB; if (isArray(clickshouseType)) return Types.ARRAY; // don't know what to return actually return Types.VARCHAR; } private static boolean isNullable(String clickshouseType) { return clickshouseType.startsWith("Nullable(") && clickshouseType.endsWith(")"); } private static String unwrapNullable(String clickshouseType) { return clickshouseType.substring("Nullable(".length(), clickshouseType.length() - 1); } private static boolean isArray(String clickhouseType) { return clickhouseType.startsWith("Array(") && clickhouseType.endsWith(")"); } }