-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Feature] Support IsDistinctFrom and IsNotDistinctFrom #9312
Conversation
3b1e21a
to
cffbec4
Compare
...ava/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunctionTest.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #9312 +/- ##
=============================================
- Coverage 63.40% 24.84% -38.57%
+ Complexity 4762 53 -4709
=============================================
Files 1832 1876 +44
Lines 98146 100105 +1959
Branches 15020 15251 +231
=============================================
- Hits 62231 24871 -37360
- Misses 31321 72701 +41380
+ Partials 4594 2533 -2061
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
da884fe
to
1213bf8
Compare
.../java/org/apache/pinot/core/operator/transform/function/BinaryOperatorTransformFunction.java
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...tion-tests/src/test/java/org/apache/pinot/integration/tests/NullHandlingIntegrationTest.java
Show resolved
Hide resolved
e4589f6
to
37724d7
Compare
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
eb5275d
to
5237004
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise
...in/java/org/apache/pinot/core/operator/transform/function/DistinctFromTransformFunction.java
Outdated
Show resolved
Hide resolved
/** | ||
* @param distinctType is set to true for IsDistinctFrom, otherwise it is for IsNotDistinctFrom. | ||
*/ | ||
protected DistinctFromTransformFunction(boolean distinctType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protected DistinctFromTransformFunction(boolean distinctType) { | |
protected DistinctFromTransformFunction(boolean distinct) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
leftNull.forEach((IntConsumer) i -> _results[i] = _distinctType); | ||
return _results; | ||
} | ||
RoaringBitmap xorNull = RoaringBitmap.xor(leftNull, rightNull); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be faster if we iterate in the following way:
- Iterate over left null and set _distinctResult
- Iterate over right null and set _distinctResult
- Iterate over left AND right null and set _notDistinctResult
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to iterate through xor and and bitset
0214c8e
to
74fd9f3
Compare
The operators IsDistinctFrom and IsNotDistinctFrom only supports column names as argument for now.
When null option is disabled, the row is considered as not null by default.
Expected value:
Null is IsDistinctFrom ValueA: True
Null is IsDistinctFrom Null: False
ValueA is IsDistinctFrom ValueB: NotEquals(ValueA, ValueB)
Null is IsNotDistinctFrom ValueA: False
Null is IsNotDistinctFrom Null: True
ValueA is IsNotDistinctFrom ValueB: Equals(ValueA, ValueB)
Example Usage:
ColumnA IsDistinctFrom ColumnB
ColumnA IsNotDistinctFrom ColumnB