nrc opened a new pull request, #12514: URL: https://github.com/apache/datafusion/pull/12514
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> Closes #6327. ## What changes are included in this PR? Support `extract`/`date_part` by passing through requests to Arrow (where functionality was added in https://github.com/apache/arrow-rs/pull/6071 and https://github.com/apache/arrow-rs/pull/6246). There were also two changes required to the `seconds` helper function: * If the number of nanoseconds overflows a 32 bit integer, (e.g., a DayTime interval of 5 seconds), then querying the nanoseconds returns null. However, it is reasonable to return a number of seconds in this case. However, if there is a non-round number of seconds, this will give an inaccurate answer, e.g., 5.1 seconds will get returned as 5, but I'm not sure how to solve this - returning null for round numbers of seconds seems bad. We could fall back to milliseconds, but that complicates the code, is still imperfect, and has less predictable results. I also had a question about *how* I did this (REVIEW comment in the code). * The number of seconds was previously counted twice in cases where seconds are reflected in the number of nanoseconds. A change which would fix both these issues (and I assume is an invariant which previously held) would be to not include whole seconds when returning nanoseconds. However, I think that breaks compat with Postgres. ## Are these changes tested? Yes, sqllogictests. The tests are not exhaustive because these features are properly tested in Arrow. ## Are there any user-facing changes? Users can use `extract` or `date_part` with intervals and durations. -- 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]
