erratic-pattern opened a new pull request, #20962:
URL: https://github.com/apache/datafusion/pull/20962

   ## Which issue does this PR close?
   
   Closes https://github.com/apache/datafusion/issues/20937
   
   ## Rationale for this change
   
   `ArrayStaticFilter::contains()` unconditionally unwraps dictionary-encoded 
needles to evaluate against distinct values. This only works when `in_array` 
has the same type as the dictionary's value type. When `in_array` is also 
Dictionary, the unwrap creates a type mismatch in `make_comparator`. This 
became reachable after:
   
   - #20505
   
   which removed dictionary flattening in the InList builder, allowing 
Dictionary arrays to reach `ArrayStaticFilter` via HashJoin dynamic filter 
pushdown with `pushdown_filters` enabled.
   
   ## What changes are included in this PR?
   
   - Guard the dictionary unwrap in `ArrayStaticFilter::contains()` to only 
fire when the dictionary value type matches `in_array`'s type. When both sides 
are Dictionary, fall through to `make_comparator(Dict, Dict)` which arrow-ord 
handles natively.
   - Update the sqllogictest from #20960 to expect success.
   - Add unit tests covering all `try_new_from_array` type combinations 
(primitive specializations, Utf8, Dictionary, Struct).
   
   ## Are these changes tested?
   
   Yes — unit tests and sqllogictest.


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