Skip to content

PARQUET-2245: Improve dictionary filter evaluating notEq#1029

Open
zhongyujiang wants to merge 1 commit into
apache:masterfrom
zhongyujiang:optimize_parq_dict_filter_not_eq
Open

PARQUET-2245: Improve dictionary filter evaluating notEq#1029
zhongyujiang wants to merge 1 commit into
apache:masterfrom
zhongyujiang:optimize_parq_dict_filter_not_eq

Conversation

@zhongyujiang

Copy link
Copy Markdown
Contributor

JIRA: PARQUET-2245

This is a minor improvement for evaluating notEq. When evaluating notEq, if the column may contain nulls and the notEq value is non-null, the row-group must not be skipped. In such scenario reading dictionary and compare values is not necessary.

|| !meta.getStatistics().isNumNullsSet()
|| meta.getStatistics().getNumNulls() > 0);
if (dictSet != null && dictSet.size() == 1 && dictSet.contains(value) && !mayContainNull) {
if (dictSet != null && dictSet.size() == 1 && dictSet.contains(value)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that the FilterPredicate does not provide an entry for IS NULL or IS NOT NULL. This confuses me because col IS NOT NULL is not equal to col != NULL.

CMIW, col NOT EQ A has two meanings as below:

  • If A is NULL, it should return an empty list. Because NULL cannot be compared to any value including another NULL.
  • Otherwise, it should return a list of values excluding A and NULL.

cc @huaxingao @gszadovszky @shangxinli

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has had no activity for at least 2 months. If you are still working on this change or plan to move it forward, please leave a comment or push a new commit so we know to keep it open. Otherwise, this PR will be closed automatically in about one month. Thank you for your contribution to Apache Parquet!

@github-actions github-actions Bot added the stale label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants