Skip to content

[FlightSQLJDBC] not implemented exception when fetching TimeStamp from ResultSet #818

@jeremyosterhoudt

Description

@jeremyosterhoudt

Describe the bug, including details regarding any error messages, version, and platform.

Description

When a TimeStamp is returned in a Flight SQL JDBC ResultSet an exception is throw when accessing the value via getObject(index). It works using getObject(columnName). Below as a simple example of how the problem can be reproduced:

try (var connection = DriverManager.getConnection("jdbc:arrow-flight://localhost:5000;useEncryption=false");
             PreparedStatement createStatement = connection.prepareStatement("create table if not exists test (ts timestamp, id bigint)");
             PreparedStatement insertStatement = connection.prepareStatement("insert into test values ('1970-04-01 21:39:50', 2)");
             PreparedStatement selectStatement = connection.prepareStatement("select ts from test where id = 2")
) {

    createStatement.execute();
    insertStatement.executeUpdate();

    try (var rs = selectStatement.executeQuery()) {
        while (rs.next()) {

            // Fails with a not implemented exception
            System.out.println(rs.getObject(1)); 

            // works
            System.out.println(rs.getObject("ts")); 
        }
    }
}

Here is the stack trace for the getObject(index)

Exception in thread "main" java.lang.RuntimeException: not implemented
	at org.apache.arrow.driver.jdbc.shaded.org.apache.calcite.avatica.AvaticaSite.notImplemented(AvaticaSite.java:422)
	at org.apache.arrow.driver.jdbc.shaded.org.apache.calcite.avatica.AvaticaSite.get(AvaticaSite.java:381)
	at org.apache.arrow.driver.jdbc.shaded.org.apache.calcite.avatica.AvaticaResultSet.getObject(AvaticaResultSet.java:395)
	at JDBCParamTest.runDateTimeTimestampExample(JDBCParamTest.java:91)
	at JDBCParamTest.main(JDBCParamTest.java:14)

Version information:

item version
Java Zulu 21.0.8 (ARM)
Flight SQL JDBC 18.3.0
macOS 15.6 (Apple Silicon)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions