feat(vortex-geo): Arrow import/export for the native Point type#8374
Conversation
Merging this PR will not alter performance
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | varbinview_large |
112.9 µs | 131.5 µs | -14.19% |
| ❌ | Simulation | decompress_rd[f64, (100000, 0.01)] |
845.9 µs | 981.6 µs | -13.83% |
| ❌ | Simulation | decompress_rd[f64, (100000, 0.1)] |
845.9 µs | 981.6 µs | -13.82% |
| ❌ | Simulation | encode_varbin[(1000, 2)] |
157.5 µs | 176.8 µs | -10.92% |
| ⚡ | Simulation | decompress_rd[f64, (100000, 0.0)] |
1,024.6 µs | 845.9 µs | +21.12% |
| ⚡ | Simulation | decompress_rd[f32, (100000, 0.0)] |
586.8 µs | 499.3 µs | +17.51% |
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-point-arrow (f7321a0) with develop (46e7253)
Footnotes
-
10 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. ↩
Register ArrowImportVTable/ArrowExportVTable for the Point extension type, mapping geoarrow.point fields (separated coordinates) to and from vortex.geo.point with the CRS carried through. Interleaved coordinates are rejected at field import. The CRS metadata conversion is shared with the WKB vtables, and the coordinate storage dtype now has a canonical constructor inverse to coordinate_dimension. Signed-off-by: Nemo Yu <zyu379@wisc.edu>
638d514 to
2654b3a
Compare
| let cases = [ | ||
| (Dimension::Xy, ["x", "y"].as_slice()), | ||
| (Dimension::Xyz, ["x", "y", "z"].as_slice()), | ||
| (Dimension::Xym, ["x", "y", "m"].as_slice()), | ||
| (Dimension::Xyzm, ["x", "y", "z", "m"].as_slice()), | ||
| ]; |
There was a problem hiding this comment.
nit: we have `rstest::cases` for this. just search for that in the repo and you'll see several examples. you might need to import rstest into this crate to use it
There was a problem hiding this comment.
Done, also applied to other places.
| if point_meta.coord_type() != CoordType::Separated { | ||
| vortex_bail!( | ||
| "geoarrow.point with interleaved coordinates is not supported; \ | ||
| re-encode with separated (struct) coordinates" | ||
| ); | ||
| } |
There was a problem hiding this comment.
there is a vortex_ensure!() macro which captures the if-not-vortex_bail flow
Parameterize the table-driven tests with rstest cases, collapse the three binary-family WKB export tests into one, and replace the if-then-vortex_bail flows with vortex_ensure!. Signed-off-by: Nemo Yu <zyu379@wisc.edu>
Summary
This PR adds support for import/export to Arrow for the
Pointextension type, as thegeoarrow.pointArrow extension with separated (struct) coordinates.Stacked on #8372.
Testing
Unit tests are added to exercise both code paths, plus a Vortex → Arrow → Vortex round-trip.