summaryrefslogtreecommitdiffstats
path: root/sqlglot/dialects/bigquery.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-20 08:50:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-20 08:50:35 +0000
commit6a22086850fc960715b618e82f4c2e43a4529146 (patch)
tree2005800d79fbd3b3a72ed36d10857fadd61306b7 /sqlglot/dialects/bigquery.py
parentReleasing debian version 11.1.3-1. (diff)
downloadsqlglot-6a22086850fc960715b618e82f4c2e43a4529146.tar.xz
sqlglot-6a22086850fc960715b618e82f4c2e43a4529146.zip
Merging upstream version 11.2.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/bigquery.py')
-rw-r--r--sqlglot/dialects/bigquery.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sqlglot/dialects/bigquery.py b/sqlglot/dialects/bigquery.py
index 7fd9e35..a75e802 100644
--- a/sqlglot/dialects/bigquery.py
+++ b/sqlglot/dialects/bigquery.py
@@ -13,6 +13,7 @@ from sqlglot.dialects.dialect import (
no_ilike_sql,
rename_func,
timestrtotime_sql,
+ ts_or_ds_to_date_sql,
)
from sqlglot.helper import seq_get
from sqlglot.tokens import TokenType
@@ -233,6 +234,7 @@ class BigQuery(Dialect):
exp.TimestampAdd: _date_add_sql("TIMESTAMP", "ADD"),
exp.TimestampSub: _date_add_sql("TIMESTAMP", "SUB"),
exp.TimeStrToTime: timestrtotime_sql,
+ exp.TsOrDsToDate: ts_or_ds_to_date_sql("bigquery"),
exp.PartitionedByProperty: lambda self, e: f"PARTITION BY {self.sql(e, 'this')}",
exp.VariancePop: rename_func("VAR_POP"),
exp.Values: _derived_table_values_to_unnest,