Skip to content

Minor: migrate more arrow round trip tests to use RoundTripTest fixture - #10585

Merged
alamb merged 1 commit into
apache:mainfrom
alamb:alamb/move_roundtrip
Aug 9, 2026
Merged

Minor: migrate more arrow round trip tests to use RoundTripTest fixture#10585
alamb merged 1 commit into
apache:mainfrom
alamb:alamb/move_roundtrip

Conversation

@alamb

@alamb alamb commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

There are 4000+ lines of tests in arrow_writer (and a bunch more in arrow_reader, I might point out) -- this makes it hard to find and add new tests or to evaluate test coverage

I encapsulated the testing harness into a struct in #10545 and now I want to (slowly) move more tests to use this new harness.

What changes are included in this PR?

  1. Migrate a few tests from using roundtrip() to using RoundTripTest; This actually increases coverage as I will descsribe below
  2. Note this is less code and more coverage

Are these changes tested?

yes by CI

Are there any user-facing changes?

No

roundtrip(batch, Some(SMALL_SIZE / 2));
RoundTripTest::new(Arc::new(a))
.with_schema(Arc::new(schema))
.run();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This actually increases test coverage as

RoundTripTest::run() actually already calls into the same roundtrip code, but does so with:

  1. Multiple different row group sizes (including SMALL_SIZE/2)
  2. All supported encodings
  3. Dictionary/no dictionary pages
  4. DataPage V1 and V2

https://github.com/apache/arrow-rs/blob/725fe70db6efcd45bbdbdd6f3ef97c8c71221fad/parquet/src/arrow/arrow_writer/mod.rs#L3208-L3207

.build()
.unwrap();
let a = ListArray::from(a_list_data);
assert_eq!(a.null_count(), 1);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

as above, this actually increases coverage substantially

assert_eq!(binary_values.null_count(), 0);

roundtrip(batch, Some(SMALL_SIZE / 2));
RoundTripTest::new(Arc::new(string_values)).run();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

technically speaking this encodes a single column batch rather than a multi-column batch, but the point of these tests is to test the round tripping of data through the whole parquet machiner; Batches with multiple columns are tested elsewhere


roundtrip(batch.clone(), Some(SMALL_SIZE / 2));
roundtrip(batch, None);
RoundTripTest::new(Arc::new(string_view_values)).run();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

As above, this ctually increases coverage because it tries a both these two sets of max row group sizes, and a bunch of other permutations

.unwrap();

// Disable dictionary to exercise plain encoding paths in the reader.
for version in [WriterVersion::PARQUET_1_0, WriterVersion::PARQUET_2_0] {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

RoundtripTest also tests with/without dictionary and data page formats (and several other parameters)

https://github.com/apache/arrow-rs/blob/725fe70db6efcd45bbdbdd6f3ef97c8c71221fad/parquet/src/arrow/arrow_writer/mod.rs#L3199-L3198

@alamb

alamb commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @Jefffrey

@alamb
alamb merged commit 919f783 into apache:main Aug 9, 2026
19 of 20 checks passed
@Jefffrey Jefffrey added the development-process Related to development process of arrow-rs label Aug 9, 2026
MassivePizza pushed a commit to massive-com/arrow-rs that referenced this pull request Aug 19, 2026
…re (apache#10585)

# Which issue does this PR close?

- part of apache#10540 
- Follow on to apache#10545

# Rationale for this change

There are 4000+ lines of tests in arrow_writer (and a bunch more in
arrow_reader, I might point out) -- this makes it hard to find and add
new tests or to evaluate test coverage

I encapsulated the testing harness into a struct in
apache#10545 and now I want to (slowly)
move more tests to use this new harness.

# What changes are included in this PR?

1. Migrate a few tests from using `roundtrip()` to using
`RoundTripTest`; This actually increases coverage as I will descsribe
below
2. Note this is less code and more coverage

# Are these changes tested?
yes by CI


# Are there any user-facing changes?

No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development-process Related to development process of arrow-rs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants