天天看點

hive:使用concat_ws實作 array轉string

array轉string:

select * from ( 
	select 
		collect_list(id) id_array,
		concat_ws('',collect_list(id)) id_string, --array轉string
		origin_id
	from( 
			select 
				concat('{',id,'}') id,
				origin_id  --付款通知書id
			from ods.ods_awa_finance_income
			where origin = 1 --付款通知書
		) a 
	group by origin_id
) s where length(id_string)>8
           
hive:使用concat_ws實作 array轉string