Skip to content

DatabricksArray.getResultSet() is not implemented #1737

Description

@rileythomp

Is your feature request related to a problem? Please describe.

DatabricksArray.getResultSet() is not supported, all 4 implementations throw DatabricksSQLFeatureNotSupportedException("getResultSet() not implemented").

Describe the solution you'd like

DatabricksArray.getResultSet() should return a ResultSet with one row for each element. Other JDBC drivers like Postgres and ClickHouse support this.

Databricks:

String connStr = "jdbc:databricks://<DATABRICKS_HOST>:443/";
try (Connection con = DriverManager.getConnection(connStr, props);
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT ARRAY['a', 'b', 'c']")) {
    rs.next();
    Array array = rs.getArray(1);
    ResultSet elements = array.getResultSet(); // throws here
    while (elements.next()) {
        System.out.println(elements.getLong(1) + " -> " + elements.getString(2));
    }
}
Exception in thread "main" java.sql.SQLFeatureNotSupportedException: getResultSet not supported
        at io.trino.jdbc.TrinoArray.getResultSet(TrinoArray.java:89)
        at Main.main(Main.java:16)

Postgres:

String connStr = "jdbc:postgresql://localhost:5432/postgres";
try (Connection con = DriverManager.getConnection(connStr, "user", "password");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT ARRAY['a', 'b', 'c']")) {
    rs.next();
    Array array = rs.getArray(1);
    ResultSet elements = array.getResultSet();
    while (elements.next()) {
        System.out.println(elements.getLong(1) + " -> " + elements.getString(2));
    }
}
1 -> a
2 -> b
3 -> c

Describe alternatives or workarounds you've considered

You can work around by calling getArray and doing some ugly casting.

Additional context

N/A

Activity

  1. added
    enhancementNew feature or request
    engineer-botMaintainer-only: triggers the autonomous engineer-bot (bug-fix author on issues; follow-up on PRs)
    on Oct 22, 2026
  2. peco-engineer-bot commented on Oct 22, 2026

    @peco-engineer-bot
    Contributor

    🤖 engineer-bot opened a fix PR: #1739

    Review before merge.

  3. added a commit that references this issue on Nov 2, 2026
    e46e099
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

    engineer-botMaintainer-only: triggers the autonomous engineer-bot (bug-fix author on issues; follow-up on PRs)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions