Open kylebarron opened 1 year ago
Do you mean this?
pub trait IntoArrow {
type ArrowArray;
fn into_arrow(self) -> Self::ArrowArray;
}
pub trait GeometryArrayTrait: IntoArrow {
fn into_array_ref(self) -> ArrayRef;
}
This will lead GeometryArrayTrait can't be used in Arc<dyn GeometryArrayTrait>
Yes and no, the first trait should exist but not be required by GeometryArrayTrait
.
Is it reasonable that moving into_array_ref
method from GeometryArrayTrait
to IntoArrow
trait?
I think we should keep anything on GeometryArrayTrait
that has high general functionality while still allowing the trait to be object safe. Therefore, I feel strongly that into_array_ref
should exist on GeometryArrayTrait
. If it were possible for into_arrow
to live there too, that would be great, but I think the benefits of being object safe are pretty high
In https://github.com/geoarrow/geoarrow-rs/pull/237 we removed
to_arrow
fromGeometryArrayTrait
to remove the associated type. But it can be annoying to convert from, say, aLineStringArray
to anArc<dyn Array>
just to have to downcast back to aGenericListArray
. It would be nice to haveToArrow
as a separate trait.If
GeometryArrayTrait
depends onToArrow
, theninto_array_ref
can in most cases use a blanket implementation ofArc::new(self.to_arrow())
I think