[ https://issues.apache.org/jira/browse/HIVE-24929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Krisztian Kasa resolved HIVE-24929. ----------------------------------- Resolution: Fixed Pushed to master. Thanks [~jcamachorodriguez] for review. > Allow correlated exists subqueries with windowing clause > -------------------------------------------------------- > > Key: HIVE-24929 > URL: https://issues.apache.org/jira/browse/HIVE-24929 > Project: Hive > Issue Type: Improvement > Components: Query Planning > Reporter: Krisztian Kasa > Assignee: Krisztian Kasa > Priority: Major > Labels: pull-request-available > Fix For: 4.0.0 > > Time Spent: 1h > Remaining Estimate: 0h > > Currently queries which has windowing clause with subqueries are not > supported by Hive: Hive rewrites subqueries to joins and the rewritten plan > would lead to incorrect results such cases. > However this restriction can be lifted in case of Exists/Not exists > subqueries since those cases we don not interested in the result of the > window function call but the existence of any record. > {code} > select id, int_col > from alltypesagg a > where exists > (select sum(int_col) over (partition by bool_col) > from alltypestiny b > where a.id = b.id); > {code} > {code} > select id, int_col from alltypestiny t > where not exists > (select sum(int_col) over (partition by bool_col) > from alltypesagg a where t.id = a.int_col); > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)