Skip to content

[branch-52] fix: InList Dictionary filter pushdown type mismatch (#20962)#20997

Merged
alamb merged 1 commit intoapache:branch-52from
alamb:alamb/backport_20962_branch52
Mar 18, 2026
Merged

[branch-52] fix: InList Dictionary filter pushdown type mismatch (#20962)#20997
alamb merged 1 commit intoapache:branch-52from
alamb:alamb/backport_20962_branch52

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Mar 17, 2026

Closes apache#20937

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

- apache#20505

which removed dictionary flattening in the InList builder, allowing
Dictionary arrays to reach `ArrayStaticFilter` via HashJoin dynamic
filter pushdown with `pushdown_filters` enabled.

- 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 apache#20960 to expect success.
- Add unit tests covering all `try_new_from_array` type combinations
(primitive specializations, Utf8, Dictionary, Struct).

Yes — unit tests and sqllogictest.
@alamb
Copy link
Contributor Author

alamb commented Mar 18, 2026

Thank you for the approval @xudong963

@alamb alamb merged commit 664099b into apache:branch-52 Mar 18, 2026
32 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants