refactor: implement From<ArrayRef>
parent
9eef7b4d7f
commit
9ec0ae26e1
|
@ -2727,10 +2727,12 @@ impl<'a> Values<'a> {
|
|||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Moves ownership of self into an Arrow array.
|
||||
pub fn take_arrow_array(self) -> array::ArrayRef {
|
||||
match self {
|
||||
/// Moves ownership of Values into an arrow `ArrayRef`.
|
||||
impl From<Values<'_>> for array::ArrayRef {
|
||||
fn from(values: Values<'_>) -> Self {
|
||||
match values {
|
||||
Values::String(values) => Arc::new(arrow::array::StringArray::from(values)),
|
||||
Values::I64(values) => Arc::new(arrow::array::Int64Array::from(values)),
|
||||
Values::U64(values) => Arc::new(arrow::array::UInt64Array::from(values)),
|
||||
|
|
|
@ -1112,7 +1112,7 @@ impl ReadFilterResult<'_> {
|
|||
let columns = self
|
||||
.data
|
||||
.into_iter()
|
||||
.map(|values| values.take_arrow_array())
|
||||
.map(arrow::array::ArrayRef::from)
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// try_new only returns an error if the schema is invalid or the number
|
||||
|
|
Loading…
Reference in New Issue