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(function): Support Semi-structured access elements #4780

Merged
merged 2 commits into from
Apr 10, 2022

Conversation

b41sh
Copy link
Member

@b41sh b41sh commented Apr 9, 2022

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

Summary

Support accessing elements of VARIANT, ARRAY, OBJECT by key or index
for example

mysql> create table test (v variant);
mysql> insert into test select parse_json('{"a":{"k":"v"},"b":[1,2,3]}');
mysql> select v["a"]["k"], v:a:k, v:a.k, v["b"][0], v:b[0] from test;
+---------------------------+--------------------+--------------------+-------------------------+---------------------+
| get_path(v, '["a"]["k"]') | get_path(v, 'a:k') | get_path(v, 'a.k') | get_path(v, '["b"][0]') | get_path(v, 'b[0]') |
+---------------------------+--------------------+--------------------+-------------------------+---------------------+
| "v"                       | "v"                | "v"                | 1                       | 1                   |
+---------------------------+--------------------+--------------------+-------------------------+---------------------+
1 row in set (0.06 sec)

Changelog

  • New Feature

Related Issues

#3916

@vercel
Copy link

vercel bot commented Apr 9, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/databend/databend/45ALdaUHFEmHeFLuFid2brAafW8q
✅ Preview: https://databend-git-fork-b41sh-variant-access-elements-databend.vercel.app

@mergify
Copy link
Contributor

mergify bot commented Apr 9, 2022

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label Apr 9, 2022
@b41sh b41sh requested a review from sundy-li April 9, 2022 15:19
@BohuTANG
Copy link
Member

@mergify update

@mergify
Copy link
Contributor

mergify bot commented Apr 10, 2022

update

✅ Branch has been successfully updated

Hey, I reacted but my real name is @Mergifyio

@BohuTANG BohuTANG merged commit afc1da1 into databendlabs:main Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-review pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants