You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2026/03/12 04:11:43 UTC
Re: [PR] [SPARK-54698][SQL] Support hashing for all data types for array set like operations [spark]
LuciferYang commented on PR #53468:
URL: https://github.com/apache/spark/pull/53468#issuecomment-4043800844
Thanks for the pr! The approach of using `GenericComparableWrapper` to unify the two code paths is clean and effective.
One suggestion: since this pr changes the underlying lookup mechanism for complex types (from O(n^2) linear comparison to hash-based), it would be great to add some test coverage for the newly affected paths.
Specifically, the following scenarios maybe not covered by existing tests:
1. StructType elements — None of the four operations have tests with struct-typed array elements.
2. Nested complex types — e.g., ArrayType(StructType(...)) as the element type.
3. Nested NaN — e.g., array_distinct([struct(NaN), struct(NaN)]). Current NaN tests only cover top-level Float/Double NaN.
4. Nested -0.0 vs 0.0 — e.g., array_distinct([struct(-0.0), struct(0.0)]). The existing -0.0 vs 0.0 tests are top-level only and only cover array_union/array_distinct (in array.sql), not
array_intersect/array_except.
Also, it would be helpful to add a benchmark comparing the before/after performance for complex types (e.g., arrays of structs or binary elements at various sizes), so reviewers can see the concrete improvement
from the O(n^2) to O(n) change.
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org