kosiew commented on PR #18017:
URL: https://github.com/apache/datafusion/pull/18017#issuecomment-3400913828
Re-registering now() inside set_config_option covers interactive SET
commands, but sessions that are constructed differently eg with a
pre-configured SessionConfig (e.g. via builder APIs or server defaults) still
get the default NowFunc::new() that ignores the configured timezone.
eg.
```
❯ DATAFUSION_EXECUTION_TIME_ZONE='+05:45' cargo run --bin datafusion-cli --
-c "SELECT arrow_typeof(now());"
DataFusion CLI v50.1.0
+------------------------------------+
| arrow_typeof(now()) |
+------------------------------------+
| Timestamp(Nanosecond, Some("+00")) |
+------------------------------------+
1 row(s) fetched.
Elapsed 0.092 seconds.
```
```
❯ cargo run --bin datafusion-cli -- -c "SET datafusion.execution.time_zone =
'+05:45'; SELECT arrow_typeof(now());"
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.48s
Running `target/debug/datafusion-cli -c 'SET
datafusion.execution.time_zone = '\''+05:45'\''; SELECT arrow_typeof(now());'`
DataFusion CLI v50.1.0
0 row(s) fetched.
Elapsed 0.034 seconds.
+---------------------------------------+
| arrow_typeof(now()) |
+---------------------------------------+
| Timestamp(Nanosecond, Some("+05:45")) |
+---------------------------------------+
1 row(s) fetched.
Elapsed 0.040 seconds.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]