title: Joining partitioned tables in Hive
body: <p>Let's say I have two partitioned tables say <code>customer</code> and <code>items</code> and both are partitioned by <code>country</code> and <code>state</code> columns.</p>
  
  <p>Is this the right way to join contents of these tables given that I want to retrieve data for a specific country and state?</p>
  
  <pre><code>select 
    customer.id, 
    customer.name, 
    items.name, 
    items.value
  from
    customers
    join items
    on customers.id == items.customer_id
    and customers.country == 'USA'
    and customers.state == 'TX'
    and items.country == 'USA'
    and items.state == 'TX'
  </code></pre>
  
  <p>or should these conditions go in the WHERE clause?</p>
  
  <pre><code>and customers.country == 'USA'
  and customers.state == 'TX'
  and items.country == 'USA'
  and items.state == 'TX'
  </code></pre>