对于hive对JSON字符串的解析小白在之前博文中已经有两篇做过详细的介绍了,这边博文主要记录一下,小白在工作中遇到的一个实例,巨坑。
案例如下:
{"id":"23|38","index":"1","name":"高星好评","subfilters":,"type":"23"}
一眼看上去,是不是符合JSON字符串的风格,然后就开始解析
select filters,
id,
index,
name,
type
from aa
lateral view json_tuple(filters, 'id', 'index', 'name', 'type') b
as id,
index,
name,
type
结果为:
百思不得其解,为什么明明有数据,解析不出来呢?
仔细看{"id":"23|38","index":"1","name":"高星好评","subfilters":,"type":"23"}中"subfilters":