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

Expose extract_key_value_pairs function #522

Closed
jovezhong opened this issue Jan 24, 2024 · 3 comments · Fixed by #525
Closed

Expose extract_key_value_pairs function #522

jovezhong opened this issue Jan 24, 2024 · 3 comments · Fixed by #525
Assignees
Labels

Comments

@jovezhong
Copy link
Contributor

ClickHouse supports SELECT extractKeyValuePairs('name:neymar, age:31 team:psg,nationality:brazil') as kv https://clickhouse.com/docs/en/sql-reference/functions/tuple-map-functions#extractkeyvaluepairs

This is mentioned in our of our community user. Current this is not available in Proton

Unknown function extract_key_value_pairs. (UNKNOWN_FUNCTION) (version 1.3.31).

@yokofly
Copy link
Collaborator

yokofly commented Jan 25, 2024

this function is not suitable for JSON, json_extract_keys_and_values_raw shall be more specific.

@jovezhong
Copy link
Contributor Author

Hi @yokofly

select json_extract_keys_and_values_raw('{"a":1,"b":2}') works and return an array.
However, the user expects to get a map, to easily access key/value pairs.

If we run extract_key_value_pairs('"a":1,"b":2') this can return a map with a and b as key

@yokofly yokofly self-assigned this Jan 25, 2024
@yokofly yokofly linked a pull request Jan 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants