Skip to content

Commit f876920

Browse files
committed
what about this
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent 37ab9bd commit f876920

4 files changed

Lines changed: 4 additions & 29 deletions

File tree

encodings/runend/public-api.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ pub fn vortex_runend::RunEnd::nbuffers(_array: &vortex_runend::RunEndArray) -> u
8888

8989
pub fn vortex_runend::RunEnd::nchildren(_array: &vortex_runend::RunEndArray) -> usize
9090

91-
pub fn vortex_runend::RunEnd::preferred_arrow_data_type(array: &vortex_runend::RunEndArray) -> core::option::Option<arrow_schema::datatype::DataType>
92-
9391
pub fn vortex_runend::RunEnd::reduce_parent(array: &Self::Array, parent: &vortex_array::array::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::ArrayRef>>
9492

9593
pub fn vortex_runend::RunEnd::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>

encodings/runend/src/array.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use arrow_array::cast::AsArray;
1111
use arrow_array::types::*;
1212
use arrow_buffer::ArrowNativeType;
1313
use arrow_schema::DataType;
14-
use arrow_schema::Field;
1514
use vortex_array::ArrayEq;
1615
use vortex_array::ArrayHash;
1716
use vortex_array::ArrayRef;
@@ -212,16 +211,6 @@ impl VTable for RunEnd {
212211
PARENT_KERNELS.execute(array, parent, child_idx, ctx)
213212
}
214213

215-
fn preferred_arrow_data_type(array: &RunEndArray) -> Option<DataType> {
216-
let ends_dt = array.ends().dtype().to_arrow_dtype().ok()?;
217-
let values_dt = array.values().dtype().to_arrow_dtype().ok()?;
218-
let values_nullable = array.values().dtype().is_nullable();
219-
Some(DataType::RunEndEncoded(
220-
Arc::new(Field::new("run_ends", ends_dt, false)),
221-
Arc::new(Field::new("values", values_dt, values_nullable)),
222-
))
223-
}
224-
225214
fn to_arrow_array(
226215
array: &RunEndArray,
227216
data_type: &DataType,

vortex-array/public-api.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::arrays:
17341734

17351735
pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize
17361736

1737-
pub fn vortex_array::arrays::dict::Dict::preferred_arrow_data_type(array: &vortex_array::arrays::dict::DictArray) -> core::option::Option<arrow_schema::datatype::DataType>
1737+
pub fn vortex_array::arrays::dict::Dict::preferred_arrow_data_type(_array: &Self::Array) -> core::option::Option<arrow_schema::datatype::DataType>
17381738

17391739
pub fn vortex_array::arrays::dict::Dict::reduce(array: &Self::Array) -> vortex_error::VortexResult<core::option::Option<vortex_array::ArrayRef>>
17401740

@@ -1842,7 +1842,7 @@ pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::arrays:
18421842

18431843
pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize
18441844

1845-
pub fn vortex_array::arrays::dict::Dict::preferred_arrow_data_type(array: &vortex_array::arrays::dict::DictArray) -> core::option::Option<arrow_schema::datatype::DataType>
1845+
pub fn vortex_array::arrays::dict::Dict::preferred_arrow_data_type(_array: &Self::Array) -> core::option::Option<arrow_schema::datatype::DataType>
18461846

18471847
pub fn vortex_array::arrays::dict::Dict::reduce(array: &Self::Array) -> vortex_error::VortexResult<core::option::Option<vortex_array::ArrayRef>>
18481848

@@ -5788,7 +5788,7 @@ pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::arrays:
57885788

57895789
pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize
57905790

5791-
pub fn vortex_array::arrays::dict::Dict::preferred_arrow_data_type(array: &vortex_array::arrays::dict::DictArray) -> core::option::Option<arrow_schema::datatype::DataType>
5791+
pub fn vortex_array::arrays::dict::Dict::preferred_arrow_data_type(_array: &Self::Array) -> core::option::Option<arrow_schema::datatype::DataType>
57925792

57935793
pub fn vortex_array::arrays::dict::Dict::reduce(array: &Self::Array) -> vortex_error::VortexResult<core::option::Option<vortex_array::ArrayRef>>
57945794

@@ -21750,7 +21750,7 @@ pub fn vortex_array::arrays::dict::Dict::nbuffers(_array: &vortex_array::arrays:
2175021750

2175121751
pub fn vortex_array::arrays::dict::Dict::nchildren(_array: &vortex_array::arrays::dict::DictArray) -> usize
2175221752

21753-
pub fn vortex_array::arrays::dict::Dict::preferred_arrow_data_type(array: &vortex_array::arrays::dict::DictArray) -> core::option::Option<arrow_schema::datatype::DataType>
21753+
pub fn vortex_array::arrays::dict::Dict::preferred_arrow_data_type(_array: &Self::Array) -> core::option::Option<arrow_schema::datatype::DataType>
2175421754

2175521755
pub fn vortex_array::arrays::dict::Dict::reduce(array: &Self::Array) -> vortex_error::VortexResult<core::option::Option<vortex_array::ArrayRef>>
2175621756

vortex-array/src/arrays/dict/vtable/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ use crate::arrays::ConstantArray;
2828
use crate::arrays::dict::compute::rules::PARENT_RULES;
2929
use crate::arrow::ArrowArrayExecutor;
3030
use crate::arrow::executor::dictionary::make_dict_array;
31-
use crate::arrow::executor::preferred_arrow_type;
3231
use crate::buffer::BufferHandle;
3332
use crate::dtype::DType;
3433
use crate::dtype::Nullability;
@@ -196,17 +195,6 @@ impl VTable for Dict {
196195
Ok(())
197196
}
198197

199-
fn preferred_arrow_data_type(array: &DictArray) -> Option<DataType> {
200-
let codes_dt = array.codes().dtype().to_arrow_dtype().ok()?;
201-
let values_dt = preferred_arrow_type(array.values())
202-
.or_else(|_| array.values().dtype().to_arrow_dtype())
203-
.ok()?;
204-
Some(DataType::Dictionary(
205-
Box::new(codes_dt),
206-
Box::new(values_dt),
207-
))
208-
}
209-
210198
fn to_arrow_array(
211199
array: &DictArray,
212200
data_type: &DataType,

0 commit comments

Comments
 (0)