>From Ali Alsuliman <ali.al.solai...@gmail.com>:

Attention is currently required from: Murtadha Hubail, Peeyush Gupta.
Ali Alsuliman has posted comments on this change. ( 
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18685 )

Change subject: [ASTERIXDB-3410][COMP] stack overflow with heavily nested 
queries
......................................................................


Patch Set 3:

(5 comments)

File 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/CompilerProperties.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18685/comment/2df88621_92f7bf82
PS3, Line 156: COMPILER_MAX_VARIABLE_OCCURRENCES_INLINING
We also need to make this configurable in the extension.


File 
asterixdb/asterix-common/src/main/java/org/apache/asterix/common/config/OptimizationConfUtil.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18685/comment/ab3e7962_e9d7f180
PS3, Line 232: OptionTypes.POSITIVE_INTEGER
OptionTypes.POSITIVE_INTEGER = getRangedIntegerType(1, Integer.MAX_VALUE).
In the compiler properties, we are defining 
'COMPILER_MAX_VARIABLE_OCCURRENCES_INLINING' as getRangedIntegerType(0, 
Integer.MAX_VALUE). Let's pick one and make them consistent.


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

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18685/comment/3187e345_33b41cfe
PS3, Line 88: totalLeafVariableCounter
Should we include it in the 'prepare()' to clear it?


https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18685/comment/84e58f88_b52b478c
 
PS3, Line 173: computeLeafVariablesCount(op);
It seems like we can move this inside the below if-block:
if (op.getOperatorTag() == LogicalOperatorTag.ASSIGN) {
AssignOperator assignOp = (AssignOperator) op;
computeLeafVariablesCount(assignOp); // and then remove the check and the cast
...


https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18685/comment/b4764695_c0fdfa88
PS3, Line 180: totalLeafVariableCounter.containsKey(variable) && 
!totalLeafVariableCounter.get(variable).isEmpty()
             :                         && 
Collections.max(totalLeafVariableCounter.get(variable).values()) > context
             :                                 
.getPhysicalOptimizationConfig().getMaxVariableOccurrencesForInlining()
This is minor; you can look up the 'totalLeafVariableCounter' map only once 
(assuming m is not going to be inlined):
Map<> m = totalLeafVariableCounter.get(variable);
if (m != null && !m.isEmpty() && Collections.max(m.values()) > ...) {

}



--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18685
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: Ie3fed69bf915535302664beb335d32ccc4988afe
Gerrit-Change-Number: 18685
Gerrit-PatchSet: 3
Gerrit-Owner: Peeyush Gupta <peeyush.gu...@couchbase.com>
Gerrit-Reviewer: Ali Alsuliman <ali.al.solai...@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <mhub...@apache.org>
Gerrit-Reviewer: Peeyush Gupta <peeyush.gu...@couchbase.com>
Gerrit-Attention: Murtadha Hubail <mhub...@apache.org>
Gerrit-Attention: Peeyush Gupta <peeyush.gu...@couchbase.com>
Gerrit-Comment-Date: Thu, 22 Aug 2024 05:02:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Reply via email to