Skip to content

Commit 42877b3

Browse files
fix(vortex-geo): cache MultiPolygon extension id via CachedId
`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>
1 parent 790a0d7 commit 42877b3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

vortex-geo/src/extension/multipolygon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ impl ExtVTable for MultiPolygon {
6767
type NativeValue<'a> = &'a ScalarValue;
6868

6969
fn id(&self) -> ExtId {
70-
ExtId::new_static("vortex.geo.multipolygon")
70+
static ID: CachedId = CachedId::new("vortex.geo.multipolygon");
71+
*ID
7172
}
7273

7374
fn serialize_metadata(&self, metadata: &Self::Metadata) -> VortexResult<Vec<u8>> {
@@ -238,7 +239,6 @@ impl ArrowExportVTable for MultiPolygon {
238239
.arrow()
239240
.execute_arrow(storage, Some(&storage_field), ctx)?;
240241

241-
// Round-trip through GeoArrow's multipolygon array; `into_arrow` is concrete, so wrap in `Arc`.
242242
let multipolygons =
243243
MultiPolygonArray::try_from((arrow_storage.as_ref(), multipolygon_meta))
244244
.map_err(|e| vortex_err!("failed to construct MultiPolygonArray: {e}"))?;

0 commit comments

Comments
 (0)