Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove null_count from write_batch_with_statistics #2047

Merged
merged 2 commits into from Jul 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 2 additions & 11 deletions parquet/src/column/writer.rs
Expand Up @@ -292,7 +292,6 @@ impl<'a, T: DataType> ColumnWriterImpl<'a, T> {
rep_levels: Option<&[i16]>,
min: Option<&T::T>,
max: Option<&T::T>,
null_count: Option<u64>,
distinct_count: Option<u64>,
) -> Result<usize> {
// We check for DataPage limits only after we have inserted the values. If a user
Expand Down Expand Up @@ -346,10 +345,6 @@ impl<'a, T: DataType> ColumnWriterImpl<'a, T> {
self.column_distinct_count = None;
}

if let Some(nulls) = null_count {
self.num_column_nulls += nulls;
}

let mut values_offset = 0;
let mut levels_offset = 0;
for _ in 0..num_batches {
Expand Down Expand Up @@ -389,7 +384,7 @@ impl<'a, T: DataType> ColumnWriterImpl<'a, T> {
def_levels: Option<&[i16]>,
rep_levels: Option<&[i16]>,
) -> Result<usize> {
self.write_batch_internal(values, def_levels, rep_levels, None, None, None, None)
self.write_batch_internal(values, def_levels, rep_levels, None, None, None)
}

/// Writer may optionally provide pre-calculated statistics for use when computing
Expand All @@ -406,7 +401,6 @@ impl<'a, T: DataType> ColumnWriterImpl<'a, T> {
rep_levels: Option<&[i16]>,
min: Option<&T::T>,
max: Option<&T::T>,
nulls_count: Option<u64>,
distinct_count: Option<u64>,
) -> Result<usize> {
self.write_batch_internal(
Expand All @@ -415,7 +409,6 @@ impl<'a, T: DataType> ColumnWriterImpl<'a, T> {
rep_levels,
min,
max,
nulls_count,
distinct_count,
)
}
Expand Down Expand Up @@ -1726,7 +1719,6 @@ mod tests {
None,
Some(&-17),
Some(&9000),
Some(21),
Some(55),
)
.unwrap();
Expand All @@ -1745,7 +1737,7 @@ mod tests {
assert_eq!(metadata.dictionary_page_offset(), Some(0));
if let Some(stats) = metadata.statistics() {
assert!(stats.has_min_max_set());
assert_eq!(stats.null_count(), 21);
assert_eq!(stats.null_count(), 0);
assert_eq!(stats.distinct_count().unwrap_or(0), 55);
if let Statistics::Int32(stats) = stats {
assert_eq!(stats.min(), &-17);
Expand Down Expand Up @@ -1774,7 +1766,6 @@ mod tests {
None,
Some(&5),
Some(&7),
Some(0),
Some(3),
)
.unwrap();
Expand Down