>From <[email protected]>:

Attention is currently required from: Peeyush Gupta.
[email protected] has posted comments on this change. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19207 )

Change subject: [ASTERIXDB-3538][COMP] Remove subplan operators that produce 
empty variables
......................................................................


Patch Set 7:

(1 comment)

File 
hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/RemoveUnusedAssignAndAggregateRule.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19207/comment/374befa7_83fb59a6
PS6, Line 196:             for (int i = opWithNest.getNestedPlans().size() - 1; 
i >= 0; i--) {
             :                 ILogicalPlan nestedPlan = 
opWithNest.getNestedPlans().get(i);
             :                 List<Mutable<ILogicalOperator>> rootsToBeRemoved 
= new ArrayList<Mutable<ILogicalOperator>>();
             :                 for (Mutable<ILogicalOperator> r : 
nestedPlan.getRoots()) {
             :                     ILogicalOperator topOp = r.getValue();
             :                     Set<LogicalVariable> producedVars = new 
ListSet<LogicalVariable>();
             :                     
VariableUtilities.getProducedVariablesInDescendantsAndSelf(topOp, producedVars);
             :                     if (producedVars.size() == 0) {
             :                         rootsToBeRemoved.add(r);
             :                     }
             :                 }
             :                 // Makes sure the operator should have at least 
ONE nested plan even it is empty
             :                 // (because a lot of places uses this 
assumption,  TODO(yingyib): clean them up).
             :                 if (nestedPlan.getRoots().size() == 
rootsToBeRemoved.size() && opWithNest.getNestedPlans().size() > 1) {
             :                     
nestedPlan.getRoots().removeAll(rootsToBeRemoved);
             :                     
opWithNest.getNestedPlans().remove(nestedPlan);
             :                 }
             :             }
             :         }
> It seems like we already have some code that removes empty nested plans. […]
Yeah, this code actually tries to remove empty nested plans if there are >1 
nested plans.And I think it is because subplan with empty list of nested plans 
are not supported in our rules/plans.
But, this uses ProducedVariablesInDescendantsAndSelf.isEmpty() to remove, which 
doesn't capture the case we are trying to solve.



--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19207
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: Ie123ccaafbd528d127bd91ecf0a6b5e93c497683
Gerrit-Change-Number: 19207
Gerrit-PatchSet: 7
Gerrit-Owner: [email protected]
Gerrit-Reviewer: Ali Alsuliman <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Peeyush Gupta <[email protected]>
Gerrit-Attention: Peeyush Gupta <[email protected]>
Gerrit-Comment-Date: Sun, 05 Jan 2025 08:33:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Peeyush Gupta <[email protected]>
Gerrit-MessageType: comment

Reply via email to