Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
parquet: Don't take ownership of Vec<Eccoding>
Browse files Browse the repository at this point in the history
array_to_columns could do with a slice as `Encoding`
is `Copy`
  • Loading branch information
ritchie46 committed Jun 29, 2022
1 parent f57dbd5 commit f383506
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/io/parquet/write/pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub fn array_to_columns<A: AsRef<dyn Array> + Send + Sync>(
array: A,
type_: ParquetType,
options: WriteOptions,
encoding: Vec<Encoding>,
encoding: &[Encoding],
) -> Result<Vec<DynIter<'static, Result<EncodedPage>>>> {
let array = array.as_ref();
let nested = to_nested(array, &type_)?;
Expand All @@ -213,9 +213,9 @@ pub fn array_to_columns<A: AsRef<dyn Array> + Send + Sync>(
.iter()
.zip(nested.into_iter())
.zip(types.into_iter())
.zip(encoding.into_iter())
.zip(encoding.iter())
.map(|(((values, nested), type_), encoding)| {
array_to_pages(*values, type_, nested, options, encoding)
array_to_pages(*values, type_, nested, options, *encoding)
})
.collect()
}
Expand Down
2 changes: 1 addition & 1 deletion src/io/parquet/write/row_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn row_group_iter<A: AsRef<dyn Array> + 'static + Send + Sync>(
.zip(fields.into_iter())
.zip(encodings.into_iter())
.flat_map(move |((array, type_), encoding)| {
let encoded_columns = array_to_columns(array, type_, options, encoding).unwrap();
let encoded_columns = array_to_columns(array, type_, options, &encoding).unwrap();
encoded_columns
.into_iter()
.map(|encoded_pages| {
Expand Down

0 comments on commit f383506

Please sign in to comment.