-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various sqlmesh and clickhouse updates for concurrency (#2174)
* Attempt to partition and set sorting keys * Update batch size and storage format to different tree * more engine tools * update deps * sqlmesh settings tests * camel case refactor * ensure we can run many different metrics at once * update deps again * sqlfluff upgrade fix
- Loading branch information
Showing
8 changed files
with
694 additions
and
594 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from sqlglot import expressions as exp | ||
from sqlmesh import macro | ||
from sqlmesh.core.macros import MacroEvaluator | ||
|
||
|
||
@macro() | ||
def str_to_unix_timestamp( | ||
evaluator: MacroEvaluator, | ||
time_exp: exp.Expression, | ||
): | ||
from sqlmesh.core.dialect import parse_one | ||
|
||
if evaluator.runtime_stage in ["loading", "creating"]: | ||
return parse_one("1::Uint32", dialect="clickhouse") | ||
|
||
if evaluator.engine_adapter.dialect == "duckdb": | ||
return exp.TimeToUnix( | ||
this=exp.StrToTime( | ||
this=time_exp, | ||
format=exp.Array( | ||
expressions=[exp.Literal(this="%Y-%m-%d", is_string=True)] | ||
), | ||
) | ||
) | ||
return exp.Anonymous( | ||
this="toUnixTimestamp", | ||
expressions=[time_exp], | ||
) |
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