You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "edubraqd (via GitHub)" <gi...@apache.org> on 2026/09/03 23:42:03 UTC

[PR] fix: compare nested list scalars with a dynamic comparator [datafusion]

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

   ## Which issue does this PR close?
   
   - Closes #24937.
   
   ## Rationale for this change
   
   `ScalarValue::partial_cmp` for lists compared the elements with the `lt` / `eq` kernels, which reject nested element types, so `min` / `max` over a list of lists or a list of structs failed with `Internal error: Uncomparable values`.
   
   ## What changes are included in this PR?
   
   `partial_cmp_list` now compares the elements with `arrow::array::make_comparator`, which supports the nested types. `nulls_first: false` keeps the existing Postgres semantics where a NULL element is greater than a non-NULL one (this replaces the hand-written null checks), and the prefix / length rule is unchanged.
   
   ## Are these changes tested?
   
   Yes. `test_nested_list_partial_cmp` covers lists of lists (equal, less, greater, shorter prefix at both levels) and lists of structs; the existing `test_list_partial_cmp` and the rest of the `scalar` tests pass unchanged. `aggregate.slt` gains `min` / `max` over a list of lists and a list of structs.
   
   ## Are there any user-facing changes?
   
   `min` / `max` (and other list scalar comparisons) work for lists of nested values instead of returning 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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] fix: compare nested list scalars with a dynamic comparator [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed pull request #24938: fix: compare nested list scalars with a dynamic comparator
URL: https://github.com/apache/datafusion/pull/24938


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] fix: compare nested list scalars with a dynamic comparator [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #24938:
URL: https://github.com/apache/datafusion/pull/24938#issuecomment-5640802537

   Closing per https://github.com/apache/datafusion/pull/24893#issuecomment-5640786567


-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org