-
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
Add support for IS NULL and NOT IS NULL in transform functions #8264
Conversation
.../main/java/org/apache/pinot/core/operator/transform/function/IsNotNullTransformFunction.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
Outdated
Show resolved
Hide resolved
pinot-common/src/main/java/org/apache/pinot/common/function/TransformFunctionType.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #8264 +/- ##
============================================
- Coverage 69.72% 64.00% -5.73%
- Complexity 4264 4272 +8
============================================
Files 1639 1600 -39
Lines 85920 84243 -1677
Branches 12922 12737 -185
============================================
- Hits 59906 53918 -5988
- Misses 21842 26431 +4589
+ Partials 4172 3894 -278
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
983a336
to
44744cf
Compare
...src/main/java/org/apache/pinot/core/operator/transform/function/IsNullTransformFunction.java
Outdated
Show resolved
Hide resolved
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.
👍🏻
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.
Suggest also add some tests in NullHandlingIntegrationTest
pinot-common/src/main/java/org/apache/pinot/sql/parsers/CalciteSqlParser.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/pinot/core/operator/transform/function/IsNotNullTransformFunction.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/pinot/core/operator/transform/function/IsNullTransformFunction.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/pinot/core/operator/transform/function/IsNotNullTransformFunction.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/pinot/core/operator/transform/function/IsNotNullTransformFunction.java
Outdated
Show resolved
Hide resolved
.../main/java/org/apache/pinot/core/operator/transform/function/IsNotNullTransformFunction.java
Show resolved
Hide resolved
One more side note - If these functions are used with a table where Null handling is disabled, they assume everything is non-null. So Instead, If you want it to throw exception in this case, I can do that as well. |
This is the correct behavior which aligns with the filter semantic |
This PR addresses the issue #8251 . Currently, Pinot supports
IS NULL
syntax in filter expressions such asWHERE
clause. But it doesn't support as part of SELECT expressions such asCASE WHEN col IS NULL THEN a ELSE b
The PR adds support for such expressions by utilising the
NullValueVectorReader
to get the docIds which are null.The implementation has two requirements/limitations -
nullHandlingEnabled
should be set totrue
since native NULL values are not supported in Pinot and requires a null value bitmap index.Only column names can be provided as the first argument for expressions. The support for functions is still not there.
e.g.
colA IS NULL
is supported butLOWER(colA) IS NULL
is not supported.Currently Pending -