viirya opened a new pull request, #25555: URL: https://github.com/apache/datafusion/pull/25555
## Which issue does this PR close? N/A ## Rationale for this change `ScalarValue::partial_cmp` only compared Map keys and ignored their values. Maps with identical keys but different values were therefore considered equal. This could produce incorrect ordering when merging ordered aggregate states, such as `first_value`, `last_value`, and `nth_value`, and could incorrectly validate range partition split points. ## What changes are included in this PR? Use Arrow's Map comparator for `ScalarValue::Map` comparisons. This aligns scalar comparison with Arrow sorting and nested comparison semantics, including values, entry order, lengths, and nulls. Add unit tests covering these cases. ## What is the testing strategy for this PR? Added `test_map_partial_cmp` covering: - maps with identical keys and different values - lexicographic `(key, value)` entry ordering - maps of different lengths - null and empty maps ## Are there any user-facing changes? Map scalar comparisons now consider both keys and values and are consistent with Arrow ordering. -- 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]
