Skip to content

GH-112 Harden variant decoding: example data - #113

Merged
alamb merged 6 commits into
apache:masterfrom
steveloughran:pr/variant-hardening
Aug 12, 2026
Merged

GH-112 Harden variant decoding: example data#113
alamb merged 6 commits into
apache:masterfrom
steveloughran:pr/variant-hardening

Conversation

@steveloughran

@steveloughransteveloughran commented May 19, 2026

Copy link
Copy Markdown
Contributor

Add parquet files with malformed variant data.

This is generated from the tests of apache/parquet-java#3562 when configured to not delete output during test runs

Test files are added to parquet-format project with commentary.
@steveloughransteveloughran changed the title GH-112 Harden variant decodingGH-112 Harden variant decoding: example dataMay 21, 2026
Comment threadbad_data/README.md
Robust implementations of variant decoders SHOULD reject these.

| File | Malformed Structure |
|---------------------------------------------------------------|----------------------------------------------------------------------------|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to add the sample code that helped generate these individual cases in the README as well.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

until the relevant PR is merged, that code doesn't really exist, does it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed but those are in the tests of the Java repo. The data/README here has a snippet of the code that was used to generate the files. I'd prefer that be here rather than link to another repo. I'm okay reusing the same code but having it here is better for users to reproduce the artifacts. If you are planning to do that after the code merges, that's great.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is ok not to include reproducer of malformed data -- a link to the relevant PR (or perhaps a gist) would be enough

@nssaliannssalian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: removing the GH-112 from the title and instead adding closes <link to 112> in the PR description to be consistent with other PRs

@alambalamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me -- thank you @steveloughran@laskoviymishka and @nssalian

@steveloughran

Copy link
Copy Markdown
ContributorAuthor

Thanks @alamb...can someone with merge permissions merge this? The cross-project pr ref can go in the commit message.

@alamb
alamb merged commit e25b7b6 into apache:masterAug 12, 2026
@alamb

Copy link
Copy Markdown
Contributor

🚀

Jefffrey pushed a commit to apache/arrow-rs that referenced this pull request Sep 2, 2026
# Which issue does this PR close?
- Follow-up to #10786, which updated the `parquet-testing` revision.
- No tracking issue yet; one can be added if needed.
# Rationale for this change
The updated `parquet-testing` revision included:
-
[apache/parquet-testing#113](apache/parquet-testing#113):
malformed and edge-case Variant files.
-
[apache/parquet-testing#117](apache/parquet-testing#117):
mark four shredded Variant cases as invalid because they omit required
`value` columns.
-
[apache/parquet-testing#118](apache/parquet-testing#118):
JSON and BSON logical-type files.
-
[apache/parquet-testing#119](apache/parquet-testing#119):
an extended ALP fixture.
#10786 made these fixtures available to Arrow Rust, but did not exercise
the JSON, BSON, or malformed Variant files.
The same revision also added an extended ALP fixture. That fixture is
covered by the ALP encoder/decoder work in #9372, where the required
decoding support exists.
# What changes are included in this PR?
- Read the JSON logical-type fixture and verify all decoded string
values.
- Read the BSON logical-type fixture and verify all decoded binary
values.
- Validate all 14 files under `bad_data/variants`, including the one
valid duplicate-offset case and 13 malformed cases.
The four shredded Variant cases renamed as invalid by the same
`parquet-testing` update are already exercised by the existing Variant
integration harness.
# Are these changes tested?
Yes. The Parquet and Variant integration tests pass locally, along with
formatting and clippy checks. The PR's CI checks are also green.
# Are there any user-facing changes?
No. This PR only adds integration-test coverage for existing
`parquet-testing` fixtures.
# AI usage
This PR was prepared with OpenAI Codex and reviewed by a human. The
integration tests, formatting, and clippy checks described above were
run against the final branch, and the GitHub CI checks passed.
---------
Co-authored-by: cetra3 <cetra3@hotmail.com>
Sign up for freeto 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.

4 participants

@steveloughran@alamb@laskoviymishka@nssalian