-
Notifications
You must be signed in to change notification settings - Fork 594
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(common): introduce JsonbArrayBuilder and JsonbArray #7986
Conversation
Codecov Report
@@ Coverage Diff @@
## main #7986 +/- ##
==========================================
- Coverage 71.41% 71.38% -0.03%
==========================================
Files 1119 1119
Lines 180622 180760 +138
==========================================
+ Hits 128984 129033 +49
- Misses 51638 51727 +89
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM
@@ -117,6 +117,12 @@ impl RandValue for bool { | |||
} | |||
} | |||
|
|||
impl RandValue for JsonbVal { | |||
fn rand_value<R: rand::Rng>(_rand: &mut R) -> Self { | |||
JsonbVal::dummy() |
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.
Is this by design? What about adding a TODO
here?
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.
List / Struct do not have this either. Opened #8001 for it.
Part of the `jsonb` type support: * #7977 * #7986 * Introduce `DataType::Jsonb` **(this PR)** * Add more expressions #7714 In this PR: * Add `DataType::Jsonb`. * Support constructing it from string and displaying it as string. * Add e2e tests for `insert` and `select`. Also tested for the following but not added in CI: * prepared statement with BINARY format * kafka+json source with a `jsonb` field Approved-By: BugenZhao
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Part of the
jsonb
type support (preview all on this branch):ArrayBuilder
andArray
(this PR)DataType::Jsonb
In this PR:
JsonbArray
is simply aVec
or roots of json trees. This is easier to operate but do have space for optimization.bytea
variable length array, with each element storing its value encoding. In case we switch to a newer protobuf layout, a new ArrayType enum value can be introduced without affecting parts other thanto_protobuf
andfrom_protobuf
.VarSizedValueReader
from returningRefItem
into accepting&mut ArrayBuilder
. This is to useJsonbArrayBuilder::append_move
on the deserializedOwnedItem
. It is impossible to get aJsonbArray::RefItem
from&[u8]
.arrow
/HashKeySerDe
/RandValue
.Checklist
- [ ] I have added necessary unit tests and integration tests(tested together in later part)./risedev check
(or alias,./risedev c
)Documentation