924060929 commented on code in PR #69032:
URL: https://github.com/apache/doris/pull/69032#discussion_r4398295847


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/CollectSet.java:
##########
@@ -114,6 +114,10 @@ public Expression resultForEmptyInput() {
     public void checkLegalityBeforeTypeCoercion() {
         // The BE set kernel cannot hash raw VARBINARY; reject it before 
implicit casts change its type.
         for (Expression argument : getArguments()) {
+            // Spatial values also lack a BE collect-set kernel, even when 
admitted by ANY.
+            if (argument.getDataType().isSpatialType()) {

Review Comment:
   [P2] Reject nested spatial inputs to COLLECT_SET
   
   This only checks the outermost type, so `SELECT collect_set(array(geom)) 
FROM iceberg_table` is admitted when `geom` is GEOMETRY (likewise GEOGRAPHY): 
the argument is ARRAY<GEOMETRY>, and the ANY signature accepts it. The BE 
collect factory cannot dispatch ARRAY and falls back to 
`do_create_agg_function_collect<INVALID_TYPE>`, whose distinct branch throws 
`unexpected type for collect`. Please use the existing recursive 
`toCatalogDataType().typeContainsSpatialType()` check here and add 
nested-input/state-combinator negative tests, so these queries fail during FE 
analysis instead of execution.



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