morrySnow commented on code in PR #67067:
URL: https://github.com/apache/doris/pull/67067#discussion_r3861377718
##########
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java:
##########
@@ -3062,6 +3062,9 @@ public void checkFileCacheQueryLimitPercent(String
fileCacheQueryLimitPercentStr
+ "Intended for one-shot / ad-hoc cold queries.")
public boolean invertedIndexSniiReadNoWriteFileCache = false;
+ @VarAttrDef.VarAttr(name = "disable_join_reorder_before_eager_agg",
needForward = true)
+ public boolean disableJoinReorderBeforeEagerAgg = false;
Review Comment:
use enable instead of disable
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/joinorder/JoinOrder.java:
##########
@@ -0,0 +1,278 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.rules.rewrite.joinorder;
+
+import org.apache.doris.nereids.rules.rewrite.StatsDerive;
+import org.apache.doris.nereids.rules.rewrite.StatsDerive.DeriveContext;
+import org.apache.doris.nereids.trees.expressions.ExprId;
+import org.apache.doris.nereids.trees.expressions.Expression;
+import org.apache.doris.nereids.trees.plans.Plan;
+import org.apache.doris.nereids.trees.plans.logical.LogicalJoin;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+import java.util.BitSet;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**JoinOrder*/
+public abstract class JoinOrder {
+ private static final double MAXIMUM_COST = Double.MAX_VALUE / Math.pow(10,
50);
+ private static final double EXECUTE_COST_PENALTY = 2;
+ private static final double CROSS_JOIN_PENALTY = 1_000_000;
+
+ protected int atomSize;
+ protected int edgeSize;
+ protected final List<JoinLevel> joinLevels = Lists.newArrayList();
+ protected final List<Edge> edges = Lists.newArrayList();
+ protected final Map<BitSet, GroupInfo> bitSetToGroupInfo =
Maps.newHashMap();
+
+ /**ExpressionInfo*/
+ static class ExpressionInfo {
+ final Plan expr;
Review Comment:
这个命名很奇怪啊,得改成plan
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/eageraggregation/PushDownAggregation.java:
##########
@@ -85,6 +91,9 @@ public class PushDownAggregation extends
DefaultPlanRewriter<JobContext> impleme
@Override
public Plan rewriteRoot(Plan plan, JobContext jobContext) {
+ if (!plan.anyMatch(node -> node instanceof Aggregate<?>)) {
Review Comment:
nonMatch
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/joinorder/JoinOrder.java:
##########
@@ -0,0 +1,278 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.nereids.rules.rewrite.joinorder;
+
+import org.apache.doris.nereids.rules.rewrite.StatsDerive;
+import org.apache.doris.nereids.rules.rewrite.StatsDerive.DeriveContext;
+import org.apache.doris.nereids.trees.expressions.ExprId;
+import org.apache.doris.nereids.trees.expressions.Expression;
+import org.apache.doris.nereids.trees.plans.Plan;
+import org.apache.doris.nereids.trees.plans.logical.LogicalJoin;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+
+import java.util.BitSet;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**JoinOrder*/
+public abstract class JoinOrder {
+ private static final double MAXIMUM_COST = Double.MAX_VALUE / Math.pow(10,
50);
+ private static final double EXECUTE_COST_PENALTY = 2;
+ private static final double CROSS_JOIN_PENALTY = 1_000_000;
+
+ protected int atomSize;
+ protected int edgeSize;
+ protected final List<JoinLevel> joinLevels = Lists.newArrayList();
+ protected final List<Edge> edges = Lists.newArrayList();
+ protected final Map<BitSet, GroupInfo> bitSetToGroupInfo =
Maps.newHashMap();
+
+ /**ExpressionInfo*/
+ static class ExpressionInfo {
Review Comment:
这个也应该改成PlanInfo?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]