-
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 JsonbVal as Scalar and JsonbRef as ScalarRef #7977
Conversation
Codecov Report
@@ Coverage Diff @@
## main #7977 +/- ##
==========================================
- Coverage 71.45% 71.42% -0.04%
==========================================
Files 1118 1119 +1
Lines 180316 180399 +83
==========================================
- Hits 128849 128845 -4
- Misses 51467 51554 +87
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
Part of the `jsonb` type support (preview all on [this branch](https://github.com/risingwavelabs/risingwave/compare/XJ-jsonb-WIP-2?expand=1)): * #7977 * Introduce `ArrayBuilder` and `Array` **(this PR)** * Introduce `DataType::Jsonb` * Add more expressions #7714 In this PR: * The in-memory layout of `JsonbArray` is simply a `Vec` or roots of json trees. This is easier to operate but do have space for optimization. * The protobuf layout is the same as `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 than `to_protobuf` and `from_protobuf`. * Refactored `VarSizedValueReader` from returning `RefItem` into accepting `&mut ArrayBuilder`. This is to use `JsonbArrayBuilder::append_move` on the deserialized `OwnedItem`. It is impossible to get a `JsonbArray::RefItem` from `&[u8]`. * Blanket implementation for `arrow` / `HashKeySerDe` / `RandValue`. Approved-By: BugenZhao
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):Scalar
andScalarRef
(this PR)ArrayBuilder
andArray
DataType::Jsonb
serde_json
is chosen instead ofsimd_json
for the following reasons:postgres_types
).BorrowedValue
, it is notCopy
and not suitable forJsonbRef
.simd_json
usesHashMap
butserde_json
defaults toBTreeMap
, which has a deterministic ordering and string representation.Checklist
- [ ] I have added necessary unit tests and integration tests(tested together in later part)./risedev check
(or alias,./risedev c
)Documentation