private static String getDataTypeInfoSql() {
        StringBuilder sql = new StringBuilder("SELECT " +
                "name AS TYPE_NAME, " +
                "if(empty(alias_to), name, alias_to) AS DATA_TYPE, " + // passing type name or alias if exists to map then
                "attrs.c2 AS PRECISION, " +
                "NULL AS LITERAL_PREFIX, " +
                "NULL AS LITERAL_SUFFIX, " +
                "NULL AS CREATE_PARAMS, " +
                "name AS NULLABLE, " + // passing type name to map for nullable
                "not(dt.case_insensitive)::Boolean AS CASE_SENSITIVE, " +
                java.sql.DatabaseMetaData.typeSearchable + " AS SEARCHABLE, " +
                "not(attrs.c3)::Boolean AS UNSIGNED_ATTRIBUTE, " +
                "false AS FIXED_PREC_SCALE, " +
                "false AS AUTO_INCREMENT, " +
                "name AS LOCAL_TYPE_NAME, " +
                "attrs.c4 AS MINIMUM_SCALE, " +
                "attrs.c5 AS MAXIMUM_SCALE, " +
                "0 AS SQL_DATA_TYPE, " +
                "0 AS SQL_DATETIME_SUB, " +
                "0 AS NUM_PREC_RADIX " +
                "FROM system.data_type_families dt " +
                " LEFT JOIN (SELECT * FROM VALUES ( ");
        for (ClickHouseDataType type : ClickHouseDataType.values()) {
            sql.append("(")
                    .append('\'').append(type.name()).append("',") // c1
                    .append(type.getMaxPrecision()).append(',') // c2
                    .append(type.isSigned()).append(',') // c3
                    .append(type.getMinScale()).append(',') // c4
                    .append(type.getMaxScale()) // c5
                    .append("),");
        }
        sql.setLength(sql.length() - 1);
        sql.append(") ");

        sql.append(") as attrs ON (dt.name = attrs.c1)")
                .append(" WHERE alias_to == ''");
        return sql.toString();
    }
Returns name of the ClickHouse table types as the broad category (rather than engine name).
@return - ResultSet with one column TABLE_TYPE
@throws SQLException - if an error occurs
jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java