apache / arrow-java

Official Java implementation of Apache Arrow
https://arrow.apache.org/
Apache License 2.0
4 stars 4 forks source link

[JAVA] [arrow-jdbc] Unmapped data type 2014 (TIMESTAMP_WITH_TIMEZONE) #118

Open amir-bashir opened 8 months ago

amir-bashir commented 8 months ago

Describe the usage question you have. Please include as many useful details as possible.

I have an iceberg table with column type "TIMESTAMP_WITH_TIMEZONE"

When I run my flight_sql jdbc client to query this table, I get below error in my flight sql client code.

Exception in thread "Thread-0" java.lang.RuntimeException: java.sql.SQLException: Error while executing SQL "SELECT * FROM datawarehouse.school_data_raw.schools limit 100": Unknown error: java.lang.UnsupportedOperationException: Unmapped JDBC type: 2014
    at ai.saal.arrowjdbcclient.ArrowJdbcClient.runQueryOnArrow(ArrowJdbcClient.java:123)
    at ai.saal.arrowjdbcclient.ArrowJdbcClient.run(ArrowJdbcClient.java:41)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.sql.SQLException: Error while executing SQL "SELECT * FROM datawarehouse.school_data_raw.schools limit 100": Unknown error: java.lang.UnsupportedOperationException: Unmapped JDBC type: 2014
    at cfjd.org.apache.calcite.avatica.Helper.createException(Helper.java:56)
    at cfjd.org.apache.calcite.avatica.Helper.createException(Helper.java:41)
    at cfjd.org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:163)
    at cfjd.org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:227)
    at ai.saal.arrowjdbcclient.ArrowJdbcClient.runQueryOnArrow(ArrowJdbcClient.java:97)
    ... 2 more
Caused by: cfjd.org.apache.arrow.flight.FlightRuntimeException: INTERNAL: Unknown error: java.lang.UnsupportedOperationException: Unmapped JDBC type: 2014
    at cfjd.org.apache.arrow.flight.CallStatus.toRuntimeException(CallStatus.java:131)
    at cfjd.org.apache.arrow.flight.grpc.StatusUtils.fromGrpcRuntimeException(StatusUtils.java:164)
    at cfjd.org.apache.arrow.flight.grpc.StatusUtils$1.next(StatusUtils.java:250)
    at cfjd.org.apache.arrow.flight.sql.FlightSqlClient$PreparedStatement.<init>(FlightSqlClient.java:941)
    at cfjd.org.apache.arrow.flight.sql.FlightSqlClient.prepare(FlightSqlClient.java:728)
    at cfjd.org.apache.arrow.flight.sql.FlightSqlClient.prepare(FlightSqlClient.java:708)
    at org.apache.arrow.driver.jdbc.client.ArrowFlightSqlClientHandler.prepare(ArrowFlightSqlClientHandler.java:170)
    at org.apache.arrow.driver.jdbc.ArrowFlightMetaImpl.prepareAndExecute(ArrowFlightMetaImpl.java:161)
    at cfjd.org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:675)
    at cfjd.org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
    ... 4 more

Query I am running is *SELECT FROM datawarehouse.school_data_raw.schools limit 100**

Table structure is :

_CREATE TABLE datawarehouse.school_data_raw.schools ( school_id varchar, school_name varchar, ingested_at timestamp(6) with time zone ) WITH ( format = 'PARQUET', format_version = 1, location = 's3a://data-warehouse/raw/schooldata/schools' )

Component(s)

Java

vibhatha commented 8 months ago

Would it be possible to get a reproducible script?

aiguofer commented 7 months ago

Potentially related apache/arrow-java#171. Are you the owner of the AFS server? If not, what AFS service are you trying to query?