-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: jsonb || operator #12502
feat: jsonb || operator #12502
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution!
src/common/src/types/jsonb.rs
Outdated
@@ -210,6 +210,12 @@ impl From<Value> for JsonbVal { | |||
} | |||
} | |||
|
|||
impl<'a> From<&'a Value> for JsonbRef<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an anti-pattern to
- take
serde_json::Value
out ofJsonbRef
- process
serde_json::Value
- put processed
serde_json::Value
back into aJsonbVal
because we may switch away from serde_json
#11805. This pattern is a leak of implementation detail.
However, avoiding this means moving the concat implementation to common
crate, which could hurt build time #12485
cc @wangrunji0408 @xxchan It's up to you how we proceed with the code organization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the complexity is not very high, I feel comfortable to proceed in whatever way. 🤣
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
fix #12180 This PR adds the jsonb concatenation operator. The concatenation takes into consideration 4 situations ie
The limitation of this PR is that it only concatenates when both data type are jsonb. If either data type is not jsonb, a binding error would still be present.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.
RELEASE NOTE:
Added operator that allow jsonb data types to be concatenated. Documentation PR is here.