diff options
Diffstat (limited to 'sqlglot/executor')
-rw-r--r-- | sqlglot/executor/env.py | 2 | ||||
-rw-r--r-- | sqlglot/executor/python.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sqlglot/executor/env.py b/sqlglot/executor/env.py index 51cffbd..d2c4e72 100644 --- a/sqlglot/executor/env.py +++ b/sqlglot/executor/env.py @@ -151,6 +151,7 @@ ENV = { "CAST": cast, "COALESCE": lambda *args: next((a for a in args if a is not None), None), "CONCAT": null_if_any(lambda *args: "".join(args)), + "SAFECONCAT": null_if_any(lambda *args: "".join(str(arg) for arg in args)), "CONCATWS": null_if_any(lambda this, *args: this.join(args)), "DATESTRTODATE": null_if_any(lambda arg: datetime.date.fromisoformat(arg)), "DIV": null_if_any(lambda e, this: e / this), @@ -159,7 +160,6 @@ ENV = { "EXTRACT": null_if_any(lambda this, e: getattr(e, this)), "GT": null_if_any(lambda this, e: this > e), "GTE": null_if_any(lambda this, e: this >= e), - "IFNULL": lambda e, alt: alt if e is None else e, "IF": lambda predicate, true, false: true if predicate else false, "INTDIV": null_if_any(lambda e, this: e // this), "INTERVAL": interval, diff --git a/sqlglot/executor/python.py b/sqlglot/executor/python.py index f114e5c..3f96f90 100644 --- a/sqlglot/executor/python.py +++ b/sqlglot/executor/python.py @@ -394,7 +394,7 @@ def _lambda_sql(self, e: exp.Lambda) -> str: names = {e.name.lower() for e in e.expressions} e = e.transform( - lambda n: exp.Var(this=n.name) + lambda n: exp.var(n.name) if isinstance(n, exp.Identifier) and n.name.lower() in names else n ) |