Skip to content

Commit 4b0b39c

Browse files
authored
Fix arrow conversion (#5769)
Signed-off-by: Nicholas Gates <[email protected]>
1 parent 7e59dfb commit 4b0b39c

File tree

1 file changed

+6
-4
lines changed
  • vortex-array/src/arrow/compute/to_arrow

1 file changed

+6
-4
lines changed

vortex-array/src/arrow/compute/to_arrow/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use std::sync::LazyLock;
1212
use arcref::ArcRef;
1313
use arrow_array::ArrayRef as ArrowArrayRef;
1414
use arrow_schema::DataType;
15-
use vortex_compute::arrow::IntoArrow;
1615
use vortex_dtype::DType;
1716
use vortex_dtype::arrow::FromArrowType;
1817
use vortex_error::VortexError;
@@ -24,7 +23,7 @@ use vortex_error::vortex_err;
2423
use crate::Array;
2524
use crate::LEGACY_SESSION;
2625
use crate::USE_VORTEX_OPERATORS;
27-
use crate::VectorExecutor;
26+
use crate::arrow::ArrowArrayExecutor;
2827
use crate::arrow::array::ArrowArray;
2928
use crate::arrow::array::ArrowVTable;
3029
use crate::compute::ComputeFn;
@@ -130,10 +129,13 @@ impl ComputeFnVTable for ToArrow {
130129

131130
if !array.is_canonical() {
132131
let arrow_array = if *USE_VORTEX_OPERATORS {
132+
let arrow_type = arrow_type
133+
.cloned()
134+
.map(Ok)
135+
.unwrap_or_else(|| array.dtype().to_arrow_dtype())?;
133136
array
134137
.to_array()
135-
.execute_vector(&LEGACY_SESSION)?
136-
.into_arrow()?
138+
.execute_arrow(&arrow_type, &LEGACY_SESSION)?
137139
} else {
138140
// Fall back to canonicalizing and then converting.
139141
let canonical_array = array.to_canonical();

0 commit comments

Comments
 (0)