Use the shared aggr_test_schema in CSV scan tests instead of a local copy
Is your feature request related to a problem or challenge?
The test module in core/src/datasource/physical_plan/csv.rs defines a private aggr_test_schema() that is a verbatim copy of the public datafusion::test_util::aggr_test_schema(). If the shared schema changes (for example new columns or metadata on aggregate_test_100.csv), the CSV tests keep using the stale copy.
The same module also repeats about 35 lines of scan setup in every rstest case (session context, partitioned_file_groups, CsvOptions, TableSchema, CsvSource, FileScanConfigBuilder), differing only in projection, limit and the expected snapshot (L130-L442). json.rs (L213-L372) does the same with prepare_store and JsonSource.
Describe the solution you'd like
- Delete the local
aggr_test_schemain the csv.rs tests and importcrate::test_util::aggr_test_schema. Keepaggr_test_schema_with_missing_colas a derivation of it. - Optionally add a test helper such as
csv_scan_config(file_compression_type, file_schema, |builder| ...) -> FileScanConfigthat does the shared setup, so each rstest case only applies its projection or limit and asserts. Do the same for json.rs.
Describe alternatives you've considered
Do step 1 only.
Additional context
Step 1 is a small, self-contained change and a good first issue. Line references are pinned to commit 0d79252f61bd.
Hi @andygrove, I'd like to work on #26306. I'll start by replacing the duplicated schema with the shared test utility and verifying that the existing CSV tests pass. Would you prefer keeping the optional scan-setup refactoring separate?
take
4. take
You can't take all open issues !!!
Hi @andygrove, I'm interested in contributing to this issue as my first DataFusion contribution. I noticed multiple contributors have expressed interest, so I wanted to check whether this task is still available.
I'm happy to work on another good first issue if someone is already handling it. Thanks!