我有一个表格,每列有一列array<bigint>
动态大小.例如:
1 [100,200]
2 [100,300,500,600]
3 [200,300]
Run Code Online (Sandbox Code Playgroud)
结果应该是此列数组的不同值
100
200
300
500
600
Run Code Online (Sandbox Code Playgroud)
你必须使用hive的explode()函数.然后在子查询上应用distinct.
就像是
select distinct a.conver from (select explode(arr) as conver from arraytype2) as a
Run Code Online (Sandbox Code Playgroud)
希望有所帮助!
归档时间: |
|
查看次数: |
5440 次 |
最近记录: |