0

我有一个名为 newdata 的表

create external table newdata
(
data string
)
location 'something'

select data from string limit 1

{ "user": { "name": "default", "education": { "schoome": "abc", "college": "def" } } 

我需要将此结果显示为

| 用户 | 姓名 | 学校| 学院|

|--------|---------|----------|-----------|

4

1 回答 1

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
于 2017-03-20T14:53:45.570 回答