Apache Hive does not have direct standard UDF for transposing rows into columns. Transpose & Pivot in Hive Query can be achieved using multi-stage process. You can use collect_list() or collect_set() function and merge the multiple rows into columns and then get the result.
collect_list() and collect_set() are part of Built-in Aggregate Functions (UDAF). collect_list(col_name) returns a set of objects … read the rest