github-actions[bot] commented on code in PR #70223:
URL: https://github.com/apache/doris/pull/70223#discussion_r4665796102


##########
fe/fe-type/src/main/java/org/apache/doris/catalog/AggStateType.java:
##########
@@ -125,6 +138,10 @@ public void toThrift(TTypeDesc container) {
         container.setResultIsNullable(resultIsNullable);
         container.setFunctionName(functionName);
         container.setBeExecVersion(Config.be_exec_version);
+        // Old catalog images omit the signature; retain that marker for the 
BE legacy reader.
+        if (resultType != null) {
+            container.setAggStateResultType(resultType.toThrift().getTypes());

Review Comment:
   [P2] Preserve the complete descriptor for nested state results
   
   With `enable_agg_state=true`, supported expressions such as 
`sum_finalize(any_value_merge(any_value_state(sum_state(cast(1 as int)))))` 
have an inner AGG_STATE as the outer state's result, because AnyValue returns 
its argument type. Taking only `getTypes()` discards that inner descriptor's 
`function_name`, `sub_types` and result metadata. Both new BE result readers 
decode this flat SCALAR/AGG_STATE through 
`create_data_type(vector<TTypeNode>)`, which reaches the primitive-type 
exception: `Nested type should not reach here AGG_STATE`. Before this change 
the outer function used its complete first argument type. Preserve the full 
recursive result descriptor, including the corresponding Protobuf path, and add 
a nested-state round-trip/query regression.



-- 
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]

Reply via email to