-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a new SQL expression that adds a time interval to a date/time expression. This differs from the existing time delta expression because it 1) adds instead of subtracts, and 2) accepts a SQL expression for the count instead of an integer. This will be used to build the SQL for custom granularity offset windows.
- Loading branch information
1 parent
dd0e8c3
commit 728474d
Showing
15 changed files
with
270 additions
and
12 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
10 changes: 10 additions & 0 deletions
10
...ots/test_engine_specific_rendering.py/SqlQueryPlan/BigQuery/test_add_time_expr__plan0.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,10 @@ | ||
test_name: test_add_time_expr | ||
test_filename: test_engine_specific_rendering.py | ||
docstring: | ||
Tests rendering of the SqlAddTimeExpr in a query. | ||
sql_engine: BigQuery | ||
--- | ||
-- Test Add Time Expression | ||
SELECT | ||
DATE_ADD(CAST('2020-01-01' AS DATETIME), INTERVAL SqlExpressionRenderResult(sql='1', bind_parameter_set=SqlBindParameterSet(param_items=())) quarter) AS add_time | ||
FROM foo.bar a |
10 changes: 10 additions & 0 deletions
10
...s/test_engine_specific_rendering.py/SqlQueryPlan/Databricks/test_add_time_expr__plan0.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,10 @@ | ||
test_name: test_add_time_expr | ||
test_filename: test_engine_specific_rendering.py | ||
docstring: | ||
Tests rendering of the SqlAddTimeExpr in a query. | ||
sql_engine: Databricks | ||
--- | ||
-- Test Add Time Expression | ||
SELECT | ||
DATEADD(month, (1 * 3), '2020-01-01') AS add_time | ||
FROM foo.bar a |
10 changes: 10 additions & 0 deletions
10
...shots/test_engine_specific_rendering.py/SqlQueryPlan/DuckDB/test_add_time_expr__plan0.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,10 @@ | ||
test_name: test_add_time_expr | ||
test_filename: test_engine_specific_rendering.py | ||
docstring: | ||
Tests rendering of the SqlAddTimeExpr in a query. | ||
sql_engine: DuckDB | ||
--- | ||
-- Test Add Time Expression | ||
SELECT | ||
'2020-01-01' + INTERVAL (1 * 3) month AS add_time | ||
FROM foo.bar a |
10 changes: 10 additions & 0 deletions
10
...ots/test_engine_specific_rendering.py/SqlQueryPlan/Postgres/test_add_time_expr__plan0.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,10 @@ | ||
test_name: test_add_time_expr | ||
test_filename: test_engine_specific_rendering.py | ||
docstring: | ||
Tests rendering of the SqlAddTimeExpr in a query. | ||
sql_engine: Postgres | ||
--- | ||
-- Test Add Time Expression | ||
SELECT | ||
'2020-01-01' + MAKE_INTERVAL(months => (1 * 3)) AS add_time | ||
FROM foo.bar a |
10 changes: 10 additions & 0 deletions
10
...ots/test_engine_specific_rendering.py/SqlQueryPlan/Redshift/test_add_time_expr__plan0.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,10 @@ | ||
test_name: test_add_time_expr | ||
test_filename: test_engine_specific_rendering.py | ||
docstring: | ||
Tests rendering of the SqlAddTimeExpr in a query. | ||
sql_engine: Redshift | ||
--- | ||
-- Test Add Time Expression | ||
SELECT | ||
DATEADD(month, (1 * 3), '2020-01-01') AS add_time | ||
FROM foo.bar a |
10 changes: 10 additions & 0 deletions
10
...ts/test_engine_specific_rendering.py/SqlQueryPlan/Snowflake/test_add_time_expr__plan0.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,10 @@ | ||
test_name: test_add_time_expr | ||
test_filename: test_engine_specific_rendering.py | ||
docstring: | ||
Tests rendering of the SqlAddTimeExpr in a query. | ||
sql_engine: Snowflake | ||
--- | ||
-- Test Add Time Expression | ||
SELECT | ||
DATEADD(month, (1 * 3), '2020-01-01') AS add_time | ||
FROM foo.bar a |
Oops, something went wrong.