Skip to content

- operator support NULL constants - #2249

Closed
WinkerDu wants to merge 1 commit into
apache:masterfrom
WinkerDu:master-negative-null
Closed

WinkerDu wants to merge 1 commit into
apache:masterfrom
WinkerDu:master-negative-null

Conversation

@WinkerDu

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #1192 .

Rationale for this change

Reproducer:

> select -null;
Internal("(- 'Literal { value: Utf8(NULL) }') can't be evaluated because the expression's type is Utf8, not signed numeric")

The result comes out NULL with this pr

What changes are included in this PR?

  • NegativeExpr accepts NULL input then return ScalarValue::Int32(None) as NULL
  • do is_signed_numeric type check when NegativeExpr evaluates

Are there any user-facing changes?

@WinkerDu

WinkerDu commented Apr 16, 2022 •

Copy link
Copy Markdown
Contributor Author

@alamb @xudong963 @yjshen plz have a review, thank you.

@liukun4515

Copy link
Copy Markdown
Contributor

My opinion for this feature or new dialect #1192 (comment)

@WinkerDu

Copy link
Copy Markdown
Contributor Author

Close this pr since more conservative opinions of introducing -NULL SQL dialect, see #1192

@WinkerDu WinkerDu closed this Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

- (negation) with NULL literals does not work: can't be evaluated because the expression's type is Utf8, not signed

2 participants