Skip to content

feat(vortex-spatial): add collect scalar function - #9218

Open
HarukiMoriarty wants to merge 5 commits into
nemo/geo-areafrom
nemo/geo-collect
Open

feat(vortex-spatial): add collect scalar function#9218
HarukiMoriarty wants to merge 5 commits into
nemo/geo-areafrom
nemo/geo-collect

Conversation

@HarukiMoriarty

@HarukiMoriarty HarukiMoriarty commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add strict homogeneous ST_Collect overloads for lists of Point, LineString, and Polygon
  • return the corresponding native MultiPoint, MultiLineString, or MultiPolygon type
  • use shared unary dispatch for constant handling and strict outer-null propagation
  • reuse geometry storage on the all-valid path and compact only nullable inner elements
  • add focused tests and a dedicated microbenchmark

@HarukiMoriarty HarukiMoriarty added the changelog/feature A new feature label Aug 5, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 5, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 45.6%

❌ 1 regressed benchmark
✅ 1943 untouched benchmarks
🆕 5 new benchmarks
⏩ 85 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation decompress[u64, (1000, 16)] 72.6 µs 133.4 µs -45.6%
🆕 Simulation linestrings N/A 211.3 µs N/A
🆕 Simulation nullable_points N/A 396.6 µs N/A
🆕 Simulation points N/A 208.2 µs N/A
🆕 Simulation polygons N/A 211.9 µs N/A
🆕 Simulation envelope_of_collected_points N/A 559.4 µs N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing nemo/geo-collect (1f9f067) with nemo/geo-area (2980eb4)

Open in CodSpeed

Footnotes

  1. 85 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Signed-off-by: Nemo Yu <zyu379@wisc.edu>
Signed-off-by: Nemo Yu <zyu379@wisc.edu>
Signed-off-by: Nemo Yu <zyu379@wisc.edu>
@HarukiMoriarty HarukiMoriarty changed the title feat(vortex-geo): add collect scalar function feat(vortex-spatial): add collect scalar function Aug 7, 2026
Return `ExtDTypeRef` from `collect_dtype` so `execute` stops unwrapping the
extension back out of a `DType` and no longer carries two names for one value,
matching how `convex_hull_dtype` resolves its output.

Fold the two element-type rejections into one match so the "not a native Point,
LineString, or Polygon" message has a single source, and take the output
nullability from the `Execution` the dispatcher already populated instead of
re-deriving it from the output dtype.

Signed-off-by: Nemo Yu <zyu379@wisc.edu>
`ListViewArray::try_new` always reports `is_zero_copy_to_list` as false, so the
list view collect handed back forgot that its views are still exact. The next
`list_from_list_view` then re-gathered the entire geometry payload that the
all-valid path had just reused, moving the copy one operator later instead of
avoiding it.

Forward the input's flag instead. The reuse path passes `offsets` and `sizes`
through untouched, and the compaction path rebuilds them as a running sum over
the same element order, so the zero-copy invariant holds on both; `validate_zctl`
checks it under debug assertions.

`ST_Envelope(ST_Collect(points))` over 512 rows of 8 points improves from
10.54us to 8.42us fastest and 10.72us to 8.54us median. The existing cases
cannot observe this because `Canonical`'s list form is itself a `ListViewArray`,
so add one that composes collect with a consumer converting to a `ListArray`.

Signed-off-by: Nemo Yu <zyu379@wisc.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant