This is an automated email from the ASF dual-hosted git repository.
jakevin 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 6bf65253d0 [fix](Nereids): unstable test when run single UT. (#23189)
6bf65253d0 is described below
commit 6bf65253d0e5fbfbc9e228e95fd5c94508948cd5
Author: jakevin <[email protected]>
AuthorDate: Fri Aug 18 23:14:56 2023 +0800
[fix](Nereids): unstable test when run single UT. (#23189)
---
.../rewrite/EliminateGroupByConstantTest.java | 24 +++++++++-------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/EliminateGroupByConstantTest.java
b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/EliminateGroupByConstantTest.java
index 2fbf2adf17..3fca54eed9 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/EliminateGroupByConstantTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/rewrite/EliminateGroupByConstantTest.java
@@ -26,7 +26,7 @@ import org.apache.doris.catalog.Type;
import org.apache.doris.nereids.rules.analysis.CheckAfterRewrite;
import org.apache.doris.nereids.trees.expressions.Add;
import org.apache.doris.nereids.trees.expressions.Alias;
-import org.apache.doris.nereids.trees.expressions.SlotReference;
+import org.apache.doris.nereids.trees.expressions.Slot;
import org.apache.doris.nereids.trees.expressions.functions.agg.Max;
import org.apache.doris.nereids.trees.expressions.functions.agg.Min;
import org.apache.doris.nereids.trees.expressions.literal.IntegerLiteral;
@@ -34,7 +34,6 @@ import
org.apache.doris.nereids.trees.expressions.literal.StringLiteral;
import org.apache.doris.nereids.trees.plans.RelationId;
import org.apache.doris.nereids.trees.plans.logical.LogicalOlapScan;
import org.apache.doris.nereids.trees.plans.logical.LogicalPlan;
-import org.apache.doris.nereids.types.IntegerType;
import org.apache.doris.nereids.util.LogicalPlanBuilder;
import org.apache.doris.nereids.util.MemoPatternMatchSupported;
import org.apache.doris.nereids.util.MemoTestUtils;
@@ -51,8 +50,6 @@ class EliminateGroupByConstantTest implements
MemoPatternMatchSupported {
new Column("k2", Type.INT, false, AggregateType.NONE, "0",
""),
new Column("k3", Type.INT, true, AggregateType.NONE, "",
"")),
KeysType.PRIMARY_KEYS, new PartitionInfo(), null);
- private static final SlotReference k1 = new SlotReference("k1",
IntegerType.INSTANCE);
- private static final SlotReference k2 = new SlotReference("k2",
IntegerType.INSTANCE);
static {
table.setIndexMeta(-1,
@@ -63,10 +60,13 @@ class EliminateGroupByConstantTest implements
MemoPatternMatchSupported {
KeysType.PRIMARY_KEYS);
}
+ private static final LogicalOlapScan scan = new
LogicalOlapScan(RelationId.createGenerator().getNextId(), table);
+ private static final Slot k1 = scan.getOutput().get(0);
+ private static final Slot k2 = scan.getOutput().get(1);
+
@Test
void testIntegerLiteral() {
- LogicalPlan aggregate = new LogicalPlanBuilder(
- new LogicalOlapScan(RelationId.createGenerator().getNextId(),
table))
+ LogicalPlan aggregate = new LogicalPlanBuilder(scan)
.agg(ImmutableList.of(new IntegerLiteral(1), k2),
ImmutableList.of(k1, k2))
.build();
@@ -81,8 +81,7 @@ class EliminateGroupByConstantTest implements
MemoPatternMatchSupported {
@Test
void testOtherLiteral() {
- LogicalPlan aggregate = new LogicalPlanBuilder(
- new LogicalOlapScan(RelationId.createGenerator().getNextId(),
table))
+ LogicalPlan aggregate = new LogicalPlanBuilder(scan)
.agg(ImmutableList.of(
new StringLiteral("str"), k2),
ImmutableList.of(
@@ -99,8 +98,7 @@ class EliminateGroupByConstantTest implements
MemoPatternMatchSupported {
@Test
void testMixedLiteral() {
- LogicalPlan aggregate = new LogicalPlanBuilder(
- new LogicalOlapScan(RelationId.createGenerator().getNextId(),
table))
+ LogicalPlan aggregate = new LogicalPlanBuilder(scan)
.agg(ImmutableList.of(
new StringLiteral("str"), k2,
new IntegerLiteral(1),
@@ -123,8 +121,7 @@ class EliminateGroupByConstantTest implements
MemoPatternMatchSupported {
@Test
void testComplexGroupBy() {
- LogicalPlan aggregate = new LogicalPlanBuilder(
- new LogicalOlapScan(RelationId.createGenerator().getNextId(),
table))
+ LogicalPlan aggregate = new LogicalPlanBuilder(scan)
.agg(ImmutableList.of(
new IntegerLiteral(1),
new IntegerLiteral(2),
@@ -146,8 +143,7 @@ class EliminateGroupByConstantTest implements
MemoPatternMatchSupported {
@Test
void testOutOfRange() {
- LogicalPlan aggregate = new LogicalPlanBuilder(
- new LogicalOlapScan(RelationId.createGenerator().getNextId(),
table))
+ LogicalPlan aggregate = new LogicalPlanBuilder(scan)
.agg(ImmutableList.of(
new StringLiteral("str"), k2,
new IntegerLiteral(1),
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]