hutiefang76 opened a new issue, #12589:
URL: https://github.com/apache/seatunnel/issues/12589

   ### Search before asking
   
   Checked existing DuckDB issues and PRs, including #12542. This report 
concerns unzoned timestamp aliases and their read values; the broader native 
query-schema issue remains separate.
   
   ### What happened
   
   On current dev with duckdb_jdbc 1.3.1.0, `table_path` discovery maps 
`TIMESTAMP_S`, `TIMESTAMP_MS` and `TIMESTAMP_NS` to STRING. The shared 
timestamp getter also shifts DuckDB local timestamps when it falls back to 
`getTimestamp(index, UTC Calendar)`. A query containing `TIMESTAMP_S 
'2024-01-01 12:34:56'` is read as `2024-01-01T20:34:56` with the JVM default 
time zone set to Asia/Shanghai.
   
   ### Expected behavior
   
   These unzoned timestamp types should map to TIMESTAMP and preserve their 
stored local date and time, including the fractional precision returned by the 
driver and NULL values.
   
   ### Reproduction
   
   ```sql
   CREATE TABLE ts_aliases(s TIMESTAMP_S, ms TIMESTAMP_MS, ns TIMESTAMP_NS);
   INSERT INTO ts_aliases VALUES
    (TIMESTAMP_S '2024-01-01 12:34:56',
     TIMESTAMP_MS '2024-01-01 12:34:56.123',
     TIMESTAMP_NS '2024-01-01 12:34:56.123456789');
   ```
   
   Read the table with JDBC Source `table_path = "main.ts_aliases"`. For the 
time-zone case, use `query = "SELECT s, ms, ns FROM main.ts_aliases"` and a JVM 
default time zone of Asia/Shanghai. Compare the returned local times with the 
literals above.
   
   Reproduced through the actual JdbcSourceFactory and existing DuckDB 
catalog/Source tests. The alias regressions fail on the original production 
code; a separate query read regression also shows the eight-hour shift. UTC and 
America/Los_Angeles are included as controls in the proposed patch.
   
   ### Version
   
   Current dev, 3.0.0-SNAPSHOT; duckdb_jdbc 1.3.1.0; JDK 8 and 17. No 
released-version range or backport claim.
   
   ### Are you willing to submit PR?
   
   Yes. A focused timestamp fix and regressions are prepared. It does not 
switch the full query schema to a native mapper or close #12542.
   
   AI disclosure: Codex assisted this report; DeepSeek and Codex assisted the 
proposed code and tests.
   


-- 
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