Skip to content

use NullFilter for SQL rewrite of MV_CONTAINS and MV_OVERLAP for null array elements#15855

Merged
abhishekagarwal87 merged 2 commits intoapache:masterfrom
clintropolis:fix-mv_contains-planner-rewrite
Feb 7, 2024
Merged

use NullFilter for SQL rewrite of MV_CONTAINS and MV_OVERLAP for null array elements#15855
abhishekagarwal87 merged 2 commits intoapache:masterfrom
clintropolis:fix-mv_contains-planner-rewrite

Conversation

@clintropolis
Copy link
Copy Markdown
Member

Description

Fixes an oversight after #14542 that happens in the SQL planner rewrite of MV_CONTAINS and MV_OVERLAP when faced with array elements that are NULL, where we were incorrectly using EqualityFilter instead of NullFilter for null elements (EqualityFilter does not accept null elements).

Without the changes of this PR, the added tests would fail with errors like:

org.apache.druid.error.DruidException: Invalid equality filter on column [dim3], matchValue cannot be null

This PR has:

  • been self-reviewed.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • been tested in a test Druid cluster.

@abhishekagarwal87 abhishekagarwal87 added this to the 29.0.0 milestone Feb 7, 2024
@abhishekagarwal87 abhishekagarwal87 merged commit 23d4fad into apache:master Feb 7, 2024
@clintropolis clintropolis deleted the fix-mv_contains-planner-rewrite branch February 7, 2024 21:25
LakshSingla pushed a commit to LakshSingla/druid that referenced this pull request Feb 8, 2024
… array elements (apache#15855)

Fixes an oversight after apache#14542 that happens in the SQL planner rewrite of MV_CONTAINS and MV_OVERLAP when faced with array elements that are NULL, where we were incorrectly using EqualityFilter instead of NullFilter for null elements (EqualityFilter does not accept null elements).
abhishekagarwal87 pushed a commit that referenced this pull request Feb 8, 2024
… array elements (#15855) (#15865)

Fixes an oversight after #14542 that happens in the SQL planner rewrite of MV_CONTAINS and MV_OVERLAP when faced with array elements that are NULL, where we were incorrectly using EqualityFilter instead of NullFilter for null elements (EqualityFilter does not accept null elements).

Co-authored-by: Clint Wylie <cwylie@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants