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

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

                Author: ASF GitHub Bot
            Created on: 14/Jul/20 15:58
            Start Date: 14/Jul/20 15:58
    Worklog Time Spent: 10m 
      Work Description: jcamachor commented on a change in pull request #1231:
URL: https://github.com/apache/hive/pull/1231#discussion_r454464296



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SortedDynPartitionOptimizer.java
##########
@@ -409,26 +409,54 @@ private boolean 
removeRSInsertedByEnforceBucketing(FileSinkOperator fsOp) {
       // and grand child
       if (found) {
         Operator<? extends OperatorDesc> rsParent = 
rsToRemove.getParentOperators().get(0);
-        Operator<? extends OperatorDesc> rsChild = 
rsToRemove.getChildOperators().get(0);
-        Operator<? extends OperatorDesc> rsGrandChild = 
rsChild.getChildOperators().get(0);
-
-        if (rsChild instanceof SelectOperator) {
-          // if schema size cannot be matched, then it could be because of 
constant folding
-          // converting partition column expression to constant expression. 
The constant
-          // expression will then get pruned by column pruner since it will 
not reference to
-          // any columns.
-          if (rsParent.getSchema().getSignature().size() !=
-              rsChild.getSchema().getSignature().size()) {
+        List<Operator<? extends OperatorDesc>> rsChildren = 
rsToRemove.getChildOperators();
+
+        Operator<? extends OperatorDesc> rsChildToRemove = null;
+
+        for (Operator<? extends OperatorDesc> rsChild : rsChildren) {

Review comment:
       Yes, there should not be a RS with multiple children, we can simplify 
that code. You can even add an assert to the new code to make sure.




----------------------------------------------------------------
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: 458743)
    Time Spent: 50m  (was: 40m)

> Sorted dynamic partition optimization could remove auto stat task
> -----------------------------------------------------------------
>
>                 Key: HIVE-23822
>                 URL: https://issues.apache.org/jira/browse/HIVE-23822
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Planning
>            Reporter: Vineet Garg
>            Assignee: Vineet Garg
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> {{mm_dp}} has reproducer where INSERT query is missing auto stats task.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to