title: Hive joining tables with partitions
body: <p>I need to optimize a query in Hive where I am joining tables using partitions but using two different partitions:</p>
  <pre><code>select *
  from k1_core_dim_dl_tables.dl_item_dim a inner
  join k1_repl_dl_tables.repl_managed_sku b on b.mds_fam_id = a.mds_fam_id
  join k1_core_dim_dl_tables.dl_store_club_dim c on c.store_nbr = b.store_nbr inner
  join k1_core_dim_dl_tables.dl_calendar_dim d on current_date = d.cal_dt
  group by c.state_prov_cd, a.upc_nbr, a.item_nbr, a.signing_desc, a.dept_nbr, b.store_nbr, c.store_nm, d.cal_wk_nbr
  limit 10;
  </code></pre>
  <p>the partitions would be:</p>
  <p>for k1_core_dim_dl_tables.dl_item_dim, k1_repl_dl_tables.repl_managed_sku and k1_core_dim_dl_tables.dl_store_club_dim, partition op_cmpny_cd=WMT-K1</p>
  <p>for k1_core_dim_dl_tables.dl_calendar_dim, partition geo_region_cd=K1</p>