Monday, 19 August 2013

join on two merges hive

join on two merges hive

Hi am trying to join two tables in Hive. The two tables are like
Select r.count as edits ,d.views as views
From(
Select substr(r.time,1,6) as Time, count(r.revisionID) as
count,collect_set(p.title)[0] as title
from pages p
join revisions r on p.pageID = r.pageID
where p.namespace = 0
group by substr(r.time,1,6) ) r join views d on d.time =r.Time and r.title
= d.title
The table from the subquery should be somthing like:
200812,121,Germany
....
The second one (the views) is something like
200812,99,Germany
Now I am trying to join the both and the match should only happen when the
title AND the time is equal. But the query above does not work. Any help
would be really appreciated!

No comments:

Post a Comment