apache / apache/arrow-java

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

Open
#118 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
94
Forks
152
Avg merge
3d 16h
Merged PRs (30d)
11

Description

### 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.(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/school_data/schools' )_

### Component(s)

Java

Contributor guide

Open the contributing guide

Research direction

Start by tracing the preparation path shown in ArrowFlightMetaImpl.prepareAndExecute through ArrowFlightSqlClient and the JDBC metadata handling for type 2014. Reproduce the SELECT query against a TIMESTAMP_WITH_TIMEZONE column and identify the expected behavior for that JDBC type; done means the query no longer fails with an unmapped-type error and coverage verifies it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.