This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 5faa9da049 [IOTDB-4120] Modify build method of LayerMemoryAssigner
5faa9da049 is described below
commit 5faa9da049e304bc519a2b96d47cc78d0bdbb9d1
Author: Liao Lanyu <[email protected]>
AuthorDate: Mon Aug 15 08:48:30 2022 +0800
[IOTDB-4120] Modify build method of LayerMemoryAssigner
---
.../db/mpp/transformation/dag/memory/LayerMemoryAssigner.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git
a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/memory/LayerMemoryAssigner.java
b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/memory/LayerMemoryAssigner.java
index 928c662883..bbfcc71e2a 100644
---
a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/memory/LayerMemoryAssigner.java
+++
b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/memory/LayerMemoryAssigner.java
@@ -20,6 +20,7 @@
package org.apache.iotdb.db.mpp.transformation.dag.memory;
import org.apache.iotdb.db.mpp.plan.expression.Expression;
+import org.apache.iotdb.db.mpp.plan.expression.leaf.ConstantOperand;
import org.apache.iotdb.db.mpp.plan.expression.multi.FunctionExpression;
import java.util.HashMap;
@@ -51,9 +52,12 @@ public class LayerMemoryAssigner {
int memoryPartitions = 0;
for (Entry<Expression, Integer> expressionReferenceEntry :
expressionReferenceCount.entrySet()) {
- memoryPartitions +=
- expressionReferenceEntry.getValue()
- * (expressionReferenceEntry.getKey() instanceof
FunctionExpression ? 2 : 1);
+ Expression expression = expressionReferenceEntry.getKey();
+ if (expression instanceof FunctionExpression) {
+ memoryPartitions += 2;
+ } else if (!(expression instanceof ConstantOperand)) {
+ memoryPartitions += 1;
+ }
}
memoryBudgetForSingleReference =
memoryPartitions == 0 ? memoryBudgetInMB : memoryBudgetInMB /
memoryPartitions;