summaryrefslogtreecommitdiffstats
path: root/sqlglot/expressions.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlglot/expressions.py')
-rw-r--r--sqlglot/expressions.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/sqlglot/expressions.py b/sqlglot/expressions.py
index fdf02c8..242e66c 100644
--- a/sqlglot/expressions.py
+++ b/sqlglot/expressions.py
@@ -274,12 +274,16 @@ class Expression(metaclass=_Expression):
def set(self, arg_key: str, value: t.Any) -> None:
"""
- Sets `arg_key` to `value`.
+ Sets arg_key to value.
Args:
- arg_key (str): name of the expression arg.
+ arg_key: name of the expression arg.
value: value to set the arg to.
"""
+ if value is None:
+ self.args.pop(arg_key, None)
+ return
+
self.args[arg_key] = value
self._set_parent(arg_key, value)
@@ -2278,6 +2282,7 @@ class Table(Expression):
"pivots": False,
"hints": False,
"system_time": False,
+ "wrapped": False,
}
@property
@@ -4249,7 +4254,7 @@ class JSONArrayContains(Binary, Predicate, Func):
class Least(Func):
- arg_types = {"expressions": False}
+ arg_types = {"this": True, "expressions": False}
is_var_len_args = True
@@ -4342,6 +4347,11 @@ class MD5(Func):
_sql_names = ["MD5"]
+# Represents the variant of the MD5 function that returns a binary value
+class MD5Digest(Func):
+ _sql_names = ["MD5_DIGEST"]
+
+
class Min(AggFunc):
arg_types = {"this": True, "expressions": False}
is_var_len_args = True