We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Considering having a table named test in a dataset named data_history with a JSON field named data.
SELECT JSON_QUERY(data, '$.data.test') FROM data_history.test WHERE TIMESTAMP_TRUNC(date, DAY) = TIMESTAMP("2024-03-14") LIMIT 1
Return the entire JSON value
The result should be the extracted field test
{data:"{"test":"hello"}"}
No response
The text was updated successfully, but these errors were encountered:
To reproduce the issue you can also use the bq client with the sample data as shown in the README
bq
❯ bq --api http://0.0.0.0:9050 query --project_id=test 'SELECT structarr[OFFSET(0)].value.age FROM dataset1.table_a' +-----------------------------------------+ | age | +-----------------------------------------+ | {"age": 10, "nested": {"key": "value"}} | | {"age": 15, "nested": {"key": "value"}} | +-----------------------------------------+ ❮ bq --api http://0.0.0.0:9050 query --project_id=test 'SELECT structarr[OFFSET(0)].value.nested FROM dataset1.table_a' +-----------------------------------------+ | nested | +-----------------------------------------+ | {"age": 10, "nested": {"key": "value"}} | | {"age": 15, "nested": {"key": "value"}} | +-----------------------------------------+ ❯ bq --api http://0.0.0.0:9050 query --project_id=test 'SELECT structarr[OFFSET(0)].value.nested.key FROM dataset1.table_a' +------+ | key | +------+ | NULL | | NULL | +------+
nested is an extra JSON key I added into server/testdata/data.yaml
nested
server/testdata/data.yaml
Sorry, something went wrong.
No branches or pull requests
What happened?
Considering having a table named test in a dataset named data_history with a JSON field named data.
Return the entire JSON value
What did you expect to happen?
The result should be the extracted field test
How can we reproduce it (as minimally and precisely as possible)?
{data:"{"test":"hello"}"}
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: