Always use iso format and test timezone impact - #75
Merged
Conversation
serprex
approved these changes
Aug 28, 2026
I noticed that timestamptz values weren't exported with time zone information, which is necessary to ensure proper round-tripping. Add the `date_time_output_format='iso'` setting to each chDB query to always format `timestamp` and `timestamptz` values in plain text formats with the ISO-8601 format in UTC. Remove setting the `datestyle` and `timezone` GUCs to hard-coded constants, instead allowing them to be respected. Or at least, we respect the `timezone` GUC for converting `timestamp` values, but always emit UTC for both timestamp and timestamptz, since that's all that `date_time_output_format='iso'` supports. Add a new test file, `test/sql/timestamp.sql` to test the impact of the new setting on plain-text output, as well as the impact of the `timezone` setting on `timestamp` values. Interestingly, setting a time zone in the structure, e.g. `DateTime64(3, 'Japan')`, has no impact on exported values. Add the "Timestamp Conversion" section to the chdb_hook docs to document these behaviors. In passing, change the `real` columns in `test/qa/taxi.sql` to `double precision`, since the source defines the values as `Float64`.
theory
force-pushed
the
timestamp-format
branch
from
August 28, 2026 23:10
008afa3 to
f4cbc98
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I noticed that timestamptz values weren't exported with time zone information, which is necessary to ensure proper round-tripping.
Add the
date_time_output_format='iso'setting to each chDB query to always formattimestampandtimestamptzvalues in plain text formats with the ISO-8601 format in UTC.Remove setting the
datestyleandtimezoneGUCs to hard-coded constants, instead allowing them to be respected. Or at least, we respect thetimezoneGUC for convertingtimestampvalues, but always emit UTC for both timestamp and timestamptz, since that's all thatdate_time_output_format='iso'supports.Add a new test file,
test/sql/timestamp.sqlto test the impact of the new setting on plain-text output, as well as the impact of thetimezonesetting ontimestampvalues. Interestingly, setting a time zone in the structure, e.g.DateTime64(3, 'Japan'), has no impact on exported values.Add the "Timestamp Conversion" section to the chdb_hook docs to document these behaviors.
In passing, change the
realcolumns intest/qa/taxi.sqltodouble precision, since the source defines the values asFloat64.