Rewrite escaped-regex error checks in sqllogictest files as plain text

オープン
#27,239 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@IG-ABHINAV がすでに取り組んでいます。

2026年11月9日 から。

  • #27263 @IG-ABHINAV による — オープン
  • #27336 @cblp による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
54/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
testing

調査の方向性

Start with the listed git grep command to find matching records in datafusion/sqllogictest/test_files/*.slt, then read the sqllogictest README guidance from #27217. Convert a small batch of 5–10 files and run cargo test --test sqllogictests -- <file> --complete on files that already pass. Keep only blocks whose messages match the old regex with escapes removed; review git diff to confirm only intended records changed.

索引モデルが issue の本文から書いたものです。

説明

enhancement good first issue
Is your feature request related to a problem or challenge?

326 error checks in 65 .slt files put the full error message on the statement error / query error line as an escaped regex, which is hard to read and review:

statement error DataFusion error: This feature is not implemented: WITH \[NO\] DATA not supported
CREATE TABLE foo AS SELECT 1 WITH NO DATA;

As plain text after ----, the same check is exact and readable:

statement error
CREATE TABLE foo AS SELECT 1 WITH NO DATA;
----
DataFusion error: This feature is not implemented: WITH [NO] DATA not supported


#27217 documents this form in the sqllogictest README, and #27218 asks --complete to write it for new records. Neither changes existing lines, because --complete leaves a regex that still matches alone. This issue is about converting the existing lines.

Describe the solution you'd like

For each line listed by this command:

git grep -nE '^(statement|query) error DataFusion error: .*\\[][(){}.+*?^$|]' -- 'datafusion/sqllogictest/test_files/*.slt'
  1. Remove the message from the statement error / query error line, and add ---- and two blank lines after the SQL. With only one blank line, the next record becomes part of the expected error and --complete deletes it.
  2. Run cargo test --test sqllogictests -- <file> --complete.
  3. Keep the new block only if its message equals the old regex with the escapes removed. If it differs, the regex matched part of the message on purpose, so restore the old line. For example, ddl.slt:704 uses .* for a local path.
  4. Check git diff: only the converted records should change. Start from a file that passes, because --complete also rewrites any other failing record.

Several small PRs (about 5 to 10 files each) are easier to review and conflict less: 36 open PRs touch 21 of these files today. Please comment here with the files you're taking.

The 75 other escaped lines don't start with DataFusion error:, so they match only part of a message. Leave them as they are.

Describe alternatives you've considered
  • One PR for all 65 files: a harder review, and more conflicts with open PRs.
  • Waiting for #27218: it changes only what --complete writes for failing records, so existing lines that pass stay as they are.
Additional context

Follow-up to #27217.

The steps above, tried on ddl.slt (7 lines)

4 lines converted cleanly, for example:

-statement error DataFusion error: Execution error: Catalog 'cat' doesn't exist\.
+statement error
 drop catalog cat;
+----
+DataFusion error: Execution error: Catalog 'cat' doesn't exist.
+

The 3 No files found at .* lines were filled with the local path (file:///.../test_files/scratch/ddl/empty_dir/), so step 3 restores them.

Willingness to contribute

I'm not planning to work on this myself, so anyone is welcome to pick it up. Feel free to ping me with questions or when you'd like a review.

主要言語
Rust
スター
9.6k
フォーク
2.6k
平均マージ
3日 4時間
マージ済み PR(30日)
345

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/datafusion のほかの issue

apache/datafusion の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。