edubraqd commented on PR #24916:
URL: https://github.com/apache/datafusion/pull/24916#issuecomment-5656372908

   Added the cases to `window.slt` in 727c003, and a plainer explanation, since 
my earlier note went too far into the internals.
   
   **What happens today, on `main` and on this branch:** `ORDER BY` a list of 
primitives such as `List<Int64>` works in a window frame. `ORDER BY` a list 
whose elements are themselves nested (`List<Struct>`, `List<List>`) is accepted 
at planning time but fails at execution on the very first row, with `Internal 
error: Uncomparable values: List([{c0: 1}]), List([{c0: 1}])`. The RANGE frame 
has to decide whether two rows are peers, and the scalar comparison it uses for 
that cannot look inside nested list elements. Sorting the same column works, 
because the sort uses a different, array-level comparator. So sort and peer 
check disagree on which list types they can handle.
   
   **What this PR changes and what it does not:** it makes `Duration` and 
`Interval` valid ORDER BY types for free RANGE frames, and checks every ORDER 
BY key instead of only the first. It does not touch which list types are 
accepted; that list is the same as on `main`, and `ORDER BY list_of_struct` 
fails the same way with or without this PR. The new `.slt` block pins the 
current behaviour (one passing case, three failing ones, including "duration 
key followed by a nested list key" that @kumarUjjawal asked about), so the 
follow-up that fixes the scalar comparison can flip those expectations instead 
of adding coverage from scratch.
   
   I kept the comparator fix out of here on purpose: it would make `ORDER BY 
List<Struct>` start working in the same PR that changes window frame type 
checking, which is harder to review and to bisect if either part regresses. 
#24938 had that fix; I will bring it back as the next PR once this one lands, 
if that works for you.


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