james-willis opened a new pull request, #1099:
URL: https://github.com/apache/sedona-db/pull/1099
## Summary
- Adds `RS_Min_Agg` / `RS_Max_Agg`, native Rust aggregate UDFs computing the
pixel-wise min/max raster across a group of rasters.
- One generic `SedonaAccumulator`/`Accumulator` pair
(`RasterMinMaxAgg`/`MinMaxAccumulator`), parametrized by a
`MinMaxOp::{Min,Max}` comparator, to avoid duplicating logic between the two
functions.
- Nodata-aware: a pixel equal to a band's nodata sentinel is treated as
absent rather than a comparable value — the other raster's value wins outright,
and a pixel that's nodata in every raster in the group stays nodata.
- State is the output raster type itself (min/max combine is associative and
idempotent, so the running combined raster is valid partial state), which lets
`update_batch` and `merge_batch` share one implementation.
- Validates that every raster combined within a group shares band count,
dimension names, shape, data type, and nodata value, returning a clean
execution error (not a panic) on mismatch.
- Registered in `sedona-raster-functions`'s aggregate UDF set; docs added at
`docs/reference/sql/rs_min_agg.qmd` and `rs_max_agg.qmd`.
**v1 scope**, called out in the code:
- Plain `Accumulator` only — no `GroupsAccumulator` yet (DataFusion falls
back to one accumulator per group, which is correct but not the fastest path
for many small groups).
- Single raster argument.
- Requires bands to be contiguous (uses `NdBuffer::as_contiguous`);
non-contiguous inputs should go through `RS_EnsureContiguous` first.
This is the first of a small family of raster statistics aggregates
(mean/sum/std/var/median tracked separately); min/max are the easiest to make
exactly and cheaply distributable.
## Test plan
- [x] `cargo test -p sedona-raster-functions` — 261 passed (7 new: basic
min/max, nodata skip, cross-batch state merge, null-batch, mismatched-shape
error), no regressions
- [x] `cargo build -p sedona-raster-functions`
- [x] `cargo fmt -p sedona-raster-functions`
- [x] `cargo clippy -p sedona-raster-functions --all-targets` — clean
--
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]