hadoop - Create multiple column qualifiers in HBase using a loop -
i turn row info columns.
i have state , visit info so:
state visit month az 1023 06 ny 32234 06 oh 9821 06 ny 4564 07 ks 3232 06 mo 2322 06 az 222 07
i info this:
month az ks mo ny oh 06 1023 3232 2322 32234 9821 07 222 4564
my info stored in hbase
the way see it, filter info state , append new column new table. little number of columns in pig without problem, think silly 50 times , rather utilize loop. these column qualifiers in same column family, obviously.
i know pig doesn't have loops. have been trying find solution problem in hive no luck far.
is there way in pig, hive, native mapreduce, or in hbase shell?
there way in hive. can collect visits , month map , reference keys of map new columns. you'll need collectudaf
here
query:
add jar /path/to/jar/brickhouse.jar; create temporary function collect 'brickhouse.udf.collect.collectudaf'; select month ,state_map['az'] az ,state_map['ny'] ny ,state_map['oh'] oh ,state_map['ks'] ks ,state_map['mo'] mo ( select month ,collect(state, visit) state_map database.table grouping month ) x
output:
06 1023 32234 9821 3232 2322 07 222 4564 null null null
loops hadoop mapreduce hive hbase
No comments:
Post a Comment