-
-
Notifications
You must be signed in to change notification settings - Fork 873
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Search before asking
- I searched the issues and found no similar issues.
What Happened
[redshift] sqlfluff 2.0.2 reports (and fixes) aliasing.unused where the alias is (correctly) not being used in a select statement, but is used unnesting an array in the from statement.
Example:
-- redshift
SELECT
my_column,
my_array_value
FROM my_schema.my_table AS t, t.super_array AS my_array_value
L: 4 | P: 28 | AL05 | Alias 't' is never used in SELECT statement.
| [aliasing.unused]
Expected Behaviour
The alias is being validly used in the FROM clause of this SELECT statement, and this rule should not trigger.
Observed Behaviour
The table alias is reported as unused, and sqlfluff fix
removes it, making the query invalid.
How to reproduce
Reproducer included in What Happened
Dialect
Redshift
Version
2.0.2 (python 3.10.6)
Configuration
Default configuration (aside from dialect).
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
- I agree to follow this project's Code of Conduct
pdecat, llamasoft, dbrakman, mattdohm, phammer and 1 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working