Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#26,306 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@med9110 已经在做这个了。

开始于 2026年10月14日。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
85/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
data

调研方向

从 datafusion/core/src/datasource/physical_plan/csv.rs 的测试模块开始,找到私有的 aggr_test_schema() 副本。它的公开对应版本位于 datafusion/core/src/test_util/mod.rs,因此请从 crate::test_util 导入它,并保持 aggr_test_schema_with_missing_col 基于它构建。在 datafusion-core crate 中使用 cargo test 运行 CSV 测试。当本地副本被删除且这些测试仍然通过时,即完成。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Rust
星标
9.4k
派生
2.5k
平均合并
4 天 9 小时
30 天内合并 PR
329

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/datafusion 的其他 Issue

查看 apache/datafusion 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。