LuciferYang opened a new pull request, #13202:
URL: https://github.com/apache/gluten/pull/13202

   ## What changes are proposed in this pull request?
   
   Two RANGE window frame shapes failed the query instead of falling back.
   
   On Velox and Bolt, a date order key with an interval bound, e.g. `range 
between interval '1' month preceding and current row`, failed planning with 
`UnresolvedException`. The range frame boundary pre-computation turns a date 
key into an integer and adds the bound to it, which only works for an integer 
bound. It now pre-computes only when every literal bound is integral, and 
`supportWindowExec` rejects a literal RANGE bound that is not integral, so the 
window falls back. Both parts are needed: without the first the planning error 
stays, and without the second the window is offloaded with a constant interval 
offset that Velox rejects at runtime.
   
   `WindowFunctionNode` converted literal frame bounds with `Long.valueOf`. A 
bound that does not parse as a long, such as the `-10.00` a decimal key turns 
`10 PRECEDING` into, threw `NumberFormatException`, which validation does not 
turn into a fallback. This matters on ClickHouse, whose `supportWindowExec` 
does not check frame bounds. It now throws `GlutenNotSupportException`.
   
   Date keys with integer bounds are still pre-computed and offloaded as before.
   
   ## How was this patch tested?
   
   `VeloxWindowExpressionSuite` adds "range frame with an interval bound on a 
date key falls back": year-month interval bounds on a date key, and an interval 
bound next to an integer bound in the same window operator, each compared 
against vanilla Spark and checked to run as `WindowExec`. 
`WindowFunctionNodeTest` checks that decimal and double bounds throw 
`GlutenNotSupportException` and that an integer bound still converts. The 
ClickHouse path is covered only by that unit test.
   
   ## Was this patch authored or co-authored using generative AI tooling?
   
   Yes. Generated-by: Claude Opus.
   


-- 
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]

Reply via email to