forked from sqlfluff/sqlfluff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AL04.yml
53 lines (47 loc) · 1.17 KB
/
AL04.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
rule: AL04
test_fail_exactly_once_duplicated_aliases:
# duplicate aliases
fail_str: select 1 from table_1 as a join table_2 as a using(pk)
test_fail_two_duplicated_aliases:
fail_str: |
select 1
from table_1 as a
join table_2 as a on a.pk = b.pk
join table_3 as b on a.pk = b.pk
join table_4 as b on b.pk = b.pk
test_fail_subquery:
fail_str: |
SELECT 1
FROM (
select 1
from table_1 as a
join table_2 as a on a.pk = b.pk
join table_3 as b on a.pk = b.pk
join table_4 as b on b.pk = b.pk
)
test_pass_subquery:
# This query should pass as the different 'a'
# aliases are in different subquery levels.
pass_str: |
SELECT 1
FROM (
select 1
from table_1 as a
join table_2 as b on a.pk = b.pk
) AS a
test_pass_bigquery_function:
pass_str: |
SELECT
gcpproject.functions.timestamp_parsing(log_tbl.orderdate) AS orderdate
FROM
`gcp-project.data.year_2021` AS log_tbl
configs:
core:
dialect: bigquery
test_pass_tsql_table_variable:
pass_str: |
select @someVar = someColumn
from @someTableVar
configs:
core:
dialect: tsql