Exit Codes
By default, SDF exits with the following status codes- 0 if no linter violations were found
- 0 if linter completes successfully with any number of linter warnings
- 64 if the linter fails for syntax reasons in any file
-w error flag which turns any lint warning into an error.
In sdf yml, you configure this as follows::
Capitalization Keywords
SDF107
Inconsistent capitalization of keywords| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
capitalization-keywords | SDF107 | L010 | ✅ |
sdf lint -w capitalization-keywords=upper
Configuration:
workspace.sdf.yml
Capitalization Literals
SDF108
SDF109
Inconsistent capitalization ofboolean/null literal
| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
capitalization-literals | SDF108, SDF109 | L040 | ✅ |
sdf lint -w capitalization-literals=upper
Configuration:
workspace.sdf.yml
Capitalization Types
SDF110
Inconsistent capitalization of datatypes.| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
capitalization-types | SDF110 | L063 | ✅ |
sdf lint -w capitalization-types=upper
Configuration:
workspace.sdf.yml
Capitalization Functions
SDF106
Inconsistent capitalization of function names| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
capitalization-functions | SDF106 | L030 | ✅ |
sdf lint -w capitalization-functions=upper
Configuration:
workspace.sdf.yml
Convention Blocked Words
SDF124
Specify a list of names to block from being identifiers.| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
convention-blocked-words | SDF124 | L062 | ❌ |
- Blocking a single word:
sdf lint -w convention-blocked-words=department - Blocking multiple words:
sdf lint -w convention-blocked-words=word1,word2,...,wordn
workspace.sdf.yml
References Keywords
SDF125
Keywords should not be used as identifiers| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
references-keywords | SDF125 | L029 | ❌ |
sdf lint -w references-keywords
Configuration:
workspace.sdf.yml
References Special Chars
SDF117
Do not use special characters in identifiers| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
references-special-chars | SDF117 | L057 | ❌ |
- Disallows
$character:sdf lint -w references-special-chars=$ - Disallows
$and.characters:sdf lint -w references-special-chars=$.
workspace.sdf.yml
References Quoting
SDF118
Unnecessary quoted identifier| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
references-quoting | SDF118 | L059 | ❌ |
sdf lint -w references-quoting
Configuration:
workspace.sdf.yml
References Qualification
SDF116
Columns reference should specify source table or view in queries with more than one source.| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
references-qualification | SDF116 | L027 | ❌ |
sdf lint -w references-qualification
Configuration:
workspace.sdf.yml
Ambiguous Column References
SDF105
Inconsistent column references in GROUP BY/ORDER BY clauses of both ordinal and non-ordinal| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
ambiguous-column-references | SDF105 | L054 | ❌ |
sdf lint -w ambiguous-column-references
Configuration:
workspace.sdf.yml
GROUP BY or ORDER BY clause. Reference should be consistent.
Structure Else Null
SDF119
RedundantELSE NULL in a case when statement
| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
structure-else-null | SDF119 | L035 | ❌ |
sdf lint -w structure-else-null
Configuration:
workspace.sdf.yml
ELSE NULL within a CASE WHEN statement.
Structure Simple Case
SDF120
CASE statement can be simplified| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
structure-simple-case | SDF120 | L043 | ❌ |
sdf lint -w structure-simple-case
Configuration:
workspace.sdf.yml
CASE statement are unnecessary and can be simplified:
Structure Unused Cte
SDF121
Query defines a CTE (common-table expression) but does not use it| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
structure-unused-cte | SDF121 | L045 | ❌ |
sdf lint -w structure-unused-cte
Configuration:
workspace.sdf.yml
sub_2 in the example below).
Structure Nested Case
SDF122
Nested CASE statement in ELSE clause could be flattened.| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
structure-nested-case | SDF122 | L058 | ❌ |
sdf lint -w structure-nested-case
Configuration:
workspace.sdf.yml
CASE statements.
Structure Distinct
SDF123
DISTINCT used with parentheses| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
structure-distinct | SDF123 | L015 | ❌ |
sdf lint -w structure-distinct
Configuration:
workspace.sdf.yml
DISTINCT with parentheses. In the example below, all columns are affected by the DISTINCT but can mistaken to think only column a is.
Structure Subquery
SDF113
Join/From clauses should not contain subqueries. Use CTEs instead| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
structure-subquery | SDF113 | L042 | ❌ |
sdf lint -w structure-subquery=join
Configuration:
workspace.sdf.yml
Structure Join Condition Order
SDF114
Join conditions column references should follow tables reference order| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
structure_join_condition_order | SDF114 | ST09 | ❌ |
sdf lint -w structure_join_condition_order
Configuration:
workspace.sdf.yml
ON clause statement in a different order than
the tables are referenced in the JOIN clause
Structure Column Order
SDF115
Select wildcards then simple targets before calculations and aggregates.| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
structure-column-order | SDF115 | L034 | ❌ |
sdf lint -w structure-column-order
Configuration:
workspace.sdf.yml
Convention Terminator
SDF111
Statements should not end with a semi-colon. Multi-statements must be separated with a semi-colon but the final statement should NOT end with one.| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
convention-terminator | SDF111 | L052 | ✅ |
sdf lint -w convention-terminator
Configuration:
workspace.sdf.yml
Convention Comma
SDF104
Avoid trailing commas in lists.| Configuration | SDF Error | SQLFluff Alias | Auto-fix |
|---|---|---|---|
convention-comma | SDF104 | N/A | ✅ |
workspace.sdf.yml