-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Change default time_zone to None (was "+00:00")
#18359
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
Conversation
…s a side effect.
time_zone to None (was "+00:00")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @Omega359 👍
| | datafusion.execution.collect_statistics | true | Should DataFusion collect statistics when first creating a table. Has no effect after the table is created. Applies to the default `ListingTableProvider` in DataFusion. Defaults to true. | | ||
| | datafusion.execution.target_partitions | 0 | Number of partitions for query execution. Increasing partitions can increase concurrency. Defaults to the number of CPU cores on the system | | ||
| | datafusion.execution.time_zone | +00:00 | The default time zone Some functions, e.g. `EXTRACT(HOUR from SOME_TIME)`, shift the underlying datetime according to this time zone, and then extract the hour | | ||
| | datafusion.execution.time_zone | NULL | The default time zone Some functions, e.g. `now` return timestamps in this time zone | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | datafusion.execution.time_zone | NULL | The default time zone Some functions, e.g. `now` return timestamps in this time zone | | |
| | datafusion.execution.time_zone | NULL | The default time zone. Some functions, e.g. `now` return timestamps in this time zone. If set to NULL, no time zone is applied. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently that isn't supported:
1. statement failed: DataFusion error: Error during planning: Unsupported value Null
[SQL] SET TIMEZONE = NULL
at /opt/dev/datafusion/datafusion/sqllogictest/test_files/set_variable.slt:176
An empty string works though the returned value is (empty) not null.
I'll take a look at what it'll take to support null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Weijun-H Supporting un-setting a config option will be more than just a small change and I think that should be done in a separate PR. Right now it will cause a plan_err to be returned.
Currently the SetVariable struct requires a string, changing that to an option will require threading that change throughout the codebase + additional testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed as #18384
|
I merged up to resolve a conflict |
|
I'll merge up to fix the conflict tonight or tomorrow. |
…e_zone # Conflicts: # datafusion/functions/src/datetime/now.rs
|
Thank you @Omega359 |
Which issue does this PR close?
ExecutionOptions::time_zonetoOption#18081Rationale for this change
Default timezone was previously zulu however with the recent change to support default tz in now(), current_date(), etc which used to have no default tz the choice was made to unset the system wide timezone.
What changes are included in this PR?
Code, tests, upgrading doc.
Are these changes tested?
Yes, with existing tests.
Are there any user-facing changes?
Yes. Any query that used to use the default timezone would return a timestamp with a timezone of 'Z' will now return a timestamp without a timezone. This can be changed back to the previous behaviour with the sql