Is your feature request related to a problem or challenge?
While working on the ALP encoder/decoder with @sdf-jkl in #9372, I found the parquet tests were spread out all over the place and thus is was hard to know where to put end to end tests and what was current covered or not covered.
There are several categories of tests that appear frequently in the parquet crate and are currently scattered about
- "round trip" tests -- they write data to a parquet file and then read it back, ensuring the exact same values are returned
- "known fixture tests" -- read files from
parquet-testing and assert that their contents match the expected values
This approach directly tests the decoders, and transitively tests the encoders (since we know the decoder can read third-party files, we have some confidence that the writer is writing valid data as well)
Describe the solution you'd like
I would like to consolidate the end to end testing into arrow_reader and arrow_writer tests
- consolidate "fixture" tests in parquet/tests/arrow_reader/parquet_testing.rs
- consolidate "round trip" tests in parquet/tests/arrow_writer/roundtrip.rs
- consolidate arrow_writer tests: move arrow_writer_layout.rs into arrow_writer/layout.rs
Describe alternatives you've considered
AI Research
Parquet roundtrip test locations
Tests that write full Arrow arrays / RecordBatches to a complete parquet file, read it back, and compare the data to the original. (Statistics-only, layout/memory, metadata/schema-only, bloom-filter-probe, and error-assertion tests are excluded.)
Core suites
| # |
Location |
What lives there |
| 1 |
parquet/src/arrow/arrow_writer/mod.rs |
The main per-type suite (~95 tests). Helper family: roundtrip, roundtrip_opts, roundtrip_opts_with_array_validation, one_column_roundtrip, one_column_roundtrip_with_schema/_with_options, values_required, values_optional, required_and_optional, plus the REE-specific ree_write_read_roundtrip family. |
| 2 |
parquet/src/arrow/arrow_reader/mod.rs |
~24 standalone ArrowWriter → ParquetRecordBatchReader data roundtrips: test_unsigned_roundtrip, test_float16_roundtrip, test_time_utc_roundtrip, test_date32_roundtrip, test_date64_roundtrip, test_decimal32_roundtrip, test_decimal64_roundtrip, test_decimal_roundtrip, test_decimal_list, test_decimal_nullable_struct, test_int32_nullable_struct, test_list_skip, test_list_selection, test_list_selection_fuzz, test_row_group_batch, etc. Also the big run_single_column_reader_tests/TestOptions harness — it compares full arrow data, though its write leg uses the low-level SerializedFileWriter rather than ArrowWriter. |
Async
Push decoder
Integration tests (parquet/tests/)
Encryption
Variant
| # |
Location |
What lives there |
| 15 |
parquet/src/variant.rs |
3 tests with their own local roundtrip(VariantArray) / write_to_buffer / read_to_batch helpers. |
One-off hand-rolled roundtrips
Borderline (data is compared, but that's not the test's main point)
- parquet/tests/arrow_reader/io/ — writes a
TEST_FILE_DATA fixture with ArrowWriter and checks decoded batches, but the assertions are primarily about which byte ranges get read.
- parquet/src/file/writer.rs —
test_byte_stream_split_extended_roundtrip reads a file, rewrites with ArrowWriter, and verifies mostly encodings.
Summary
There are at least five independent helper families doing write-batch-then-read-and-compare (roundtrip* in arrow_writer/mod.rs, run_single_column_reader_tests in arrow_reader/mod.rs, the encryption read_and_roundtrip_to_encrypted_file, the CDC helpers, and the variant helpers), two duplicated TEST_FILE_DATA fixture patterns (push_decoder and tests/arrow_reader/io), and roughly a dozen files that hand-roll ArrowWriter → reader inline.
Related issues: #9269 (split up Parquet reader tests), #9348 (split up Parquet async reader tests).
Additional context
Related issues
Is your feature request related to a problem or challenge?
While working on the ALP encoder/decoder with @sdf-jkl in #9372, I found the parquet tests were spread out all over the place and thus is was hard to know where to put end to end tests and what was current covered or not covered.
There are several categories of tests that appear frequently in the parquet crate and are currently scattered about
parquet-testingand assert that their contents match the expected valuesThis approach directly tests the decoders, and transitively tests the encoders (since we know the decoder can read third-party files, we have some confidence that the writer is writing valid data as well)
Describe the solution you'd like
I would like to consolidate the end to end testing into arrow_reader and arrow_writer tests
Describe alternatives you've considered
AI Research
Parquet roundtrip test locations
Tests that write full Arrow arrays /
RecordBatches to a complete parquet file, read it back, and compare the data to the original. (Statistics-only, layout/memory, metadata/schema-only, bloom-filter-probe, and error-assertion tests are excluded.)Core suites
roundtrip,roundtrip_opts,roundtrip_opts_with_array_validation,one_column_roundtrip,one_column_roundtrip_with_schema/_with_options,values_required,values_optional,required_and_optional, plus the REE-specificree_write_read_roundtripfamily.ArrowWriter→ParquetRecordBatchReaderdata roundtrips:test_unsigned_roundtrip,test_float16_roundtrip,test_time_utc_roundtrip,test_date32_roundtrip,test_date64_roundtrip,test_decimal32_roundtrip,test_decimal64_roundtrip,test_decimal_roundtrip,test_decimal_list,test_decimal_nullable_struct,test_int32_nullable_struct,test_list_skip,test_list_selection,test_list_selection_fuzz,test_row_group_batch, etc. Also the bigrun_single_column_reader_tests/TestOptionsharness — it compares full arrow data, though its write leg uses the low-levelSerializedFileWriterrather thanArrowWriter.Async
AsyncArrowWriter→ read-back-and-assert_eq!tests (test_async_writer,test_async_writer_file, async-vs-sync comparison).AsyncArrowWriterdata roundtrip.ArrowWriter→ParquetRecordBatchStreamBuilderdata roundtrips:test_nested_skip,test_nested_lists,test_limit_multiple_row_groups,test_parquet_record_batch_stream_schema,test_predicate_cache_disabled. No shared helper.Push decoder
ArrowWriter-writtenTEST_FILE_DATAfixture and comparing batches (test_decoder_all_data, incremental/filter/selection/limit variants).Integration tests (
parquet/tests/)ArrowWriter, read back withRowFilter/RowSelection, compare filtered data.make_two_column_i64_file.Encryption
read_and_roundtrip_to_encrypted_file+verify_encryption_test_data(data comparison).uniform_encryption_roundtrip, key-retriever variants, severalwrite_*_encryptiontests.test_multi_threaded_encrypted_writing,test_concurrent_encrypted_writing_over_multiple_row_groups).Variant
roundtrip(VariantArray)/write_to_buffer/read_to_batchhelpers.One-off hand-rolled roundtrips
test_read_as_dyn_listand neighbors).read_map_array_column.test_decimal_list).test_nested_lists).write_with_cdc_options/read_batches/find_differenceshelpers.Borderline (data is compared, but that's not the test's main point)
TEST_FILE_DATAfixture withArrowWriterand checks decoded batches, but the assertions are primarily about which byte ranges get read.test_byte_stream_split_extended_roundtripreads a file, rewrites withArrowWriter, and verifies mostly encodings.Summary
There are at least five independent helper families doing write-batch-then-read-and-compare (
roundtrip*inarrow_writer/mod.rs,run_single_column_reader_testsinarrow_reader/mod.rs, the encryptionread_and_roundtrip_to_encrypted_file, the CDC helpers, and the variant helpers), two duplicatedTEST_FILE_DATAfixture patterns (push_decoderandtests/arrow_reader/io), and roughly a dozen files that hand-rollArrowWriter→ reader inline.Related issues: #9269 (split up Parquet reader tests), #9348 (split up Parquet async reader tests).
Additional context
Related issues