Skip to content

[jdbc-v2] DatabaseMetadata fails if server has a new type #2394

Description

@chernser

Description

Stacktrace:

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.

Activity

  1. added this to the 0.9.0 milestone on May 28, 2025
  2. mshustov commented on May 28, 2025

    @mshustov
    Member

    @chernser, it seems to have been revered ClickHouse/ClickHouse#75735, but agree the client shouldn't fail on a new type

  3. chernser commented on Jun 27, 2025

    @chernser
    ContributorAuthor

    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.

  4. removed this from the 0.9.1 milestone on Jul 21, 2025
  5. chernser commented on Dec 17, 2025

    @chernser
    ContributorAuthor

    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)
    
  6. added this to the 0.9.5 milestone on Dec 17, 2025
  7. modified the milestones: 0.9.5, 0.9.6 on Dec 18, 2025
  8. chernser commented on Dec 18, 2025

    @chernser
    ContributorAuthor

    There is a potential problem with reading data schema containing unknown Datatype.
    We may ignore columns with unknown types but should:

    • create a special ClickhouseColumn instance that indicate unknown column to prevent accidental usage in binary writers and readers
    • write documentation around it
    • configuration flag?? may be not.
  9. modified the milestones: 0.9.6, 0.9.7 on Jan 7, 2026
  10. modified the milestones: 0.9.7, 0.9.8 on Jan 21, 2026
  11. modified the milestones: 0.9.8, 0.9.9 on Mar 16, 2026
  12. added this to the 0.12.0 milestone on Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:jdbc-metadataissue handling metadata things like getting type of columnbugjdbc-v2jdbc-v2 issues

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions