Skip to content
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): support insert and select for jsonb type #7994

Merged
merged 4 commits into from
Feb 17, 2023
Merged

Conversation

xiangjinwu
Copy link
Contributor

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:

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

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added an item to track fuzzing tests (Sqlsmith: Sql feature generation #7934).
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

Types of user-facing changes

  • SQL commands, functions, and operators

Release note

Adds basic support of the jsonb data type. It can be casted from and into a string, inserted and selected.

Note that this type should NOT be used for group by / order by / primary key / etc. We will forbid such usage or may change their ordering behavior in the future. #7981

Operators and functions (#7714) to use the jsonb value are upcoming.

Base automatically changed from jsonb-r3-p1-array to main February 17, 2023 07:03
@xiangjinwu xiangjinwu marked this pull request as ready for review February 17, 2023 07:09
@codecov
Copy link

codecov bot commented Feb 17, 2023

Codecov Report

Merging #7994 (d74d91b) into main (298a950) will decrease coverage by 0.01%.
The diff coverage is 8.51%.

@@            Coverage Diff             @@
##             main    #7994      +/-   ##
==========================================
- Coverage   71.37%   71.37%   -0.01%     
==========================================
  Files        1119     1119              
  Lines      180760   180807      +47     
==========================================
+ Hits       129024   129048      +24     
- Misses      51736    51759      +23     
Flag Coverage Δ
rust 71.37% <8.51%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/common/src/array/jsonb_array.rs 23.78% <0.00%> (+3.89%) ⬆️
src/common/src/hash/dispatcher.rs 85.43% <0.00%> (-0.84%) ⬇️
src/common/src/types/postgres_type.rs 16.66% <0.00%> (-0.99%) ⬇️
src/common/src/util/value_encoding/error.rs 0.00% <ø> (ø)
src/common/src/util/value_encoding/mod.rs 85.29% <0.00%> (-1.02%) ⬇️
src/connector/src/parser/common.rs 61.66% <0.00%> (-2.13%) ⬇️
src/expr/src/expr/expr_binary_nullable.rs 71.75% <0.00%> (-0.21%) ⬇️
src/expr/src/vector_op/cast.rs 90.67% <0.00%> (-0.15%) ⬇️
src/frontend/src/expr/literal.rs 91.58% <ø> (ø)
...rontend/src/optimizer/rule/index_selection_rule.rs 95.54% <0.00%> (-0.15%) ⬇️
... and 10 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify mergify bot merged commit 32c55d0 into main Feb 17, 2023
@mergify mergify bot deleted the jsonb-r3-p2-type branch February 17, 2023 08:23
@xiangjinwu xiangjinwu added the user-facing-changes Contains changes that are visible to users label Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature user-facing-changes Contains changes that are visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants