Skip to content

Commit

Permalink
fix rustfmt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yordan-pavlov committed Jun 9, 2021
1 parent 9ebf874 commit d5173db
Show file tree
Hide file tree
Showing 8 changed files with 869 additions and 415 deletions.
8 changes: 4 additions & 4 deletions arrow/src/array/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::mem;

use super::{
data::{into_buffers, new_buffers},
ArrayData, ArrayDataBuilder
ArrayData, ArrayDataBuilder,
};
use crate::array::StringOffsetSizeTrait;

Expand Down Expand Up @@ -84,7 +84,8 @@ impl<'a> _MutableArrayData<'a> {
.buffers(buffers)
.child_data(child_data);
if self.null_count > 0 {
array_data_builder = array_data_builder.null_bit_buffer(self.null_buffer.into());
array_data_builder =
array_data_builder.null_bit_buffer(self.null_buffer.into());
}

array_data_builder
Expand Down Expand Up @@ -554,8 +555,7 @@ impl<'a> MutableArrayData<'a> {
let null_buffer = if use_nulls {
let null_bytes = bit_util::ceil(array_capacity, 8);
MutableBuffer::from_len_zeroed(null_bytes)
}
else {
} else {
// create 0 capacity mutable buffer with the intention that it won't be used
MutableBuffer::with_capacity(0)
};
Expand Down
585 changes: 432 additions & 153 deletions parquet/benches/arrow_array_reader.rs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion parquet/src/arrow/array_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,9 @@ impl<'a> ArrayReaderBuilder {
arrow_type,
)?))
} else {
use crate::arrow::arrow_array_reader::{StringArrayConverter, ArrowArrayReader};
use crate::arrow::arrow_array_reader::{
ArrowArrayReader, StringArrayConverter,
};
let converter = StringArrayConverter::new();
Ok(Box::new(ArrowArrayReader::try_new(
*page_iterator,
Expand Down
673 changes: 422 additions & 251 deletions parquet/src/arrow/arrow_array_reader.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion parquet/src/arrow/record_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ mod tests {

impl Iterator for TestPageReader {
type Item = Result<Page>;

fn next(&mut self) -> Option<Self::Item> {
self.get_next_page().transpose()
}
Expand Down
2 changes: 1 addition & 1 deletion parquet/src/column/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ mod tests {

impl Iterator for TestPageReader {
type Item = Result<Page>;

fn next(&mut self) -> Option<Self::Item> {
self.get_next_page().transpose()
}
Expand Down
4 changes: 3 additions & 1 deletion parquet/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ mod bit_packing;
pub mod cursor;
pub mod hash_util;
pub(crate) mod test_common;
pub use self::test_common::page_util::{InMemoryPageIterator, DataPageBuilderImpl, DataPageBuilder};
pub use self::test_common::page_util::{
DataPageBuilder, DataPageBuilderImpl, InMemoryPageIterator,
};
6 changes: 3 additions & 3 deletions parquet/src/util/test_common/page_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ impl<I: Iterator<Item = Vec<Page>>> Iterator for InMemoryPageIterator<I> {
type Item = Result<Box<dyn PageReader>>;

fn next(&mut self) -> Option<Self::Item> {
self.page_reader_iter.next().map(
|x| Ok(Box::new(InMemoryPageReader::new(x)) as Box<dyn PageReader>)
)
self.page_reader_iter
.next()
.map(|x| Ok(Box::new(InMemoryPageReader::new(x)) as Box<dyn PageReader>))
}
}

Expand Down

0 comments on commit d5173db

Please sign in to comment.