TSQL: function DATEPART: date type is parsed as column identifier #3630
Labels
bug
Something isn't working
good first issue
Good for newcomers
t-sql
Issues related to the T-SQL/TSQL/Transact SQL dialect
Search before asking
What Happened
With TSQL dialect first parameter in function DATEPART is parsed as "identifier" segment instead of "date_part" segment.
This causes violation of L028 rules during linting.
datepart-transact-sql
Expected Behaviour
No L028 rule violations.
In parsing structure this should be similar to DATEADD:
Observed Behaviour
parsing result for function:
How to reproduce
Run linting on SQL code:
sqlfluff lint D:\py_code\sqlfluff\real_tests\v_v.sql --rules L028 --config config\sqlfluff\.sqlfluff
Dialect
tsql
Version
sqlfluff, version 0.13.1
Python 3.9.6
Configuration
Are you willing to work on and submit a PR to address the issue?
Code of Conduct
The text was updated successfully, but these errors were encountered: