Reputation: 1326
I need one hive query which merge same EAN rows into one record in table based on priority which is another table.
As shown in the above image I have different products from different sources(sourceid) and I want only one row by merging all sources data based on below priority. If priority "1" source doesn't provide any field info, that field info will be taken from priority "2" source.
Table: priority
node_id Source_id Priority
1 62 1
1 303 2
1 202 3
I am expecting results as shown below.
Upvotes: 0
Views: 1881
Reputation: 501
you can actually use collect udf to collect all the other fields based on one field.
or you can use some nested arrays or struct to get the data into single row, If you don't want to loose any data.
Upvotes: 1