Add support for cast between NUMBER and JSON#28868
Merged
Merged
Conversation
9cd8412 to
d1484a2
Compare
Contributor
|
Looks ok to me 👍 |
Member
Author
d1484a2 to
09a7d57
Compare
Member
Author
|
@wendigo why did you add |
Contributor
09a7d57 to
b1a308f
Compare
Member
Author
|
to smooth the review experience, some changes extracted to
only the last commit to be reviewed here. |
b1a308f to
6e9b11a
Compare
Member
Author
|
just rebased
|
6e9b11a to
da0570b
Compare
losipiuk
reviewed
Mar 30, 2026
losipiuk
reviewed
Mar 30, 2026
losipiuk
approved these changes
Mar 30, 2026
dain
reviewed
Mar 30, 2026
Member
|
Syntax is good. It's consistent with what we do for other numeric conversions. |
da0570b to
45ec3ba
Compare
Member
Author
|
( rebased, no other changes (yet) ) |
Implements cast operators to convert between NUMBER and JSON types, following the same pattern as existing DECIMAL-JSON casts. NUMBER to JSON conversion: - Regular numbers are converted to JSON numbers - NaN, +Infinity, -Infinity are converted to JSON strings JSON to NUMBER conversion: - JSON numbers (integer and float) are converted to NUMBER - JSON booleans are converted to 1 (true) or 0 (false) - JSON strings containing numbers or special values (NaN, Infinity) are parsed - JSON null is converted to SQL NULL
45ec3ba to
91baeb8
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements cast operators to convert between NUMBER and JSON types,
following the same pattern as existing DECIMAL-JSON casts.
NUMBER to JSON conversion:
JSON to NUMBER conversion:
release notes