-
-
Notifications
You must be signed in to change notification settings - Fork 873
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Search before asking
- I searched the issues and found no similar issues.
Description
It seems sqlfluff can’t handle the dot notation we use for Redshift SUPER data type. RF01 rule (https://docs.sqlfluff.com/en/stable/rules.html#rule-references.from).
Usage example:
w_extract as (
select
pj.hash_key,
pj.snapshot_date,
trim(cast(pj.metadata_super."amount" as numeric)) as amount,
trim(cast(pj.metadata_super."leadAge" as numeric)) as lead_age,
trim(cast(pj.metadata_super."leadType" as varchar)) as lead_type,
trim(cast(pj.metadata_super."leadValue" as numeric)) as lead_value,
trim(cast(pj.metadata_super."randValue" as numeric)) as rand_value,
trim(cast(pj.metadata_super."callReason" as varchar)) as call_reason
from w_parse_json as pj
)
Failures:
L: 49 | P: 22 | RF01 | Reference 'pj.metadata_super."amount"' refers to
| table/view not found in the FROM clause or found in
| ancestor statement. [references.from]
L: 50 | P: 22 | RF01 | Reference 'pj.metadata_super."leadAge"' refers to
| table/view not found in the FROM clause or found in
| ancestor statement. [references.from]
L: 51 | P: 22 | RF01 | Reference 'pj.metadata_super."leadType"' refers to
| table/view not found in the FROM clause or found in
| ancestor statement. [references.from]
L: 52 | P: 22 | RF01 | Reference 'pj.metadata_super."leadValue"' refers to
| table/view not found in the FROM clause or found in
| ancestor statement. [references.from]
L: 53 | P: 22 | RF01 | Reference 'pj.metadata_super."randValue"' refers to
| table/view not found in the FROM clause or found in
| ancestor statement. [references.from]
L: 54 | P: 22 | RF01 | Reference 'pj.metadata_super."callReason"' refers to
| table/view not found in the FROM clause or found in
| ancestor statement. [references.from]
Can we improve this so this is automatically handled via sqlfluff fix
? Currently, this is an unfixable violation and we simply have to ignore it.
Use case
No response
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
KaneMorgan
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request