-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add classes to represent CTEs (#1462)
* This PR adds classes to represent CTEs to the SQL object model. * CTEs will be used in later PRs to simplify generated queries. * Functionality to render CTEs is included, and existing code should not hit the CTE use cases so many methods were left unimplemented.
- Loading branch information
Showing
9 changed files
with
254 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
tests_metricflow/snapshots/test_render_cte.py/SqlQueryPlan/test_render_cte__plan_0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-- cte_test | ||
WITH cte_0 AS ( | ||
-- cte_select_0 | ||
SELECT | ||
cte_source_table_0.col_0 | ||
FROM demo.cte_source_table_0 cte_source_table_0 | ||
) | ||
|
||
, cte_1 AS ( | ||
-- cte_select_1 | ||
SELECT | ||
cte_source_table_1.col_1 | ||
FROM demo.cte_source_table_1 cte_source_table_1 | ||
) | ||
|
||
SELECT | ||
cte_0.col_0 AS col_0 | ||
, cte_1.col_1 AS col_1 | ||
FROM cte_0 cte_0 | ||
LEFT OUTER JOIN | ||
cte_1 cte_1 | ||
ON | ||
cte_0.col_0 = cte_1.col_1 |
Oops, something went wrong.