Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Concatenate other fields after Hive group by operation

Shulou Source: shulou.com Published: 2022-06-03 07:53:15 09月23日 Update

Table tmp_test

An ios

B andriod

An andriod

Target data

An ios | andriod

B andriod

Sql: select uid,concat_ws ('|', collect_set (device)) from tmp_test group by uid

Collect_set is an aggregate function built into Hive that returns a collection of objects with deduplicated elements whose return type is array.

Tags: Elements functions objects data targets types fields Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Information OPPO Reno Redmi MySQL