jeremyosterhoudt opened a new issue, #818:
URL: https://github.com/apache/arrow-java/issues/818

   ### 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:
   
   ```java
   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) |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to