Could you also add the results of the following query?
Thanks Dudu select m_d_key ,sb_gu_key ,count (*) as cnt from tuning_dd_key group by m_d_key ,sb_gu_key order by cnt desc limit 100 ; -----Original Message----- From: Gopal Vijayaraghavan [mailto:go...@hortonworks.com] On Behalf Of Gopal Vijayaraghavan Sent: Thursday, June 23, 2016 9:45 AM To: user@hive.apache.org Subject: Re: Optimize Hive Query > Long running query : Are you running this on MapReduce or Tez? Please post the output of explain - if you are seeing > 1 shuffle edge in your query while having only one window for OVER(), that might be the reason. OVER ( PARTITION BY m_d_key , sb_gu_key ORDER BY t_ev_st_dt) The multiple PTF operators should have been collapsed by the reduce sink-deduplication. Cheers, Gopal