Skip to content

Commit

Permalink
fix feut code style
Browse files Browse the repository at this point in the history
  • Loading branch information
feiniaofeiafei committed Oct 9, 2024
1 parent cf04ec6 commit 97eaacc
Showing 1 changed file with 27 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// 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;

import org.apache.doris.nereids.trees.expressions.functions.agg.Count;
Expand Down Expand Up @@ -31,8 +48,8 @@ void testPushCountStar() {
.rewrite()
.matches(
logicalAggregate(
logicalUnion(logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class))
,logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)))
logicalUnion(logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)),
logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)))
).when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Sum0.class))
);
String sql2 = "select count(*) from (select id,a from t1 union all select id,a from t1 where id>10) t;";
Expand All @@ -41,8 +58,8 @@ void testPushCountStar() {
.rewrite()
.matches(
logicalAggregate(
logicalUnion(logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class))
,logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)))
logicalUnion(logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)),
logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)))
).when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Sum0.class))
);
}
Expand All @@ -55,8 +72,8 @@ void testPushCountColumn() {
.rewrite()
.matches(
logicalAggregate(
logicalUnion(logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class))
,logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)))
logicalUnion(logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)),
logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)))
).when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Sum0.class))
);
}
Expand All @@ -70,8 +87,8 @@ void testPushCountColumnWithGroupBy() {
.matches(
logicalAggregate(
logicalUnion(logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)
&& agg.getGroupByExpressions().size() == 1)
,logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)
&& agg.getGroupByExpressions().size() == 1),
logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)
&& agg.getGroupByExpressions().size() == 1))
).when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Sum0.class))
);
Expand All @@ -86,8 +103,8 @@ void testPush2CountColumn() {
.matches(
logicalAggregate(
logicalUnion(logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)
&& agg.getGroupByExpressions().size() == 1)
,logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)
&& agg.getGroupByExpressions().size() == 1),
logicalAggregate().when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Count.class)
&& agg.getGroupByExpressions().size() == 1))
).when(agg -> ExpressionUtils.containsType(agg.getOutputExpressions(), Sum0.class))
);
Expand Down

0 comments on commit 97eaacc

Please sign in to comment.