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

Commit

Permalink
Improved performance of writing decimal to parquet (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
koneko096 authored Oct 15, 2021
1 parent 47a632c commit fb8b6f3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/io/parquet/write/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,7 @@ pub fn array_to_page(
primitive::array_to_page::<i64, i64>(&array, options, descriptor)
} else {
let size = decimal_length_from_precision(precision);

let mut values = MutableBuffer::<u8>::new(); // todo: this can be estimated

let mut values = MutableBuffer::<u8>::with_capacity(size * array.len());
array.values().iter().for_each(|x| {
let bytes = &x.to_be_bytes()[16 - size..];
values.extend_from_slice(bytes)
Expand Down

0 comments on commit fb8b6f3

Please sign in to comment.