-1

My objective is to make a table in Hive wherein for every new value of a column, say name, it will seed a word.

any code sample that can do this?

expected result:

name transaction date transaction code
Karen 01012021 ABC
Karen 01022021 DEF
Karen 01032021 ABC
Karen 01042021 GHI
name transaction_date transaction_code
Gilbert 01012021 ABC
Gilbert 01022021 DEF
Gilbert 01032021 ABC
Gilbert 01042021 GHI
name transaction_date transaction_code
Sherwin 01012021 ABC
Sherwin 01022021 DEF
Sherwin 01032021 ABC
Sherwin 01042021 GHI

1 Answers1

0
  1. You can find distinct name (create a view or table)
  2. Loop through each value 2a) As you are looping make a insert "name" | transation_Date | code

Not sure if you can do alone in Hive but with a combination of Python/Spark/Scala you can do this. Hope it helps in some ways.