0
UNION ALLのシーケンスは、MAPを構築するために使用するキー値のペアのリストを結果としてもたらします。Hiveのcollect_listの結果からマップを構築
望ましい機能は、このようなものです:
select id1, id2, map(collect_list(col)) as measurements
from
(
select id1, id2, "height" as col
union all
select id1, id2, count(*) as col from table1
union all
select id1, id2, "weight" as col
union all
select id1, id2, count(*) as col from table2
)
これを実装するための正しい方法は何ですか?
私が得ることを期待結果は次のとおりです。
id1 id2 measurements
1 10 {"height": 10, "weight": 20}
2 20 {"height": 10, "weight": 20}
お返事ありがとうございます。このデータを取得するのに、 'array>' を正常に使用できました。 –
KMeansK