This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 19496ef9a0 [improve](nereids): remove FakeJoin.java (#11946)
19496ef9a0 is described below

commit 19496ef9a017922b7a950de1377a634d28d7c980
Author: jakevin <jakevin...@gmail.com>
AuthorDate: Mon Aug 22 08:28:20 2022 +0800

    [improve](nereids): remove FakeJoin.java (#11946)
---
 .../doris/nereids/stats/StatsCalculatorTest.java   | 14 ++++---
 .../apache/doris/nereids/trees/plans/FakeJoin.java | 43 ----------------------
 2 files changed, 8 insertions(+), 49 deletions(-)

diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/stats/StatsCalculatorTest.java
 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/stats/StatsCalculatorTest.java
index 290cbd7d32..67045678aa 100644
--- 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/stats/StatsCalculatorTest.java
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/stats/StatsCalculatorTest.java
@@ -32,11 +32,11 @@ import org.apache.doris.nereids.trees.expressions.Slot;
 import org.apache.doris.nereids.trees.expressions.SlotReference;
 import org.apache.doris.nereids.trees.expressions.functions.AggregateFunction;
 import org.apache.doris.nereids.trees.expressions.functions.Sum;
-import org.apache.doris.nereids.trees.plans.FakeJoin;
 import org.apache.doris.nereids.trees.plans.GroupPlan;
 import org.apache.doris.nereids.trees.plans.JoinType;
 import org.apache.doris.nereids.trees.plans.logical.LogicalAggregate;
 import org.apache.doris.nereids.trees.plans.logical.LogicalFilter;
+import org.apache.doris.nereids.trees.plans.logical.LogicalJoin;
 import org.apache.doris.nereids.trees.plans.logical.LogicalLimit;
 import org.apache.doris.nereids.trees.plans.logical.LogicalOlapScan;
 import org.apache.doris.nereids.trees.plans.logical.LogicalTopN;
@@ -165,9 +165,7 @@ public class StatsCalculatorTest {
 
     @Test
     public void testHashJoin() {
-        List<String> qualifier = new ArrayList<>();
-        qualifier.add("test");
-        qualifier.add("t");
+        List<String> qualifier = ImmutableList.of("test", "t");
         SlotReference slot1 = new SlotReference("c1", IntegerType.INSTANCE, 
true, qualifier);
         SlotReference slot2 = new SlotReference("c2", IntegerType.INSTANCE, 
true, qualifier);
         ColumnStats columnStats1 = new ColumnStats();
@@ -190,8 +188,12 @@ public class StatsCalculatorTest {
 
         EqualTo equalTo = new EqualTo(slot1, slot2);
 
-        FakeJoin fakeSemiJoin = new FakeJoin(JoinType.LEFT_SEMI_JOIN, 
Optional.of(equalTo));
-        FakeJoin fakeInnerJoin = new FakeJoin(JoinType.INNER_JOIN, 
Optional.of(equalTo));
+        LogicalOlapScan scan1 = PlanConstructor.newLogicalOlapScan(0, "t", 0);
+        LogicalOlapScan scan2 = PlanConstructor.newLogicalOlapScan(0, "t", 0);
+        LogicalJoin<LogicalOlapScan, LogicalOlapScan> fakeSemiJoin = new 
LogicalJoin<>(
+                JoinType.LEFT_SEMI_JOIN, Optional.of(equalTo), scan1, scan2);
+        LogicalJoin<LogicalOlapScan, LogicalOlapScan> fakeInnerJoin = new 
LogicalJoin<>(
+                JoinType.INNER_JOIN, Optional.of(equalTo), scan1, scan2);
 
         StatsDeriveResult semiJoinStats = JoinEstimation.estimate(leftStats, 
rightStats, fakeSemiJoin);
         Assertions.assertEquals(leftRowCount, semiJoinStats.getRowCount());
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/FakeJoin.java 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/FakeJoin.java
deleted file mode 100644
index 431abccae1..0000000000
--- 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/trees/plans/FakeJoin.java
+++ /dev/null
@@ -1,43 +0,0 @@
-// 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.trees.plans;
-
-import org.apache.doris.nereids.trees.expressions.Expression;
-import org.apache.doris.nereids.trees.plans.algebra.Join;
-
-import java.util.Optional;
-
-public class FakeJoin implements Join {
-    private final JoinType joinType;
-    private final Optional<Expression> condition;
-
-    public FakeJoin(JoinType joinType, Optional<Expression> condition) {
-        this.joinType = joinType;
-        this.condition = condition;
-    }
-
-    @Override
-    public JoinType getJoinType() {
-        return joinType;
-    }
-
-    @Override
-    public Optional<Expression> getCondition() {
-        return condition;
-    }
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to