From 80e0e92cb6914c02f9dadd9b8dbdd24b34ee190e Mon Sep 17 00:00:00 2001 From: lewiszlw Date: Wed, 27 Mar 2024 02:53:37 +0000 Subject: [PATCH] Fix build --- src/function/split.rs | 7 ++++--- src/geo/builder.rs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/function/split.rs b/src/function/split.rs index 91032b2..582448a 100644 --- a/src/function/split.rs +++ b/src/function/split.rs @@ -1,12 +1,13 @@ use crate::geo::{GeometryArray, GeometryArrayBuilder}; use crate::DFResult; use arrow_array::cast::AsArray; -use arrow_array::{BooleanArray, GenericBinaryArray, OffsetSizeTrait}; +use arrow_array::{GenericBinaryArray, OffsetSizeTrait}; use arrow_schema::DataType; -use datafusion_common::{internal_datafusion_err, internal_err}; +use datafusion_common::{internal_datafusion_err, internal_err, DataFusionError}; use datafusion_expr::{ColumnarValue, ScalarUDFImpl, Signature, Volatility}; use geos::Geom; use rayon::iter::IntoParallelIterator; +use rayon::prelude::*; use std::any::Any; use std::sync::Arc; @@ -124,7 +125,7 @@ fn split( }, ) .collect::>>>()?; - let builder = GeometryArrayBuilder::::from(&geom_vec); + let builder = GeometryArrayBuilder::::from(geom_vec.as_slice()); Ok(ColumnarValue::Array(Arc::new(builder.build()))) } diff --git a/src/geo/builder.rs b/src/geo/builder.rs index f8a5156..4b3c795 100644 --- a/src/geo/builder.rs +++ b/src/geo/builder.rs @@ -192,7 +192,7 @@ impl From<&[Option]> for GeometryAr } #[cfg(feature = "geos")] -impl From<&[Option]> for GeometryArrayBuilder { +impl From<&[Option>]> for GeometryArrayBuilder { fn from(value: &[Option]) -> Self { let mut builder = GeometryArrayBuilder::::new(WkbDialect::Ewkb, value.len()); for geom in value {