This is an automated email from the ASF dual-hosted git repository.
morrysnow 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 7a26847955d [chore](type) remove useless code in PartialAggType
(#60818)
7a26847955d is described below
commit 7a26847955d57f373569bfd57c2762c1fc242515
Author: morrySnow <[email protected]>
AuthorDate: Wed Feb 25 16:59:58 2026 +0800
[chore](type) remove useless code in PartialAggType (#60818)
---
.../functions/agg/AggregateFunction.java | 2 +-
.../apache/doris/nereids/types/PartialAggType.java | 25 +++++-----------------
2 files changed, 6 insertions(+), 21 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AggregateFunction.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AggregateFunction.java
index e356811fdef..380772afb55 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AggregateFunction.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AggregateFunction.java
@@ -79,7 +79,7 @@ public abstract class AggregateFunction extends BoundFunction
implements Expects
/** getIntermediateTypes */
public final PartialAggType getIntermediateTypes() {
- return new PartialAggType(getArguments(), intermediateTypes());
+ return new PartialAggType(intermediateTypes());
}
public boolean isDistinct() {
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/PartialAggType.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/PartialAggType.java
index 14d4a7ac356..600ced35654 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/PartialAggType.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/PartialAggType.java
@@ -19,7 +19,6 @@ package org.apache.doris.nereids.types;
import org.apache.doris.catalog.ScalarType;
import org.apache.doris.catalog.Type;
-import org.apache.doris.nereids.trees.expressions.Expression;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
@@ -29,32 +28,19 @@ import java.util.Objects;
/** PartialAggType */
public class PartialAggType extends DataType {
- public final List<Expression> originArguments;
public final List<DataType> intermediateTypes;
/** PartialAggType */
- public PartialAggType(List<Expression> originArguments, List<DataType>
intermediateTypes) {
- this.originArguments = ImmutableList.copyOf(
- Objects.requireNonNull(originArguments, "originArguments can
not be null"));
+ public PartialAggType(List<DataType> intermediateTypes) {
this.intermediateTypes = ImmutableList.copyOf(
Objects.requireNonNull(intermediateTypes, "intermediateTypes
can not be null"));
- Preconditions.checkArgument(intermediateTypes.size() > 0,
"intermediateTypes can not empty");
- }
-
- public List<Expression> getOriginArguments() {
- return originArguments;
+ Preconditions.checkArgument(!intermediateTypes.isEmpty(),
"intermediateTypes can not empty");
}
public List<DataType> getIntermediateTypes() {
return intermediateTypes;
}
- public List<DataType> getOriginInputTypes() {
- return originArguments.stream()
- .map(Expression::getDataType)
- .collect(ImmutableList.toImmutableList());
- }
-
@Override
public String toSql() {
return "PartialAggType(types=" + intermediateTypes + ")";
@@ -64,7 +50,7 @@ public class PartialAggType extends DataType {
public int width() {
return intermediateTypes.stream()
.map(DataType::width)
- .reduce((w1, w2) -> w1 + w2)
+ .reduce(Integer::sum)
.get();
}
@@ -88,12 +74,11 @@ public class PartialAggType extends DataType {
return false;
}
PartialAggType that = (PartialAggType) o;
- return Objects.equals(originArguments, that.originArguments)
- && Objects.equals(intermediateTypes, that.intermediateTypes);
+ return Objects.equals(intermediateTypes, that.intermediateTypes);
}
@Override
public int hashCode() {
- return Objects.hash(super.hashCode(), originArguments,
intermediateTypes);
+ return Objects.hash(super.hashCode(), intermediateTypes);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]