我在雅典娜有一张这种结构的桌子
CREATE EXTERNAL TABLE `json_test`(
`col0` string ,
`col1` string ,
`col2` string ,
`col3` string ,
`col4` string ,
)
ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
'quoteChar'='\"',
'separatorChar'='\;')
Run Code Online (Sandbox Code Playgroud)
像这样的 Json 字符串存储在“col4”中:
{'email': 'test_email@test_email.com', 'name': 'Andrew', 'surname': 'Test Test'}
Run Code Online (Sandbox Code Playgroud)
我正在尝试进行 json_extract 查询:
SELECT json_extract(col4 , '$.email') as email FROM "default"."json_test"
Run Code Online (Sandbox Code Playgroud)
但查询返回空值。
任何帮助,将不胜感激。