Skip to content

[Variant] Add negative tests for reading invalid primitive variant values #7645

@alamb

Description

@alamb

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
As @superserious-dev says in https://github.com/apache/arrow-rs/pull/7644/files#r2140494799:

The decoders are currently tested for the happy path. It could make sense(in either this PR or a follow-up) to test for cases where the file doesn't meet the spec. For example: in the case of Decimals, ensuring that the scale byte is always in the range [0, 38].

@scovich agrees adding negative tests is important

Describe the solution you'd like
Tests for:

  1. Decimals that are out of range
  2. Trying to decode variants where the total length is not as expected for the primitive type (e.g try to decode a primitive int32 from a 3 byte input (it should be 5 bytes)
  3. ... Others

Describe alternatives you've considered

Additional context

Metadata

Metadata

Labels

enhancementAny new improvement worthy of a entry in the changelogparquetChanges to the parquet crate

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions