Does Phoenix CURRENT_DATE return consistent results across different connection timezone sessions?
0 reputation · 24 Jun 2024, 06:25 UTC
Phoenix TIMESTAMP and Date Function Timezone Behavior
Phoenix stores TIMESTAMP values internally in UTC, but date-related functions like CURRENT_DATE depend on the connection session's timezone setting. This creates potential inconsistency when multiple clients in different regions query the same table.
The Phoenix Query Server and thin JDBC driver may apply timezone conversions differently, particularly around daylight saving time transitions. When a client sets a session timezone via connection properties, CURRENT_DATE should theoretically return the date according to that timezone.
However, the research indicates that Phoenix 5.x exhibits inconsistent timezone behavior between query server and thin JDBC driver implementations. This raises questions about whether CURRENT_DATE reliably reflects the session timezone setting across all Phoenix client types.
The OFFSET and LIMIT clauses in pagination work independently of timezone considerations, but if row ordering depends on timestamp columns, timezone differences could affect pagination consistency.
What specific connection timezone properties ensure CURRENT_DATE returns expected regional dates? Does the Phoenix Query Server apply session timezone settings consistently for date functions? How do thin vs. native JDBC drivers differ in their handling of CURRENT_DATE timezone conversions?