apache / apache/arrow-java

Flight SQL JDBC: Fix timezone/timestamp handling

Ouverte
#732 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Type: enhancement
Langage dominant
Java
Étoiles
94
Forks
152
Merge moyen
3 j 16 h
PR mergées (30 j)
11

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par retracer la manière dont le Flight SQL JDBC driver gère java.sql.Timestamp, LocalDateTime, les fuseaux horaires et Calendar, en comparant le comportement aux attentes de PostgreSQL JDBC décrites dans l’issue. Le travail est considéré comme terminé lorsque les horodatages naïfs préservent la valeur d’heure civile demandée et que les horodatages avec fuseau préservent l’instant UTC, y compris le comportement lors des transitions DST.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
databases
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.