镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

JDBC-V2: ResultSet inferred type for arrays is always Object[] #2457

Description

@jnd77

Description

When retrieving a column, whose type is array, the inferred type is always Object[]; for example, it should be Long[] for Array(Int64).

Steps to reproduce

See code below.

Error Log or Exception StackTrace

See failing test below.

Expected Behaviour

Test should pass.

Code Example

  @Test
  void required_testJdbcWithArray() throws Exception {
    final String url = "jdbc:ch://localhost:8123";

    final Properties info = new Properties();
    info.put("user", "default");
    info.put("password", "");

    try (final Connection conn = DriverManager.getConnection(url, info)) {
      conn.prepareStatement("CREATE TABLE test_array_table"
          + " (id Int64, array_field Array(Int64)) ENGINE = MergeTree() ORDER BY id").execute();
      conn.prepareStatement("INSERT INTO test_array_table VALUES (1, [1,2,3])").execute();
      try (final Statement tableStatement = conn.createStatement();
      final ResultSet resultSet = tableStatement.executeQuery("SELECT `array_field` FROM `test_array_table`")) {
        resultSet.next();
        final Array columnValue = resultSet.getArray(1);
        // The 2 assertions below should pass: instead we retrieve Object[]
        Assertions.assertThat(columnValue.getArray()).isExactlyInstanceOf(Long[].class);
        Assertions.assertThat(JDBCType.valueOf(columnValue.getBaseType())).isEqualTo(JDBCType.BIGINT);
      }
    }
  }

Configuration

Client Configuration

See above.

Environment

  • Cloud
  • Client version:
  • Language version:
  • OS:

ClickHouse Server

  • ClickHouse Server version: 25.3.3.42
  • ClickHouse Server non-default settings, if any:
  • CREATE TABLE statements for tables involved:
  • Sample data for all these tables, use clickhouse-obfuscator if necessary

Activity

  1. added this to the 0.9.1 milestone on Jul 1, 2025
  2. added
    jdbc-v2jdbc-v2 issues
    area:jdbc-metadataissue handling metadata things like getting type of column
    on Jul 1, 2025
  3. removed this from the 0.9.1 milestone on Jul 21, 2025
  4. chernser commented on Aug 13, 2025

    @chernser
    Contributor

    Good day, @jnd77 !
    Thank you for reporting!

    We will look into it.

  5. added this to the 0.9.4 milestone on Oct 1, 2025
  6. removed this from the 0.9.5 milestone on Nov 17, 2025
  7. added this to the 0.9.5 milestone on Nov 26, 2025
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

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions