Skip to content

fix: Show unique valid field names when an invalid one is provided - #24774

Open
nuno-faria wants to merge 1 commit into
apache:mainfrom
nuno-faria:fix_duplicate_valid_names
Open

fix: Show unique valid field names when an invalid one is provided#24774
nuno-faria wants to merge 1 commit into
apache:mainfrom
nuno-faria:fix_duplicate_valid_names

Conversation

@nuno-faria

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Minor fix to show a valid field name only once in the "Valid fields" error message.

What changes are included in this PR?

  • Add unique when collecting valid fields for the FieldNotFound error at normalize_with_schemas_and_ambiguity_check. Since multiple levels of schema are tested in that function, the same field can appear multiple times.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@github-actions github-actions Bot added sqllogictest SQL Logic Tests (.slt) common Related to common crate labels Aug 29, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.52%. Comparing base (61bf6b9) to head (a09e6f9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #24774   +/-   ##
=======================================
  Coverage   81.52%   81.52%           
=======================================
  Files        1123     1123           
  Lines      405970   405971    +1     
  Branches   405970   405971    +1     
=======================================
+ Hits       330978   330987    +9     
+ Misses      55627    55615   -12     
- Partials    19365    19369    +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kumarUjjawal kumarUjjawal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @nuno-faria

The fix is correct just the tests need one change.

drop table a;


# Test valid fields in a nested query when providing an invalid column name

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the test can pass even if we remove the unique() becuase regex is not anchored to the end, you fix using an exact multiline error expectation, or an escaped and end-anchored regex like Valid fields are t\.x\.$

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

Labels

common Related to common crate sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate valid fields in error message with nested queries

3 participants