fix not(null) with constant null#2144
Conversation
|
cc @alamb @Dandandan @yjshen |
|
Is there any |
|
@Ted-Jiang I'm afraid there is not. |
alamb
left a comment
There was a problem hiding this comment.
Thank you for starting to take this on @WinkerDu ❤️
While the general purpose handling of null literals will likely be a more substantial change, I think this is a good step forward. If we can tighten up the checks a little I think we could merge this and improve things incrementally in follow on PRs.
alamb
left a comment
There was a problem hiding this comment.
I wonder if it would be helpful to add a test in datafusion/core/tests/sql somewhere to show a query like SELECT null, not(null) working?
a437f28 to
5553028
Compare
@alamb OK, will add more tests:
|
|
@alamb PTAL, thank you. |
| } | ||
| ColumnarValue::Scalar(scalar) => { | ||
| if scalar.is_null() { | ||
| return Ok(ColumnarValue::Scalar(ScalarValue::Boolean(None))); |
|
cc @yjshen @xudong963 @liukun4515 @Dandandan PTAL, thank you! |
xudong963
left a comment
There was a problem hiding this comment.
❯ select not null;
+----------------+
| NOT Utf8(NULL) |
+----------------+
| |
+----------------+
1 row in set. Query took 0.003 seconds.
❯ select not(null);
+----------------+
| NOT Utf8(NULL) |
+----------------+
| |
+----------------+
1 row in set. Query took 0.003 seconds.I tested in my local, very good! @WinkerDu
Which issue does this PR close?
Closes #1191.
Rationale for this change
df
notexpression can not takeNULLlikethe correct output should be
NULLWhat changes are included in this PR?
NotExpracceptsNULLinput presented asScalarValue::Utf8(None)Are there any user-facing changes?
NO.