Skip to content

Conversation

@shenyu0127
Copy link
Contributor

@shenyu0127 shenyu0127 commented Aug 2, 2023

This is to support "WHERE func(column) IS NULL" and "WHERE func(column) IS NOT NULL".

#11209

@shenyu0127 shenyu0127 force-pushed the expression-filter-operator branch from fe3d7f5 to 8504dc4 Compare August 2, 2023 18:52
@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2023

Codecov Report

Merging #11249 (7576488) into master (6a71cd5) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master   #11249      +/-   ##
==========================================
- Coverage    0.11%    0.11%   -0.01%     
==========================================
  Files        2229     2229              
  Lines      119957   119983      +26     
  Branches    18173    18183      +10     
==========================================
  Hits          137      137              
- Misses     119800   119826      +26     
  Partials       20       20              
Flag Coverage Δ
integration1temurin11 0.00% <0.00%> (ø)
integration1temurin17 0.00% <0.00%> (ø)
integration1temurin20 0.00% <0.00%> (ø)
integration2temurin11 0.00% <0.00%> (ø)
integration2temurin17 0.00% <0.00%> (ø)
integration2temurin20 0.00% <0.00%> (ø)
unittests1temurin11 0.00% <0.00%> (?)
unittests1temurin17 0.00% <0.00%> (ø)
unittests1temurin20 0.00% <0.00%> (ø)
unittests2temurin11 0.11% <0.00%> (-0.01%) ⬇️
unittests2temurin17 0.11% <0.00%> (-0.01%) ⬇️
unittests2temurin20 0.11% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...or/dociditerators/ExpressionScanDocIdIterator.java 0.00% <0.00%> (ø)
...ot/core/operator/docidsets/ExpressionDocIdSet.java 0.00% <ø> (ø)
...core/operator/filter/ExpressionFilterOperator.java 0.00% <0.00%> (ø)
...ava/org/apache/pinot/core/plan/FilterPlanNode.java 0.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@shenyu0127 shenyu0127 marked this pull request as ready for review August 2, 2023 20:09
nullBitmap = _transformFunction.getNullBitmap(projectionBlock);
if (nullBitmap != null) {
for (int i : nullBitmap) {
matchingDocIds.add(_docIdBuffer[i]);
Copy link
Contributor

Choose a reason for hiding this comment

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

(format) Indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

} else {
// TODO(https://github.com/apache/pinot/issues/10882): support NULL for multi-value.
if (_nullHandlingEnabled || _predicateEvaluationResult == PredicateEvaluationResult.NULL) {
throw new UnsupportedOperationException("NULL handling is not supported for multi-value");
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want to throw exception here. Think of a case where user needs null handling for other operators, but has a filter on MV column

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point.

Modified the code to not throw an exception when null handling is enabled, and to return empty matching document IDs when _predicateEvaluationResult == PredicateEvaluationResult.NULL. Also added unit tests for those two scenarios.

@shenyu0127 shenyu0127 requested a review from Jackie-Jiang August 3, 2023 05:52
@Jackie-Jiang Jackie-Jiang merged commit 33fa277 into apache:master Aug 4, 2023
@shenyu0127 shenyu0127 deleted the expression-filter-operator branch August 4, 2023 05:23
s0nskar pushed a commit to s0nskar/pinot that referenced this pull request Aug 10, 2023
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.

3 participants