Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangb committed Aug 28, 2024
1 parent 308d28b commit 00d4a3e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
4 changes: 2 additions & 2 deletions parquet/src/column/writer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,8 @@ impl<'a, E: ColumnValueEncoder> GenericColumnWriter<'a, E> {
if null_page && self.column_index_builder.valid() {
self.column_index_builder.append(
null_page,
vec![0; 1],
vec![0; 1],
vec![],
vec![],
self.page_metrics.num_page_nulls as i64,
);
} else if self.column_index_builder.valid() {
Expand Down
46 changes: 28 additions & 18 deletions parquet/src/file/metadata/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,32 +456,42 @@ mod tests {
// so that these "groupings" make sense
let a: ArrayRef = Arc::new(Int32Array::from(vec![
// a row group that has all values
Some(i32::MIN), Some(-1),
Some(1), Some(i32::MAX),
Some(i32::MIN),
Some(-1),
Some(1),
Some(i32::MAX),
// a row group with a page of all nulls and a page of all values
None, None,
Some(2), Some(3),
None,
None,
Some(2),
Some(3),
// a row group that has all null pages
None, None,
None, None,
None,
None,
None,
None,
// a row group having 1 page with all values and 1 page with some nulls
Some(4), Some(5),
None, Some(6),
Some(4),
Some(5),
None,
Some(6),
// a row group having 1 page with all nulls and 1 page with some nulls
None, None,
Some(7), None,
None,
None,
Some(7),
None,
// a row group having all pages with some nulls
None, Some(8),
Some(9), None,
None,
Some(8),
Some(9),
None,
]));

let batch = RecordBatch::try_from_iter(vec![("a", a)]).unwrap();

let writer_props_builder = match write_page_index {
true => WriterProperties::builder()
.set_statistics_enabled(EnabledStatistics::Page),
false => WriterProperties::builder()
.set_statistics_enabled(EnabledStatistics::Chunk),
true => WriterProperties::builder().set_statistics_enabled(EnabledStatistics::Page),
false => WriterProperties::builder().set_statistics_enabled(EnabledStatistics::Chunk),
};

// tune the size or pages to the data above
Expand Down Expand Up @@ -583,8 +593,8 @@ mod tests {
assert_eq!(left.compressed_size(), right.compressed_size());
assert_eq!(left.data_page_offset(), right.data_page_offset());
assert_eq!(left.statistics(), right.statistics());
// assert_eq!(left.offset_index_length(), right.offset_index_length());
// assert_eq!(left.column_index_length(), right.column_index_length());
assert_eq!(left.offset_index_length(), right.offset_index_length());
assert_eq!(left.column_index_length(), right.column_index_length());
assert_eq!(
left.unencoded_byte_array_data_bytes(),
right.unencoded_byte_array_data_bytes()
Expand Down

0 comments on commit 00d4a3e

Please sign in to comment.