diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-10-16 11:37:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-10-16 11:37:35 +0000 |
commit | 45eab59f38aae326a4970767f9bc7119bef339b9 (patch) | |
tree | f5a21c1bba9fd891c923cc14206986691931ca47 /sqlglot/dialects/spark.py | |
parent | Adding upstream version 18.11.6. (diff) | |
download | sqlglot-db4da087445194e861fe774f24444394ceeb380f.tar.xz sqlglot-db4da087445194e861fe774f24444394ceeb380f.zip |
Adding upstream version 18.13.0.upstream/18.13.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglot/dialects/spark.py')
-rw-r--r-- | sqlglot/dialects/spark.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sqlglot/dialects/spark.py b/sqlglot/dialects/spark.py index 2eaa2ae..8461920 100644 --- a/sqlglot/dialects/spark.py +++ b/sqlglot/dialects/spark.py @@ -76,6 +76,9 @@ class Spark(Spark2): exp.TimestampAdd: lambda self, e: self.func( "DATEADD", e.args.get("unit") or "DAY", e.expression, e.this ), + exp.TryCast: lambda self, e: self.trycast_sql(e) + if e.args.get("safe") + else self.cast_sql(e), } TRANSFORMS.pop(exp.AnyValue) TRANSFORMS.pop(exp.DateDiff) |