我有一张名为newdata的表
create external table newdata
(
data string
)
location 'something'
select data from string limit 1
{ "user": { "name": "default", "education": { "schoome": "abc", "college": "def" } }
我需要将此结果显示为
|用户|名字|学校|学院|
| -------- | --------- | ---------- | ----------- |
答案 0 :(得分:0)
select json_extract_scalar (data,'$.user.name') as name
,json_extract_scalar (data,'$.user.education.school') as school
,json_extract_scalar (data,'$.user.education.college') as college
from newdata