wiedld opened a new pull request, #7614: URL: https://github.com/apache/arrow-datafusion/pull/7614
## Which issue does this PR close? Closes https://github.com/apache/arrow-datafusion/issues/5975 Closes https://github.com/apache/arrow-datafusion/issues/5976 ## Rationale for this change Need builtin scalar functions (accepting timeszones) to properly handle the tz. ## What changes are included in this PR? Systematically went through the logical plan, type coercion, then simplification steps — for the builtin scalar functions accepting timestamptz. Added a series of test cases, including 16 failing test cases (using Postgres as a control). Fixes occurred in three phases: 1. Fix the type coercion, to no longer coerce to `Timestamp(Nanosecond, None)`. 2. Fix the simplification step where date_trunc is applied. It was using NaiveDateTime which does not have a concept of timezone. 3. Generalize the signatures() and timestamp type coercion, such that each timezone does not need to be listed. ## Are these changes tested? Tested for these scenarios: | fun | server is utc? | src of tz | |--------------|----------------|-----------| | date_trunc | no | server | | | | timestamp | | | yes | server | | | | timestamp | |--------------|----------------|-----------| | date_bin | no | server | | | | timestamp | | | yes | server | | | | timestamp | |--------------|----------------|-----------| | date_part | no | server | | | | timestamp | | | yes | server | | | | timestamp | Also added a bunch more date_trunc tests, since we had another fix there. ## Are there any user-facing changes? No APIs are changing, but we are now more accurately fulfilling the expected contract. -- 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]
