diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-03 07:31:54 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-03 07:31:54 +0000 |
commit | b38d717d5933fdae3fe85c87df7aee9a251fb58e (patch) | |
tree | 6db21a44ffea4c832dcab29688bfaf1c1dc124f9 /sqlglot/dialects/snowflake.py | |
parent | Releasing debian version 11.4.1-1. (diff) | |
download | sqlglot-b38d717d5933fdae3fe85c87df7aee9a251fb58e.tar.xz sqlglot-b38d717d5933fdae3fe85c87df7aee9a251fb58e.zip |
Merging upstream version 11.4.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/snowflake.py')
-rw-r--r-- | sqlglot/dialects/snowflake.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sqlglot/dialects/snowflake.py b/sqlglot/dialects/snowflake.py index 799e9a6..c50961c 100644 --- a/sqlglot/dialects/snowflake.py +++ b/sqlglot/dialects/snowflake.py @@ -9,6 +9,7 @@ from sqlglot.dialects.dialect import ( datestrtodate_sql, format_time_lambda, inline_array_sql, + max_or_greatest, min_or_least, rename_func, timestamptrunc_sql, @@ -275,6 +276,9 @@ class Snowflake(Dialect): exp.ArrayConcat: rename_func("ARRAY_CAT"), exp.ArrayJoin: rename_func("ARRAY_TO_STRING"), exp.DateAdd: lambda self, e: self.func("DATEADD", e.text("unit"), e.expression, e.this), + exp.DateDiff: lambda self, e: self.func( + "DATEDIFF", e.text("unit"), e.expression, e.this + ), exp.DateStrToDate: datestrtodate_sql, exp.DataType: _datatype_sql, exp.If: rename_func("IFF"), @@ -296,6 +300,7 @@ class Snowflake(Dialect): exp.TsOrDsToDate: ts_or_ds_to_date_sql("snowflake"), exp.UnixToTime: _unix_to_time_sql, exp.DayOfWeek: rename_func("DAYOFWEEK"), + exp.Max: max_or_greatest, exp.Min: min_or_least, } @@ -314,12 +319,6 @@ class Snowflake(Dialect): exp.SetProperty: exp.Properties.Location.UNSUPPORTED, } - def ilikeany_sql(self, expression: exp.ILikeAny) -> str: - return self.binary(expression, "ILIKE ANY") - - def likeany_sql(self, expression: exp.LikeAny) -> str: - return self.binary(expression, "LIKE ANY") - def except_op(self, expression): if not expression.args.get("distinct", False): self.unsupported("EXCEPT with All is not supported in Snowflake") |