Fix: honor querySetting.timezone for timestamp interpretation #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The DataCloud JDBC driver was not properly handling timezone settings for timestamp interpretation. When the `querySetting.timezone` connection property was set, timestamp values were still being interpreted using the system default timezone instead of the configured session timezone, breaking timezone-aware applications.
Example Issue:
```sql
SELECT
'2024-01-01 17:30:00'::timestamp AS ts_naive,
'2024-01-01 17:30:00+00:00'::timestamptz AS ts_utc
```
All timezone configurations returned identical values:
Root Cause
Solution
Core Changes
1. Enhanced TimeStampVectorAccessor
2. Updated QueryJDBCAccessorFactory
3. Enhanced StreamingResultSet
4. Updated Query Execution Pipeline
Verification
Tests Updated:
Behavior After Fix:
The same query now returns correct timezone-adjusted values:
Backward Compatibility
This implementation ensures that the DataCloud JDBC driver correctly honors the `querySetting.timezone` property for timestamp interpretation while maintaining full backward compatibility and robust error handling.