hadoop - Hive : Concat a map -



hadoop - Hive : Concat a map -

i have little problem hive, when seek concatenate map

assume i've :

var 1 | var 2 x | map(key1:value1) x | map(key2:value2) x | map(key3:value3) y | map(key4:value4)

what i'am trying get, it's

var 1 | var 2 x | map(key1:value1 ; key2:value2; key3:value3) y | map(key4,value4)

something map concatenation.

how can proceed whith hive ?

use query...

select var1,collect_set(concat_ws(',',map_keys(var2),map_values(var2))) var2 illustration grouping var1;

this output this...

var1 | var2

x | ["key1,value1","key2,value2","key3,value3"]

y | ["key4,value4"]

hadoop hive hql

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -