You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/03/24 10:35:00 UTC
[jira] [Updated] (HIVE-24929) Allow correlated exists subqueries
with windowing clause
[ https://issues.apache.org/jira/browse/HIVE-24929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated HIVE-24929:
----------------------------------
Labels: pull-request-available (was: )
> 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: 10m
> 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)