Last active
August 29, 2015 14:02
-
-
Save randyzwitch/9abeb66d8637d1a0007c to your computer and use it in GitHub Desktop.
Hive Full Table Scan vs. Predicate Pushdown on Outer Join
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--#### Assume sales Hive table partitioned by day_id ####-- | |
--Full Table Scan | |
select | |
employees.id, | |
b.sales | |
from employees | |
left join sales on (employees.id = sales.employee_id) | |
where day_id between '2014-03-01' and '2014-05-31'; | |
--Partitioned-based query | |
select | |
employees.id, | |
b.sales | |
from employees | |
left join sales on (employees.id = sales.employee_id and sales.day_id between '2014-03-01' and '2014-05-31'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works for
left joins
but doesn't seem to work withfull outer join
.