hive多行变单行函数collect_set和collect_list
collect_set: 去重,对group by后面的进行去重,对group by以后属于同一组的形成一个集合,结合concat_ws对集合中元素使用,进行分隔形成字符串
collect_list: 不去重
http://blog.sina.com.cn/s/blog_7e04e0d00102xvnk.html
select user,concat_ws(',',collect_set(concat(order_type,'(',order_number,')'))) order from user group by user.user