Skip to content

Conversation

WittierDinosaur
Copy link
Contributor

Brief summary of the change made

Fixes #6992

Are there any other side effects of this change that we should be aware of?

No

Pull Request checklist

  • Please confirm you have completed any of the necessary steps below.

  • Included test cases to demonstrate any code changes, which may be one or more of the following:

    • .yml rule test cases in test/fixtures/rules/std_rule_cases.
    • .sql/.yml parser test cases in test/fixtures/dialects (note YML files can be auto generated with tox -e generate-fixture-yml).
    • Full autofix test cases in test/fixtures/linter/autofix.
    • Other.
  • Added appropriate documentation for the change.

  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added support for Snowflake's UNION BY NAME and UNION ALL BY NAME syntax, allowing columns to be matched by name rather than position in union operations.

  • Modified src/sqlfluff/dialects/dialect_snowflake.py to add optional BY NAME clause in SetOperatorSegment
  • Added test case in test/fixtures/dialects/snowflake/select_union.sql demonstrating UNION BY NAME syntax
  • Added corresponding YAML fixture in test/fixtures/dialects/snowflake/select_union.yml with three distinct test cases validating proper AST structure

3 files reviewed, no comments
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Jul 8, 2025

Coverage Results ✅

Name    Stmts   Miss  Cover   Missing
-------------------------------------
TOTAL   19822      0   100%

251 files skipped due to complete coverage.

Copy link
Contributor

@keraion keraion left a comment

Choose a reason for hiding this comment

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

LGTM

@keraion keraion added this pull request to the merge queue Jul 8, 2025
Merged via the queue into main with commit 59bf845 Jul 8, 2025
30 checks passed
@keraion keraion deleted the issue-6992 branch July 8, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for union by name in snowflake
2 participants