Skip to content

GH-3585: Fix DataPageHeaderV2.num_nulls=-1 when column statistics are disabled#3586

Merged
wgtmac merged 1 commit into
apache:masterfrom
keuin:master
Jun 24, 2026
Merged

GH-3585: Fix DataPageHeaderV2.num_nulls=-1 when column statistics are disabled#3586
wgtmac merged 1 commit into
apache:masterfrom
keuin:master

Conversation

@keuin

@keuin keuin commented May 25, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Fix the num_nulls field in DataPageHeaderV2, which will be unexpectedly set to -1 when statistics is disabled.

What changes are included in this PR?

Add a counter tracker in ColumnValueCollector, which is always enabled, to track required field num_nulls.

Are these changes tested?

Yes, tested. The test will fail before this fix, and will succeed with this fix.

Are there any user-facing changes?

No user-facing or API changes.

Closes #3585

Comment thread parquet-column/src/main/java/org/apache/parquet/column/impl/ColumnWriterBase.java Outdated
Comment thread parquet-hadoop/src/test/java/org/apache/parquet/hadoop/TestParquetWriter.java Outdated
@wgtmac

wgtmac commented May 29, 2026

Copy link
Copy Markdown
Member

Thank you, @keuin!

@wgtmac
wgtmac merged commit b8b86e0 into apache:master Jun 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataPageHeaderV2.num_nulls=-1 when column statistics are disabled

2 participants