Skip to content

Named WINDOW clause not recognized (TSQL) #6687

@cheyney-w

Description

@cheyney-w

Search before asking

  • I searched the issues and found no similar issues.

What Happened

SQLFluff reporting unparsable section when encountering a WINDOW clause using the tsql dialect.

Expected Behaviour

Proper parsing of the window clause in statements such as this:

select row_number() over win as x 
from information_schema.tables 
window win as (order by table_name)

Observed Behaviour

L:   1 | P:  21 |  PRS | Line 1, Position 21: Found unparsable section: 'over win as x from
                       | information_schema.ta...'
WARNING: Parsing errors found and dialect is set to 'tsql'. Have you configured your dialect correctly?

How to reproduce

echo 'select row_number() over win as row_num from information_schema.tables window win as (order by table_name)' | sqlfluff parse --dialect=tsql -

Dialect

TSQL

Version

sqlfluff, version 3.3.1
Python version 3.12.9

Configuration

None used

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingt-sqlIssues related to the T-SQL/TSQL/Transact SQL dialect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions