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
{{ message }}
Repository navigation
[jdbc-v2] DatabaseMetadata fails if server has a new type #2394
bugclientModule: the client (client-v2; with legacy: the v1 client)data-typesArea: type names, value encoding and decoding, row mapping, data formatsjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)jdbc-metadataDetail: JDBC metadata (DatabaseMetaData, ResultSetMetaData, type mapping)
java.lang.IllegalArgumentException: Unknown data type: Time64
at com.clickhouse.data.ClickHouseDataType.of(ClickHouseDataType.java:460)
at com.clickhouse.jdbc.metadata.DatabaseMetaDataTest.testGetTypeInfo(DatabaseMetaDataTest.java:234)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
This means that old client would not work with a new server even if type is never used.
Expected Behaviour
Warning but no exception when client reads a new type from a server.
There is a bug in Metadata reading type info (#2678 (comment)):
[ERROR] 2025-12-17 15:03:47.935 [main] c.c.j.metadata.DatabaseMetaDataImpl - Failed to convert column data type to SQL type: {}
java.lang.IllegalArgumentException: No enum constant com.clickhouse.data.ClickHouseDataType.Geometry
at java.base/java.lang.Enum.valueOf(Enum.java:293)
at com.clickhouse.data.ClickHouseDataType.valueOf(ClickHouseDataType.java:52)
at com.clickhouse.jdbc.metadata.DatabaseMetaDataImpl.lambda$static$2(DatabaseMetaDataImpl.java:1102)
at com.clickhouse.jdbc.internal.DetachedResultSet.createFromResultSet(DetachedResultSet.java:93)
at com.clickhouse.jdbc.metadata.DatabaseMetaDataImpl.getTypeInfo(DatabaseMetaDataImpl.java:1082)
at io.github.linghengqian.SimpleTest.simpleTest(SimpleTest.java:14)
Recommendation: Keep open — maintainer decision DatabaseMetaData does not fail on a type that the client does not know, but Client.getTableSchema does: the case of the 2025-12-18 comment. A maintainer decides whether this issue tracks that case, or closes it for the metadata part.
Category: Bug
Classification: impact: none · area: Data types & formats (unknown type names)
Status on main: Reproduced on main — for the table schema only. getTypeInfo and getColumns give OTHER (1111) and log an error for an unknown type (release 0.10.0, which does not know MultiPoint); no exception.
Breaking change: No — can be done without a break; today the call fails.
Analysis:getTypeInfo and getColumns catch the error of an unknown type and use OTHER (jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java:1417-1433, :1202-1217); the exception in the issue comes from its test, which calls ClickHouseDataType.of. TableSchemaParser.readTSKV throws ClientException for a column type that it cannot parse (client-v2/src/main/java/com/clickhouse/client/api/internal/TableSchemaParser.java:31-33), so getTableSchema (Client.java:2402) fails for the whole table, also when the caller does not use that column.
Reproduction: complete program and output
importcom.clickhouse.client.api.internal.TableSchemaParser;
importjava.io.ByteArrayInputStream;
importjava.nio.charset.StandardCharsets;
importjava.sql.Connection;
importjava.sql.DatabaseMetaData;
importjava.sql.DriverManager;
importjava.sql.ResultSet;
importjava.sql.Statement;
importjava.util.Properties;
publicclassRepro {
staticfinalStringURL = System.getenv().getOrDefault("CLICKHOUSE_URL", "http://localhost:8123");
staticfinalStringPASSWORD = System.getenv().getOrDefault("CLICKHOUSE_PASSWORD", "");
publicstaticvoidmain(String[] args) throwsException {
Propertiesprops = newProperties();
props.setProperty("user", "default");
props.setProperty("password", PASSWORD);
props.setProperty("compress", "false"); // release 0.10.0 cannot read the compressed responses of server 26.11StringjdbcUrl = "jdbc:clickhouse:" + URL.replaceFirst("^https?:", "") + "/default";
try (Connectionconn = DriverManager.getConnection(jdbcUrl, props)) {
try (Statementst = conn.createStatement()) {
st.execute("DROP TABLE IF EXISTS t2394");
st.execute("CREATE TABLE t2394 (id UInt32, mp MultiPoint) ENGINE = Memory");
}
DatabaseMetaDatamd = conn.getMetaData();
try (ResultSetrs = md.getTypeInfo()) {
introws = 0;
Stringmp = "missing";
while (rs.next()) {
rows++;
if ("MultiPoint".equals(rs.getString("TYPE_NAME"))) mp = String.valueOf(rs.getInt("DATA_TYPE"));
}
System.out.println("getTypeInfo: rows=" + rows + ", MultiPoint DATA_TYPE=" + mp);
} catch (Exceptione) {
System.out.println("getTypeInfo: " + e);
}
try (ResultSetrs = md.getColumns(null, "default", "t2394", null)) {
StringBuildersb = newStringBuilder();
while (rs.next()) sb.append(rs.getString("COLUMN_NAME")).append(' ').append(rs.getString("TYPE_NAME"))
.append(" DATA_TYPE=").append(rs.getInt("DATA_TYPE")).append("; ");
System.out.println("getColumns: " + sb);
} catch (Exceptione) {
System.out.println("getColumns: " + e);
}
try (Statementst = conn.createStatement()) {
st.execute("DROP TABLE t2394");
}
}
// Client.getTableSchema() parses the DESCRIBE TABLE rows with TableSchemaParser.readTSKV.// No type of the server is unknown to main, so give the parser a row with a type name that the client does not know.Stringdescribe = "name=id\ttype=UInt32\nname=v\ttype=FutureType\n";
try {
intn = TableSchemaParser.readTSKV(newByteArrayInputStream(describe.getBytes(StandardCharsets.UTF_8)),
"t", null, "default").getColumns().size();
System.out.println("table schema: " + n + " columns");
} catch (Exceptione) {
System.out.println("table schema: " + e.getClass().getName() + ": " + e.getMessage());
}
}
}
Output on main (8480ca001), ClickHouse 26.11.4.11:
getTypeInfo: rows=68, MultiPoint DATA_TYPE=2003
getColumns: id UInt32 DATA_TYPE=-5; mp MultiPoint DATA_TYPE=2003;
table schema: com.clickhouse.client.api.ClientException: Failed to parse column `v` defined by type 'FutureType'
Output on release 0.10.0, ClickHouse 26.11.4.11 (stack traces cut):
[main] ERROR com.clickhouse.jdbc.metadata.DatabaseMetaDataImpl - Unknown type: MultiPoint. Please check for a new version of the client.
getTypeInfo: rows=68, MultiPoint DATA_TYPE=1111
[main] ERROR com.clickhouse.jdbc.metadata.DatabaseMetaDataImpl - Failed to convert column data type to SQL type: {}
getColumns: id UInt32 DATA_TYPE=-5; mp MultiPoint DATA_TYPE=1111;
table schema: com.clickhouse.client.api.ClientException: Failed to parse column `v` defined by type 'FutureType'
Automated triage by Polyglot AI. A maintainer makes the final decision.
bugclientModule: the client (client-v2; with legacy: the v1 client)data-typesArea: type names, value encoding and decoding, row mapping, data formatsjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)jdbc-metadataDetail: JDBC metadata (DatabaseMetaData, ResultSetMetaData, type mapping)
Activity
mshustov commentedon May 28, 2025
@chernser, it seems to have been revered ClickHouse/ClickHouse#75735, but agree the client shouldn't fail on a new type
chernser commentedon Jun 27, 2025
This exception happens actually in the test so its fine. And indicates missing type.
However we may need to find place where it can cause an error.
chernser commentedon Dec 17, 2025
There is a bug in Metadata reading type info (#2678 (comment)):
3 remaining items
chernser commentedon Dec 18, 2025
There is a potential problem with reading data schema containing unknown Datatype.
We may ignore columns with unknown types but should:
polyglotAI-bot commentedon Nov 28, 2026
Recommendation: Keep open — maintainer decision
DatabaseMetaDatadoes not fail on a type that the client does not know, butClient.getTableSchemadoes: the case of the 2025-12-18 comment. A maintainer decides whether this issue tracks that case, or closes it for the metadata part.main: Reproduced on main — for the table schema only.getTypeInfoandgetColumnsgiveOTHER(1111) and log an error for an unknown type (release 0.10.0, which does not knowMultiPoint); no exception.Analysis:
getTypeInfoandgetColumnscatch the error of an unknown type and useOTHER(jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java:1417-1433,:1202-1217); the exception in the issue comes from its test, which callsClickHouseDataType.of.TableSchemaParser.readTSKVthrowsClientExceptionfor a column type that it cannot parse (client-v2/src/main/java/com/clickhouse/client/api/internal/TableSchemaParser.java:31-33), sogetTableSchema(Client.java:2402) fails for the whole table, also when the caller does not use that column.Reproduction: complete program and output
Output on
main(8480ca001), ClickHouse 26.11.4.11:Output on release 0.10.0, ClickHouse 26.11.4.11 (stack traces cut):
Automated triage by Polyglot AI. A maintainer makes the final decision.