Skip to content

feat(vortex-geo): add MultiPolygon extension type + WKB export for native geometry#8608

Merged
HarukiMoriarty merged 9 commits into
developfrom
nemo/geo-multipolygin
Jul 2, 2026
Merged

feat(vortex-geo): add MultiPolygon extension type + WKB export for native geometry#8608
HarukiMoriarty merged 9 commits into
developfrom
nemo/geo-multipolygin

Conversation

@HarukiMoriarty

Copy link
Copy Markdown
Contributor

Summary

Adds a native MultiPolygon geometry extension type to vortex-geo, and a WKB-export helper (to_wkb) for the native geometry types (Point, Polygon, MultiPolygon).

MultiPolygon (vortex.geo.multipolygon) mirrors the existing Polygon type, mainly for SpatialBench z_boundary column, which is mixture of Polygon and MultiPolygon.

to_wkb serializes a native geometry array to WKB (via geoarrow-cast), the form DuckDB's GEOMETRY vectors carry, for communicate with DuckDB.

What APIs are changed? Are there any user-facing changes?

Purely additive, new public API in vortex-geo:

  • extension::MultiPolygon, the new extension type (with its ExtVTable + Arrow import/export).
  • extension::{PointData, PolygonData} + to_wkb on the existing Point/Polygon types.

@HarukiMoriarty HarukiMoriarty added the changelog/feature A new feature label Jun 26, 2026
@codspeed-hq

codspeed-hq Bot commented Jun 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 2 improved benchmarks
❌ 1 regressed benchmark
✅ 1592 untouched benchmarks
⏩ 4 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_bool_canonical_into[(1000, 10)] 22.6 µs 26.7 µs -15.64%
WallTime cuda/bitpacked_u8/unpack/3bw[100M] 350.8 µs 300.6 µs +16.67%
Simulation bitwise_not_vortex_buffer_mut[128] 273.6 ns 244.4 ns +11.93%

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-multipolygin (195833e) with develop (a21bf76)

Open in CodSpeed

Footnotes

  1. 4 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>
@HarukiMoriarty HarukiMoriarty force-pushed the nemo/spatial-wire-vx-bench branch from fdb0872 to b362551 Compare June 30, 2026 21:10
HarukiMoriarty and others added 5 commits July 1, 2026 10:09
DuckDB's GEOMETRY only accepts little-endian (NDR) WKB, but the externally
sourced zone table (Overture Maps via spatialbench-cli) is big-endian, so the
vortex lane failed spatial queries with "Only little-endian WKB is supported".
Re-encode geometry columns to little-endian during the parquet->vortex
conversion so the vortex file stores canonical little-endian WKB; columns that
are already little-endian pass through without a copy.

Also drop the best-effort warn around zone generation so data-generation
failures propagate.

Signed-off-by: Nemo Yu <zyu379@wisc.edu>
The zone table's data generation hand-rolled idempotency: an existence check
plus a scratch dir cleared with remove_dir_all to survive interrupted runs.
Reuse the shared idempotent_async helper instead, which skips when
zone_0.parquet exists and writes via a unique temp path + atomic rename, so
interrupted runs leave nothing to clean up. Zone is a single part (the CLI runs
without --parts), so it is handled as one file.

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 force-pushed the nemo/geo-multipolygin branch from a3c046b to 790a0d7 Compare July 1, 2026 15:28
`ExtVTable::id` interned the id with `ExtId::new_static` on every call,
tripping the `disallowed_methods` clippy lint added on the base branch
(#8617) since it grabs the interner lock per call. Match the `Point` and
`Polygon` types by caching the id in a `static CachedId`.

Signed-off-by: Nemo Yu <zyu379@wisc.edu>
The `to_wkb` methods on `PointData`, `PolygonData`, and `MultiPolygonData`
were byte-identical except for the geometry array type. Hoist the WKB cast
into a single `geoarrow_to_wkb(&dyn GeoArrowArray)` in the extension module
so each `to_wkb` is a one-liner, drop the redundant `storage_array().clone()`
(the `*_array` helpers take `&ArrayRef`), and remove the now-unused
`GeoArrowType`/`WkbType`/`cast`/`GeoArrowArray` imports from the three types.

Signed-off-by: Nemo Yu <zyu379@wisc.edu>

@danking danking left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems broadly correct to me.

Base automatically changed from nemo/spatial-wire-vx-bench to develop July 2, 2026 10:41
@robert3005 robert3005 requested a review from a team July 2, 2026 10:41
@HarukiMoriarty HarukiMoriarty enabled auto-merge (squash) July 2, 2026 14:08
@HarukiMoriarty HarukiMoriarty merged commit 574326f into develop Jul 2, 2026
80 of 83 checks passed
@HarukiMoriarty HarukiMoriarty deleted the nemo/geo-multipolygin branch July 2, 2026 14:24
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.

2 participants