Skip to content
Advertisement

Join two tables based on different column type

I have two tables with the following schema as example:

I want to get all col1 in df2 where an element in col2 array is equal to id in df1. Something such as df3 is output:

where df3.c2 is basically df1.id and df3.c1 is array of all df2.col1 that satisfy the mentioned equality.

any SQL (hive) or Scala solution is very helpful.

Advertisement

Answer

In Hive:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement