diff --git a/read_buffer/src/column.rs b/read_buffer/src/column.rs index 84ef05ac9e..4dc6195690 100644 --- a/read_buffer/src/column.rs +++ b/read_buffer/src/column.rs @@ -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> 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)), diff --git a/read_buffer/src/row_group.rs b/read_buffer/src/row_group.rs index 52e2c7134d..47312a6444 100644 --- a/read_buffer/src/row_group.rs +++ b/read_buffer/src/row_group.rs @@ -1112,7 +1112,7 @@ impl ReadFilterResult<'_> { let columns = self .data .into_iter() - .map(|values| values.take_arrow_array()) + .map(arrow::array::ArrayRef::from) .collect::>(); // try_new only returns an error if the schema is invalid or the number