[ 
https://issues.apache.org/jira/browse/HIVE-21921?focusedWorklogId=271019&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-271019
 ]

ASF GitHub Bot logged work on HIVE-21921:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Jul/19 16:40
            Start Date: 02/Jul/19 16:40
    Worklog Time Spent: 10m 
      Work Description: jcamachor commented on pull request #693: HIVE-21921: 
Support for correlated quantified predicates
URL: https://github.com/apache/hive/pull/693#discussion_r299578022
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveSubQueryRemoveRule.java
 ##########
 @@ -592,6 +616,20 @@ public static RexSubQuery find(RexNode node) {
     }
   }
 
+    public static void subqueryRestriction(RelNode relNode) {
+      if(relNode instanceof HiveAggregate) {
+        HiveAggregate aggregate = (HiveAggregate)relNode;
+        if(!aggregate.getAggCallList().isEmpty() && 
aggregate.getGroupSet().isEmpty()) {
+          throw new CalciteSubqueryRuntimeException("Subquery rewrite: 
Aggregate without group by is not allowed");
+        }
+      } else if(relNode instanceof HiveProject
+      || relNode instanceof HiveFilter) {
+        subqueryRestriction(relNode.getInput(0));
+      } else {
+        return;
 
 Review comment:
   This is not needed?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 271019)

> Support for correlated quantified predicates
> --------------------------------------------
>
>                 Key: HIVE-21921
>                 URL: https://issues.apache.org/jira/browse/HIVE-21921
>             Project: Hive
>          Issue Type: New Feature
>          Components: Query Planning
>            Reporter: Vineet Garg
>            Assignee: Vineet Garg
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-21921.1.patch, HIVE-21921.2.patch, 
> HIVE-21921.3.patch, HIVE-21921.4.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to