apache / apache/arrow-java

Flight SQL JDBC: Fix timezone/timestamp handling

未關閉
#732 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
Type: enhancement
主要語言
Java
星號
94
分支
152
平均合併
3 天 16 小時
30 天內合併 PR
11

描述

### Describe the enhancement requested

I believe the JDBC driver is handling timezones/timestamps/java.sql.Timestamp entirely incorrectly.

- Timestamps are round-tripped through LocalDateTime always. I believe this is wrong for timestamps with timezones: we should not round trip through a wall clock time since the same wall clock time may correspond to multiple different instants (during a DST transition)
- From experimenting with the PostgreSQL JDBC driver, it appears that when requesting a java.sql.Timestamp, the expected behavior is:

- Naive timestamp: return a Timestamp that appears to have the right wall clock time in the given Calendar, or the system time zone if no calendar is supplied. (In other words, use Timestamp as a janky LocalDateTime.)
- Zoned timestamp: return a Timestamp whose value is the timestamp in UTC. (In other words, use Timestamp as an Instant.)

It appears our driver does not do this properly.

貢獻指南

開啟貢獻指南

研究方向

首先追蹤 Flight SQL JDBC driver 對 java.sql.Timestamp、LocalDateTime、時區和 Calendar 的處理方式,並將其行為與 issue 中描述的 PostgreSQL JDBC 預期進行比較。完成的標準是:無時區時間戳保留要求的牆上時鐘值,帶時區的時間戳保留 UTC 時刻,包括跨越 DST 轉換時的行為。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java
領域
databases
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。