924060929 commented on code in PR #70223:
URL: https://github.com/apache/doris/pull/70223#discussion_r4779704442
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/combinator/StateCombinator.java:
##########
@@ -77,7 +77,8 @@ public StateCombinator(List<Expression> arguments,
AggregateFunction nested) {
this.returnType = new AggStateType(nested.getName(),
arguments.stream().map(ExpressionTrait::getDataType).collect(ImmutableList.toImmutableList()),
arguments.stream().map(ExpressionTrait::nullable).collect(ImmutableList.toImmutableList()),
-
BuiltinAggregateFunctions.INSTANCE.aggFuncNameNullableMap.get(nested.getName()));
+
BuiltinAggregateFunctions.INSTANCE.aggFuncNameNullableMap.get(nested.getName()),
+ nested.getDataType());
Review Comment:
[P1] Verified this end-to-end on a locally built FE+BE cluster from
`713e56c13ca` — reproducible 100% with:
```sql
SET enable_agg_state = true;
SET enable_decimal256 = true;
CREATE TABLE t_repro_dec256_state (k INT, v DECIMAL(76, 6))
DISTRIBUTED BY HASH(k) BUCKETS 1 PROPERTIES ("replication_num" = "1");
INSERT INTO t_repro_dec256_state VALUES (1, 1.234567);
SET enable_decimal256 = false;
SELECT sum_state(v) FROM t_repro_dec256_state;
SELECT sum0_state(v) FROM t_repro_dec256_state;
SELECT multi_distinct_sum_state(v) FROM t_repro_dec256_state;
SELECT sum_combine(v) FROM t_repro_dec256_state;
```
All 4 queries fail on BE with:
`ERROR 1105 (HY000): errCode = 2, detailMessage =
(127.0.0.1)[INTERNAL_ERROR]agg function sum error, arg type
Nullable(Decimal(76, 6)), result type Decimal(38, 6)` (non-nullable for
`multi_distinct_sum_state`).
Please fix this before merge.
--
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]