Chris (deprecated profile)
column_'with"_quotes
(which may not be possible in BQ)
• or maybe I might be ok with another name such as column__with__quotes
• and my row should still have the value of:
How to extract this json "column_'with"_quotes" in BigQuery?
with example_json_data as (
select
"{'column_\'with\"_quotes': 'How to extract this json \"column_\'with\"_quotes\" in BigQuery?'}" as nested_json
)
select
json_extract(
replace(`nested_json`, "column_'with\"_quotes", "column__with__quotes"), "$['column__with__quotes']" -- but i don't want to modify the data value!
--`nested_json`, '$."column_\'with\"_quotes"' -- throws error: Invalid token in JSONPath at: ."column_'with"_quotes"
--`nested_json`, "$['column_\'with\"_quotes']" -- throws error: Invalid token in JSONPath at: ['column_'with"_quotes']
) as column__with__quotes
from example_json_data
charles
user
07/23/2021, 7:35 PMuser
07/23/2021, 7:35 PMuser
07/23/2021, 7:35 PMuser
07/23/2021, 8:04 PMuser
07/23/2021, 8:04 PMuser
07/23/2021, 8:04 PMcharles
user
07/23/2021, 8:05 PMuser
07/23/2021, 8:06 PMuser
07/23/2021, 8:07 PMuser
07/23/2021, 8:07 PMuser
07/23/2021, 8:07 PMuser
07/23/2021, 8:08 PMcharles
user
07/23/2021, 8:16 PMuser
07/23/2021, 8:18 PMuser
07/23/2021, 8:18 PMuser
07/23/2021, 8:19 PMuser
07/23/2021, 9:56 PMuser
07/23/2021, 9:56 PMcharles
user
07/26/2021, 4:19 PM