-
Notifications
You must be signed in to change notification settings - Fork 376
Supporting time zone #1319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Another issue would be how we treat the timestamps in parquet which contain a int64 value along with a timezone, should we adjust the int64 value into UTC time zone? According to Parquet's doc, timestamp values are either adjusted to UTC or not adjusted to UTC.
We may first support adjuested timestamps, since converting non-adjusted timestamps requires identifying the time zone info with numerous aliases. |
I think we can adjust all timestamp-related types to UTC, and stores the time zone as extra infos in metadata in the very beginning. Then all our storage and computing operations only need to care about one standard time zone. User provided time zone only works on the outermost user-facing level, like displaying the result. |
Did a simple survery on how MySQL, PostgreSQL and InfluxDB handles time zones:
Looks like storing timestamp in UTC and rendering to local time zone format according to system/session time zone is a general approach, but there is still a problem: a timestamp from the future may point to different UTC time when daylight saving time changes. Currently this may not be an issue though. |
As per reading/writing parquet files, we can assume all timestamps in parquet files are adjusted to UTC time, thus we don't need to further converting the values. This should be documented in our docs. |
Is this issue fixed? |
When #1341 is merged, we will be able to insert/import timestamps with time zones. The only caveat will be displaying timestamps in local time zone and parsing timestamps without time zone info in the local (system) time zone. |
Uh oh!
There was an error while loading. Please reload this page.
What problem does the new feature solve?
Currently GreptimeDB supports parsing timestamps with time zone, but does not support time zone in data types, nor interpreting UTC timestamp values into user's local time.
arrow-schema's
DataType::Timestamp
has an additional time zone fieldWhat does the feature do?
INSERT INTO
: Parsing timestamp without tz info according to local time zoneCOPY FROM
feat: ignoring time zone info when import from external files #1341Implementation challenges
The underlying representation of GreptimeDB's vectors are arrow's arrays. Unfortunately in arrow-array,
Timestamp[...]Array
's data type does not contain any time zone info, instead their time zones are hard coded toNone
, although timestamp types with different time zones are considered as different types, which will leads to "mismatch schema error" as in this thread.The text was updated successfully, but these errors were encountered: