sunchao opened a new pull request, #26067:
URL: https://github.com/apache/datafusion/pull/26067

   ## Which issue does this PR close?
   
   Related to #24937. This fixes the RANGE-window case; general MIN/MAX scalar 
comparisons remain separate.
   
   ## Rationale for this change
   
   A RANGE window ordered by a list containing lists or structs can plan 
successfully and then fail with `Uncomparable values`. For example:
   
   ```sql
   SELECT count(*) OVER (ORDER BY l)
   FROM (VALUES ([[1]]), ([[2]])) t(l);
   ```
   
   CURRENT ROW boundaries only need to find equal ordering keys in the sorted 
input.
   
   ## What changes are included in this PR?
   
   Use Arrow's comparator to find nested CURRENT ROW peer boundaries. Reuse the 
comparator while the ordering arrays are unchanged and release it when buffered 
rows are pruned.
   
   SQL type admission, scalar-key handling, and finite-offset calculations are 
unchanged.
   
   ## What is the testing strategy for this PR?
   
   Update the two existing SQL regressions from expected errors to successful 
counts. Physical-operator tests cover nested lists/structs, nulls, tied 
ordering keys across batches, frame boundaries, and completed-peer emission 
before EOF in sorted mode. A small state test covers comparator reuse and 
pruning.
   
   Local validation on this patch:
   
   - Full extended workspace suite: 12,421 Rust tests passed, eight ignored, 
and all 527 SQL-logic files completed.
   - All-target/all-feature Clippy with warnings denied passed.
   - Formatting, license/typo checks, generated documentation checks, local 
link checks, and the security audit passed. API and website documentation 
builds also passed with warnings treated as errors.
   - Full lint could not complete locally: the package mirror does not offer 
`cargo 0.100.0`, pinned by the existing `dev/depcheck` tool. This blocks the 
circular-dependency check and that tool's metadata inspection by cargo-machete; 
cargo-machete otherwise reported no unused dependencies. This patch changes no 
dependency manifests or lockfiles.
   - The physical regression and both SQL regressions fail on the unpatched 
target base with the original comparison error.
   - All six existing aggregate-window benchmark smoke cases pass on both base 
and candidate. No throughput measurements are claimed.
   
   ## Are there any user-facing changes?
   
   Already-admitted SQL RANGE windows over nested list keys return results 
instead of an internal comparison error. The same boundary fix applies to 
windows constructed through the physical API. No new public API or SQL-admitted 
types are introduced.
   


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