Skip to content

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

Open

Description

@jayzhan211

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

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.

Activity

  1. added
    enhancement
    good first issue
    on Nov 8, 2026
  2. Goldloli commented on Nov 8, 2026

    @Goldloli

    Taking a first batch of 8 files:

    • datafusion/sqllogictest/test_files/errors.slt
    • datafusion/sqllogictest/test_files/set_variable.slt
    • datafusion/sqllogictest/test_files/table_functions.slt
    • datafusion/sqllogictest/test_files/struct.slt
    • datafusion/sqllogictest/test_files/subquery.slt
    • datafusion/sqllogictest/test_files/group_by.slt
    • datafusion/sqllogictest/test_files/math.slt
    • datafusion/sqllogictest/test_files/ddl.slt

    (including ddl.slt to cover the .* local-path case called out in the issue, which I'll leave as is)

  3. kutluhaneth46 commented on Nov 9, 2026

    @kutluhaneth46

    Taking a batch of 8 files:

    1. datafusion/sqllogictest/test_files/array/array_filter.slt
    2. datafusion/sqllogictest/test_files/array/array_range.slt
    3. datafusion/sqllogictest/test_files/array/array_transform.slt
    4. datafusion/sqllogictest/test_files/arrow_typeof.slt
    5. datafusion/sqllogictest/test_files/async_udf.slt
    6. datafusion/sqllogictest/test_files/binary.slt
    7. datafusion/sqllogictest/test_files/copy.slt
    8. datafusion/sqllogictest/test_files/create_function.slt
  4. itang06 commented on Nov 9, 2026

    @itang06
    Contributor

    Taking a batch of 5 files

    • datafusion/sqllogictest/test_files/scalar.slt
    • datafusion/sqllogictest/test_files/explain.slt
    • datafusion/sqllogictest/test_files/order.slt
    • datafusion/sqllogictest/test_files/select.slt
    • datafusion/sqllogictest/test_files/joins.slt

    I'll convert the full-message checks to plain text and keep the regexes that intentionally match only part of an error.

  5. ETS2K7 commented on Nov 9, 2026

    @ETS2K7

    Taking a batch of 3 files:

    • datafusion/sqllogictest/test_files/cte.slt
    • datafusion/sqllogictest/test_files/distinct_on.slt
    • datafusion/sqllogictest/test_files/ident_normalization.slt

    I'll convert the full-message checks to plain text under ---- and leave partial-match regexes alone. Skipping identifiers.slt since #27265 already has the same conversion for it.

  6. ETS2K7 commented on Nov 10, 2026

    @ETS2K7

    Unclaiming cte.slt, distinct_on.slt, and ident_normalization.slt (#27270 closed) so others can pick them up.

  7. cblp commented on Nov 11, 2026

    @cblp
    Contributor

    Taking a batch of 5 files:

    • datafusion/sqllogictest/test_files/datetime/date_part.slt
    • datafusion/sqllogictest/test_files/datetime/interval.slt
    • datafusion/sqllogictest/test_files/datetime/dates.slt
    • datafusion/sqllogictest/test_files/datetime/interval_mysql.slt
    • datafusion/sqllogictest/test_files/datetime/arith_interval_double.slt

    I'll convert the full-message checks to plain text and keep the regexes that intentionally match only part of an error.

  8. chinmaydwivedi commented on Nov 12, 2026

    @chinmaydwivedi
    Contributor

    Taking one file: datafusion/sqllogictest/test_files/datetime/timestamps.slt (the other datetime files are covered by #27336).

    It has 12 matching lines. I'll convert the 7 where the regex is the whole message and leave the 5 that only match part of it.

  9. Inf1mum commented on Nov 12, 2026

    @Inf1mum

    Working on the escaped-regex rewrite for encoding.slt and expr.slt.

  10. Inf1mum commented on Nov 12, 2026

    @Inf1mum

    Unclaiming encoding.slt and expr.slt. All 4 matching lines (encoding.slt 65, 68, 83 and expr.slt 608) fail step 3 of the recipe: the actual error is longer than the old regex. For example, select encode(12, 'hex'); now fails with

    DataFusion error: Error during planning: Function 'encode' requires Binary, but received Int64 (DataType: Int64).. No function matches the given name and argument types 'encode(Int64, Utf8)'. You might need to add explicit type casts.
    	Candidate functions:
    	encode(Binary, String)
    

    and decode (encoding.slt 68), to_hex (encoding.slt 83), and repeat (expr.slt 608) have the same appended signature text. The inline regexes match only a prefix of these messages, so the plain-text record cannot equal the old regex with the escapes removed. The appended "No function matches …" text and these exact slt lines both go back to #20605, so the regexes have been prefix-matches ever since. Converting them would mean rewriting the checks to the full multi-line message rather than a mechanical rewrite, so I'm releasing the claim instead of opening an empty PR.

  11. PrajwalAmte commented on Nov 22, 2026

    @PrajwalAmte

    Taking a small first batch to learn the recipe and CI flow:

    datafusion/sqllogictest/test_files/cte.slt
    datafusion/sqllogictest/test_files/distinct_on.slt
    datafusion/sqllogictest/test_files/ident_normalization.slt

    I’ll convert only the error checks where the escaped regex is the whole message, and leave partial-match regexes as they are. I’ll check each rewritten error against the actual output of cargo test --test sqllogictests before opening the PR. I’ll keep this to one PR per batch.

    (I saw these were unclaimed after #27270 was closed. If there’s a reason that PR was closed, such as a reviewer preference, please tell me and I’ll adjust.)

  12. kush-manish commented on Nov 25, 2026

    @kush-manish

    Taking a batch of 5 files (opened #27762):

    • datafusion/sqllogictest/test_files/eliminate_join_distinct.slt
    • datafusion/sqllogictest/test_files/map.slt
    • datafusion/sqllogictest/test_files/predicates.slt
    • datafusion/sqllogictest/test_files/qualify.slt
    • datafusion/sqllogictest/test_files/type_coercion.slt
  13. Inf1mum commented on Nov 25, 2026

    @Inf1mum

    Taking the batch of files that are still free (everything else on the list is covered by an open PR or an unwithdrawn claim):

    • datafusion/sqllogictest/test_files/metadata.slt (1 matching line)
    • datafusion/sqllogictest/test_files/scalar.slt (1 matching line)
    • datafusion/sqllogictest/test_files/datetime/timestamps.slt (5 matching lines; two of them use [\s\S]* to span a multi-part message, so those two stay as they are)

    I will convert only the checks where the escaped regex is the whole message, and leave partial-match regexes as they are.

  14. Inf1mum commented on Nov 25, 2026

    @Inf1mum

    Releasing my claim above: no free line converts cleanly, so I opened no pull request.

    I ran cargo test --test sqllogictests -- <file> --complete on current main for every unclaimed candidate and restored each record because the real error continues past the old regex (step 3 of the recipe):

    • metadata.slt 1064: the real message ends ...got metadata: {"metadata_key": "left"}. followed by the two-line This issue was likely caused by a bug in DataFusion's code... footer, so the old regex only matches a prefix.
    • scalar.slt 2377: Function 'strpos' requires String... continues with .. No function matches the given name and argument types 'strpos(Int64, Int64)'...
    • datetime/timestamps.slt 4343, 4616, 5402 (make_date, make_time, to_local_time): same appended No function matches ... Candidate functions: text.
    • datetime/timestamps.slt 905 and 909 use [\s\S]* to span a multi-part message on purpose, so they stay as they are.

    That leaves encoding.slt 65/68/83 and expr.slt 608, already known to fail step 3 for the same reason, as the only other unclaimed lines. Every other line on the list is covered by an open pull request or a standing claim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions