Add REMOVE_NULLS function for arrays#18460
Conversation
01e7bed to
44b2ff2
Compare
|
This might cause a lot of issues as we are using equality (=) operator for most array operations. So NULL should not be allowed here like this. I suggest adding a new operator REMOVE_NULLS that does it. |
9053d7c to
8fbce37
Compare
That makes sense! I have updated the PR code and description accordingly. |
614fd74 to
05d0984
Compare
presto-main/src/main/java/com/facebook/presto/operator/scalar/ArrayRemoveNullsFunction.java
Outdated
Show resolved
Hide resolved
05d0984 to
6aedf19
Compare
presto-main/src/main/java/com/facebook/presto/operator/scalar/ArrayRemoveNullsFunction.java
Outdated
Show resolved
Hide resolved
6aedf19 to
12a1c14
Compare
kaikalur
left a comment
There was a problem hiding this comment.
Also, please add documentation for the new function:
Just like for the others.
presto-main/src/main/java/com/facebook/presto/operator/scalar/ArrayRemoveNullsFunction.java
Outdated
Show resolved
Hide resolved
076722b to
842af39
Compare
Yes I have added documentation in array.rst |
|
Please fix the build - checkstyle violations. |
842af39 to
99f6c57
Compare
Oops, done |
Currently, to remove nulls from an array one needs to write
FILTER(arr, x -> x IS NOT NULL).This creates a new REMOVE_NULLS function to strip nulls from an array.
Test plan -
mvn -Dtest="TestArrayOperators" test