paleolimbot commented on code in PR #467:
URL: https://github.com/apache/sedona-db/pull/467#discussion_r2638573658
##########
rust/sedona-functions/src/st_collect_agg.rs:
##########
@@ -70,8 +70,14 @@ struct STCollectAggr {}
impl SedonaAccumulator for STCollectAggr {
fn return_type(&self, args: &[SedonaType]) -> Result<Option<SedonaType>> {
- let matcher =
ArgMatcher::new(vec![ArgMatcher::is_geometry_or_geography()], WKB_GEOMETRY);
- matcher.match_args(args)
+ let geom_matcher = ArgMatcher::new(vec![ArgMatcher::is_geometry()],
WKB_GEOMETRY);
+ let geog_matcher = ArgMatcher::new(vec![ArgMatcher::is_geography()],
WKB_GEOGRAPHY);
+ for matcher in [geom_matcher, geog_matcher] {
+ if let result @ Ok(Some(_)) = matcher.match_args(args) {
+ return result;
+ }
+ }
+ Ok(None)
Review Comment:
This is very similar to what the `SedonaAggregateUDF` does when resolving
the `SedonaAccumulator` based on the input arguments.
--
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]