I have two tables with columns as shown below.
Posts:
user STRING,
tag_list ARRAY<STRING>
Tags:
tag STRING
Here are some examples of data in these tables.
Posts:
user1 help, pig
user2 bigdata, hadoop, query, hiveql
user1 hive, hiveql, help
Tags:
hadoop
hiveql
If I want to filter only the rows in the Posts table that contain the tags listed in the tag table, as shown in the results below, how do I do this in a hive request? I am not sure how to join these two tables using array_contains.
Expected Query Result:
user2 bigdata, hadoop, query, hiveql
user1 hive, hiveql, help
thanks
source
share