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


##########
be/src/exprs/aggregate/aggregate_function_min_max_impl.h:
##########
@@ -135,6 +135,9 @@ AggregateFunctionPtr 
create_aggregate_function_single_value(const String& name,
         return creator_without_type::create_unary_arguments<
                 
AggregateFunctionsSingleValue<Data<SingleValueDataFixed<TYPE_DECIMAL256>>>>(
                 argument_types, result_is_nullable, attr);
+    // Spatial states must own their WKB after the input block is released.
+    case PrimitiveType::TYPE_GEOMETRY:

Review Comment:
   [P2] Cover the remaining spatial aggregate factories
   
   The new cases cover only `create_aggregate_function_single_value`. Other 
aggregates still accept the new types through FE `ANY` signatures but have no 
corresponding BE dispatch. On an Iceberg table `t(id INT, geom GEOMETRY)`, 
these admitted queries fail during aggregate initialization/state creation:
   
   - `SELECT ST_AsText(min_by(geom,id)) FROM t` reaches `create_max_min_value` 
in `aggregate_function_min_max_by.cpp`, which throws `Illegal type Geometry`; 
`MAX_BY` and spatial ordering keys are affected too.
   - `SELECT COUNT(DISTINCT geom) OVER () FROM t` becomes 
`Window[multi_distinct_count(geom)] -> IcebergScan` in 
`DistinctWindowExpression`, but the `aggregate_function_uniq.cpp` creator omits 
both spatial types and returns no implementation.
   - `TOPN_ARRAY(geom,2)` likewise misses its separate creator list. 
`GROUP_ARRAY_UNION(shapes)` and `GROUP_ARRAY_INTERSECT(shapes)` on an imported 
`ARRAY<GEOMETRY>` miss the scalar/string-only group-array factory. Geography 
has the same failures.
   
   These are distinct factories from the previously reported MIN/MAX/ANY_VALUE 
and NDV/HISTOGRAM/COLLECT_SET paths, which this head repairs. Add spatial 
implementations for the supported operations, or reject their scalar/nested 
spatial arguments during FE analysis, including the generated analytic DISTINCT 
path. Cover both spatial kinds, nullable inputs, MIN/MAX_BY argument positions, 
and the window rewrite; the current aggregate tests do not exercise these 
factories.
   



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