Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug with expression virtual column indexes on missing columns for expressions that turn null values into not null values #15959

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

clintropolis
Copy link
Member

@clintropolis clintropolis commented Feb 23, 2024

Description

Fixes a mistake in expression virtual column indexes introduced in #15585, which would incorrectly return null from the index supplier, which is a signal to downstream filters that the column is all nulls, even for expressions which translate null values into not null values. This affects filters on stuff like nvl, coalesce, 3 argument lookup, etc. when filtering for the replaced value, for example: ... WHERE NVL(col, 'replaced') = 'replaced'. The workaround I suppose is to just filter for is null without nvl/coalesce/etc.

The added test would incorrectly fail the 2nd case.


This PR has:

  • been self-reviewed.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • 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.

… expressions that turn null values into not null values
@clintropolis clintropolis merged commit 6145c8d into apache:master Feb 23, 2024
82 of 83 checks passed
@clintropolis clintropolis deleted the fix-expr-index-nil branch February 23, 2024 23:07
cryptoe pushed a commit to cryptoe/druid that referenced this pull request Mar 6, 2024
… expressions that turn null values into not null values (apache#15959)
cryptoe added a commit that referenced this pull request Mar 11, 2024
… expressions that turn null values into not null values (#15959) (#16055)

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