Flight SQL JDBC: Fix timezone/timestamp handling
- Vorherrschende Sprache
- Java
- Sterne
- 94
- Forks
- 152
- Ø Merge
- 3 T. 16 Std.
- Gemergte PRs (30 T.)
- 11
Beschreibung
### 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.
Beitragsleitfaden
Rechercherichtung
Beginne damit, die Verarbeitung von java.sql.Timestamp, LocalDateTime, Zeitzonen und Calendar durch den Flight SQL JDBC driver nachzuverfolgen, und vergleiche das Verhalten mit den im Issue beschriebenen Erwartungen des PostgreSQL JDBC-Treibers. Als erfüllt gilt dies, wenn naive Zeitstempel den angeforderten Wanduhrzeitwert beibehalten und Zeitstempel mit Zeitzonen den UTC-Zeitpunkt beibehalten, einschließlich des Verhaltens bei DST-Übergängen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- databases
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100