You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
- (negation) with NULL literals does not work: can't be evaluated because the expression's type is Utf8, not signed #1192
>select-null;
Internal("(- 'Literal { value: Utf8(NULL) }') can't be evaluated because the expression's type is Utf8, not signed numeric")
The correct output is null
I think the solution will likely be to teach Expr::Negative about type coercion (as is done in BinaryExpr and function calls) once coercion knows about the null type (and that it can be cast to any other type). See #1184 for more details
changed the title [-]`-` (negation) with NULL literals does not work[/-][+]`-` (negation) with NULL literals does not work: can't be evaluated because the expression's type is Utf8, not signed [/+]on Oct 28, 2021
I tested select -null; in mysql and postgres: mysql returned null but
postgres=# select -null;
ERROR: operator is not unique: - unknown
LINE1: select-null;
^
HINT: Could not choose a best candidate operator. You might need to add explicit type casts.
I tested select -null; in mysql and postgres: mysql returned null but
postgres=# select -null;
ERROR: operator is not unique: - unknown
LINE1: select-null;
^
HINT: Could not choose a best candidate operator. You might need to add explicit type casts.
Activity
[-]`-` (negation) with NULL literals does not work[/-][+]`-` (negation) with NULL literals does not work: can't be evaluated because the expression's type is Utf8, not signed [/+]WinkerDu commentedon Apr 8, 2022
@alamb plz assign to me, thank you.
xudong963 commentedon Apr 9, 2022
I tested
select -null;in mysql and postgres: mysql returned null butDo you need this syntax in iox? @alamb
WinkerDu commentedon Apr 9, 2022
@xudong963 Thanks for the test! I agree we can discuss more on it.
alamb commentedon Apr 10, 2022
We do not need this syntax in IOx (and if we do I can always add it at that time)
WinkerDu commentedon Apr 16, 2022
@alamb @xudong963 Maybe we can introduce this syntax, and keep the contract that operators comes out result
NULLwhen acceptsNULL.liukun4515 commentedon Apr 17, 2022
It's better to make it consistent with PG in SQL dialect.
WinkerDu commentedon Apr 17, 2022
I feel free to close the pr #2249 since more conservative opinions of introducing
-NULLSQL dialectThank you @liukun4515 @xudong963
liukun4515 commentedon May 26, 2022
I think this issue can be closed.
@alamb @andygrove
alamb commentedon May 26, 2022
🤔 I just tried the query again, and it now gives a different error:
I think we are getting closer...
alamb commentedon May 26, 2022
I bet this is a fairly straightforward matter of adding a case in the evaluation kernels
drrtuy commentedon Oct 8, 2022
It is indeed an additional condition in expressions/negative.rs. Here is the PR #3771.
feat: Move shuffle block decompression and decoding to native code an…
Fix Python UDAF Accumulator Interface example to Properly Handle Stat…