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(query): support json_object_insert function #16636

Merged
merged 8 commits into from
Oct 18, 2024

Conversation

b41sh
Copy link
Member

@b41sh b41sh commented Oct 18, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

support json_object_insert function
for example:

MySQL [(none)]> SELECT json_object_insert('{"a":1,"b":2}'::variant, 'c', 3);
+------------------------------------------------------+
| json_object_insert('{"a":1,"b":2}'::VARIANT, 'c', 3) |
+------------------------------------------------------+
| {"a":1,"b":2,"c":3}                                  |
+------------------------------------------------------+
1 row in set (0.043 sec)

MySQL [(none)]> SELECT json_object_insert('{"city":"San Mateo","state":"CA"}'::variant, 'city', 'San Jose', true);
+--------------------------------------------------------------------------------------------+
| json_object_insert('{"city":"San Mateo","state":"CA"}'::VARIANT, 'city', 'San Jose', TRUE) |
+--------------------------------------------------------------------------------------------+
| {"city":"San Jose","state":"CA"}                                                           |
+--------------------------------------------------------------------------------------------+
1 row in set (0.040 sec)
  • fixes: #[Link the issue here]

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@b41sh b41sh requested a review from sundy-li October 18, 2024 04:39
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Oct 18, 2024
Cargo.toml Outdated Show resolved Hide resolved
@b41sh b41sh enabled auto-merge October 18, 2024 06:07
@b41sh b41sh added this pull request to the merge queue Oct 18, 2024
Merged via the queue into databendlabs:main with commit ea58350 Oct 18, 2024
72 checks passed
@b41sh b41sh deleted the feat-json-object-insert branch October 18, 2024 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants