Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Use the shared aggr_test_schema in CSV scan tests instead of a local copy

Đang mở Phù hợp với người mới
#26,306 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@med9110 đang làm issue này rồi.

Từ ngày 14/10/2026.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
data

Hướng nghiên cứu

Bắt đầu từ mô-đun test trong datafusion/core/src/datasource/physical_plan/csv.rs và tìm bản sao private của aggr_test_schema(). Bản public tương ứng nằm trong datafusion/core/src/test_util/mod.rs, vì vậy hãy import nó từ crate::test_util và giữ aggr_test_schema_with_missing_col được xây dựng trên nó. Chạy các test CSV bằng cargo test trong crate datafusion-core. Hoàn thành khi bản sao cục bộ đã bị xóa và các test đó vẫn pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

core enhancement good first issue help wanted tech debt
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
  1. Delete the local aggr_test_schema in the csv.rs tests and import crate::test_util::aggr_test_schema. Keep aggr_test_schema_with_missing_col as a derivation of it.
  2. Optionally add a test helper such as csv_scan_config(file_compression_type, file_schema, |builder| ...) -> FileScanConfig that 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.

Ngôn ngữ chính
Rust
Star
9.5k
Fork
2.5k
Merge trung bình
4 ngày 19 giờ
Pull request đã merge (30 ngày)
342

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/datafusion

Tất cả issue của apache/datafusion

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.