Skip to content

Commit 365d36a

Browse files
committed
test(compile): expect the ON clause reading a later table to fail now
SQLQuack 0.22 scopes a join's ON clause to the tables before it, so J05, an ON clause naming a table joined later, is now a B004 compile error rather than a pending case.
1 parent 73837e1 commit 365d36a

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

  • tests/e2e/src/sqlbuild/cli/commands/main/compile/fixtures/semantic

‎tests/e2e/src/sqlbuild/cli/commands/main/compile/fixtures/semantic/corpus.json‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,18 @@
10091009
"models/probe.sql": "MODEL (description \"Test model probe.\", materialized table);\n\nSELECT a.id FROM (SELECT id, status FROM __source(\"raw__orders\")) a JOIN (SELECT id FROM __source(\"raw__customers\")) b USING (status)\n"
10101010
}
10111011
},
1012+
{
1013+
"description": "J05: ON references later table",
1014+
"category": "join",
1015+
"expected_exit_code": 1,
1016+
"expected_codes": [
1017+
"B004"
1018+
],
1019+
"pending_native": false,
1020+
"repo_files": {
1021+
"models/probe.sql": "MODEL (description \"Test model probe.\", materialized table);\n\nSELECT o.id FROM __source(\"raw__orders\") o JOIN __source(\"raw__customers\") c ON c.id = p.order_id JOIN __source(\"raw__payments\") p ON p.order_id = o.id\n"
1022+
}
1023+
},
10121024
{
10131025
"description": "S04: UNION BY NAME unknown column in outer",
10141026
"category": "set operation",
@@ -2344,16 +2356,6 @@
23442356
"models/probe.sql": "MODEL (description \"Test model probe.\", materialized table);\n\nSELECT id FROM __source(\"raw__orders\") JOIN __source(\"raw__orders\") ON id = id\n"
23452357
}
23462358
},
2347-
{
2348-
"description": "J05: ON references later table",
2349-
"category": "join",
2350-
"expected_exit_code": 1,
2351-
"expected_codes": [],
2352-
"pending_native": true,
2353-
"repo_files": {
2354-
"models/probe.sql": "MODEL (description \"Test model probe.\", materialized table);\n\nSELECT o.id FROM __source(\"raw__orders\") o JOIN __source(\"raw__customers\") c ON c.id = p.order_id JOIN __source(\"raw__payments\") p ON p.order_id = o.id\n"
2355-
}
2356-
},
23572359
{
23582360
"description": "E01: duplicate CTE names",
23592361
"category": "cte",

0 commit comments

Comments
 (0)