我正在尝试将hive列中的值拆分为多个列。请参阅下面的模式。
select id,
to_char(occurred_at, 'yyyy-mm') as occurred_at,
to_char(expire_at, 'yyyy-mm') as expire_at
from the_table
where ( occured_at >= timestamp '2017-04-01 00:00:00'
and occured_at < timestamp '2017-05-01 00:00:00')
or ( expire_at >= timestamp '2017-04-01 00:00:00'
and expire_at < timestamp '2017-05-01 00:00:00');
我需要以下价值观。
"[{\"A\":\"1009972\",\"B\":\"003900006647XXVVVVV\"},{\"A\":\"10099725647\",\"B\":\"00390000000000djhdhfga\"}]"
我能够在hive中使用stbstr()函数获取值。但是我们可以看到值是动态的,并且可能是多个因为它失败了。如何在hive中获取值。欢迎帮助。< / p>