diff options
Diffstat (limited to 'sqlglot/dialects/drill.py')
-rw-r--r-- | sqlglot/dialects/drill.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sqlglot/dialects/drill.py b/sqlglot/dialects/drill.py index e9c42e1..afcf4d0 100644 --- a/sqlglot/dialects/drill.py +++ b/sqlglot/dialects/drill.py @@ -14,6 +14,7 @@ from sqlglot.dialects.dialect import ( rename_func, str_position_sql, timestrtotime_sql, + ts_or_ds_to_date_sql, ) @@ -147,7 +148,7 @@ class Drill(Dialect): exp.TimeToUnix: rename_func("UNIX_TIMESTAMP"), exp.TryCast: no_trycast_sql, exp.TsOrDsAdd: lambda self, e: f"DATE_ADD(CAST({self.sql(e, 'this')} AS DATE), {self.sql(exp.Interval(this=e.expression, unit=exp.Var(this='DAY')))})", - exp.TsOrDsToDate: _ts_or_ds_to_date_sql, + exp.TsOrDsToDate: ts_or_ds_to_date_sql("drill"), exp.TsOrDiToDi: lambda self, e: f"CAST(SUBSTR(REPLACE(CAST({self.sql(e, 'this')} AS VARCHAR), '-', ''), 1, 8) AS INT)", } |