I have two tables, both have email
and name
fields. How to write Hive query that will return all recocrds that have matching e-mails in both tables&
For example:
Table_1 :
name x, email e1
name y, email e2
Table_2:
name z, email e3
name q, email e2
Result:
name q, email e2
name y, email e2
Use a
JOIN
. Check this manual page on info aboutJOINS
.https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Joins
You can write a query like:
This query will return you all the records with matching emails.