apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.37k stars 1.2k forks source link

`datafusion.execution.time_zone` is not used for basic time zone inference #13212

Open adriangb opened 3 weeks ago

adriangb commented 3 weeks ago

Describe the bug

I would expect that setting SET datafusion.execution.time_zone = '+08:00' would lead to SELECT '2024-11-01T00:00:00.0+00:00'::timestamptz - '2024-11-01T00:00:00.0'::timestamp to give 8 hours (that is, the same as SELECT '2024-11-01T00:00:00.0+00:00'::timestamptz - '2024-11-01T00:00:00.0+08:00'::timestamptz). Some things do work e.g. SELECT '2024-11-01T00:00:00.0'::timestamptz does give 2024-11-01T00:00:00+08:00.

To Reproduce

No response

Expected behavior

No response

Additional context

No response

adriangb commented 3 weeks ago

cc @alamb I think you've written some tests for datafusion.execution.time_zone based on blames, I couldn't track down who originally implemented it

alamb commented 3 weeks ago

Hi @adriangb -- I am not sure who originally implemented it either. I think @Omega359 was thinking about how to specify / pass the default timezones to functions recently too

Omega359 commented 3 weeks ago

Yes, it's been on my radar for a while now. There are a number of issues around tz's some of which are generic tz issues, others are issues where using the default tz in config might be useful. A small but not complete list

jonathanc-n commented 3 weeks ago

Someone can probably take a look at #13130, it seems to be done it just has a doc check error

alamb commented 5 days ago

This may now be feasible after