You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that clickhouse-jdbc after the 0.8.1 version is no longer compatible with liquibase.
We were successfully using 0.6.0-patch5 version successfully with liquibase. We tried to upgrade to 0.8.1 and facing certain issues with liquibase-core library. We are using liquibase-core 4.29.2 version
In the DatabaseMetaData.java class while fetching the columns metadata, the query to get columns takes system.columns.type as the DATA_TYPE, which returns a String, but liquibase-core accepts DATA_TYPE only as an Integer. This is throwing a NumberFormatException, and it seems there is no workaround for this issue.
DatabaseMetaData -> String sql = "SELECT " + this.catalogPlaceholder + " AS TABLE_CAT, database AS TABLE_SCHEM, table AS TABLE_NAME, name AS COLUMN_NAME, system.columns.type AS DATA_TYPE, type AS TYPE_NAME, " + JdbcUtils.generateSqlTypeSizes("system.columns.type") + " AS COLUMN_SIZE, toInt32(0) AS BUFFER_LENGTH, IF (numeric_scale == 0, NULL, numeric_scale) as DECIMAL_DIGITS, toInt32(numeric_precision_radix) AS NUM_PREC_RADIX, toInt32(position(type, 'Nullable(') >= 1 ?" + 1 + " : " + 0 + ") as NULLABLE, system.columns.comment AS REMARKS, system.columns.default_expression AS COLUMN_DEF, toInt32(0) AS SQL_DATA_TYPE, toInt32(0) AS SQL_DATETIME_SUB, character_octet_length AS CHAR_OCTET_LENGTH, toInt32(system.columns.position) AS ORDINAL_POSITION, position(upper(type), 'NULLABLE') >= 1 ? 'YES' : 'NO' AS IS_NULLABLE,NULL AS SCOPE_CATALOG, NULL AS SCOPE_SCHEMA, NULL AS SCOPE_TABLE, NULL AS SOURCE_DATA_TYPE, 'NO' as IS_AUTOINCREMENT, 'NO' as IS_GENERATEDCOLUMN FROM system.columns WHERE database LIKE '" + (schemaPattern == null ? "%" : schemaPattern) + "' AND table LIKE '" + (tableNamePattern == null ? "%" : tableNamePattern) + "' AND name LIKE '" + (columnNamePattern == null ? "%" : columnNamePattern) + "' ORDER BY TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION";
liquibase-core ->
int dataType = columnMetadataResultSet.getInt("DATA_TYPE");
Is there a way, we may be able to override the getColumns method and change the query? Or some workaround for the issue?
The text was updated successfully, but these errors were encountered:
This is really bad, and will break any application/process that uses the JDBC meta-data to drive data access. DatabaseMetaData.getColumns() should return this, as defined by Java Spec:
This should be fixed in the driver to adhere to the JDBC specification. It needs to return the JDBC type as defined in java.sql.Types. The driver is now just returning the name of the data type, like: "UInt32"
It seems that clickhouse-jdbc after the 0.8.1 version is no longer compatible with liquibase.
We were successfully using 0.6.0-patch5 version successfully with liquibase. We tried to upgrade to 0.8.1 and facing certain issues with liquibase-core library. We are using liquibase-core 4.29.2 version
In the DatabaseMetaData.java class while fetching the columns metadata, the query to get columns takes system.columns.type as the DATA_TYPE, which returns a String, but liquibase-core accepts DATA_TYPE only as an Integer. This is throwing a NumberFormatException, and it seems there is no workaround for this issue.
DatabaseMetaData ->
String sql = "SELECT " + this.catalogPlaceholder + " AS TABLE_CAT, database AS TABLE_SCHEM, table AS TABLE_NAME, name AS COLUMN_NAME, system.columns.type AS DATA_TYPE, type AS TYPE_NAME, " + JdbcUtils.generateSqlTypeSizes("system.columns.type") + " AS COLUMN_SIZE, toInt32(0) AS BUFFER_LENGTH, IF (numeric_scale == 0, NULL, numeric_scale) as DECIMAL_DIGITS, toInt32(numeric_precision_radix) AS NUM_PREC_RADIX, toInt32(position(type, 'Nullable(') >= 1 ?" + 1 + " : " + 0 + ") as NULLABLE, system.columns.comment AS REMARKS, system.columns.default_expression AS COLUMN_DEF, toInt32(0) AS SQL_DATA_TYPE, toInt32(0) AS SQL_DATETIME_SUB, character_octet_length AS CHAR_OCTET_LENGTH, toInt32(system.columns.position) AS ORDINAL_POSITION, position(upper(type), 'NULLABLE') >= 1 ? 'YES' : 'NO' AS IS_NULLABLE,NULL AS SCOPE_CATALOG, NULL AS SCOPE_SCHEMA, NULL AS SCOPE_TABLE, NULL AS SOURCE_DATA_TYPE, 'NO' as IS_AUTOINCREMENT, 'NO' as IS_GENERATEDCOLUMN FROM system.columns WHERE database LIKE '" + (schemaPattern == null ? "%" : schemaPattern) + "' AND table LIKE '" + (tableNamePattern == null ? "%" : tableNamePattern) + "' AND name LIKE '" + (columnNamePattern == null ? "%" : columnNamePattern) + "' ORDER BY TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION";
liquibase-core ->
int dataType = columnMetadataResultSet.getInt("DATA_TYPE");
Is there a way, we may be able to override the getColumns method and change the query? Or some workaround for the issue?
The text was updated successfully, but these errors were encountered: