edubraqd opened a new pull request, #24916: URL: https://github.com/apache/datafusion/pull/24916
## Which issue does this PR close? - Closes #24915. ## Rationale for this change `OVER (ORDER BY x)` defaults to a free range frame with no offsets, which only needs the ORDER BY values to be comparable. `coerce_window_frame` nevertheless required an arithmetic target type for the ORDER BY column first, so `row_number() OVER (ORDER BY x)` on a Duration, Interval, Struct or Map column failed with an internal error asking the user to file a bug. ## What changes are included in this PR? Only require the arithmetic target type for frames with a finite offset: a free range frame over a type without arithmetic is returned unchanged (there are no offsets to coerce), while frames over supported types are coerced exactly as before, so plans do not change. The failure for a finite offset over such a type is now a planning error in the same words the existing offset check uses. ## Are these changes tested? Yes. `window.slt` gains cases for `row_number`/`rank`/`count` ordered by Duration, Interval and Struct values (default and explicit free range frame), checks that a finite offset over a struct is still rejected, and the existing struct case that pinned the internal-error text now expects a result. ## Are there any user-facing changes? Window functions ordered by Duration, Interval, Struct or Map columns work with the default frame. A finite RANGE offset over such a column reports `RANGE with offset PRECEDING/FOLLOWING is not supported for ORDER BY type ...` instead of an internal error. -- 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]
