>From Peeyush Gupta <[email protected]>:

Attention is currently required from: [email protected].
Peeyush Gupta 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 6: Code-Review+2

(2 comments)

Patchset:

PS6:
Just one comment regarding if we are able to remove empty subplans in a nested 
plan.


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/687241db_2c596f7a
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. It 
seems like it is only doing when it has more than 1 nested plan.

It will be good to check if the empty subplan is inside a nested plan does this 
change or the code above is able to remove it.



--
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: 6
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: [email protected]
Gerrit-Comment-Date: Fri, 03 Jan 2025 22:50:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Reply via email to