summaryrefslogtreecommitdiffstats
path: root/sqlglot/expressions.py
diff options
context:
space:
mode:
Diffstat (limited to 'sqlglot/expressions.py')
-rw-r--r--sqlglot/expressions.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/sqlglot/expressions.py b/sqlglot/expressions.py
index 061a5d1..9ce84c7 100644
--- a/sqlglot/expressions.py
+++ b/sqlglot/expressions.py
@@ -3119,22 +3119,6 @@ class Intersect(Union):
pass
-class Unnest(UDTF):
- arg_types = {
- "expressions": True,
- "alias": False,
- "offset": False,
- }
-
- @property
- def selects(self) -> t.List[Expression]:
- columns = super().selects
- offset = self.args.get("offset")
- if offset:
- columns = columns + [to_identifier("offset") if offset is True else offset]
- return columns
-
-
class Update(Expression):
arg_types = {
"with": False,
@@ -5240,6 +5224,22 @@ class PosexplodeOuter(Posexplode, ExplodeOuter):
pass
+class Unnest(Func, UDTF):
+ arg_types = {
+ "expressions": True,
+ "alias": False,
+ "offset": False,
+ }
+
+ @property
+ def selects(self) -> t.List[Expression]:
+ columns = super().selects
+ offset = self.args.get("offset")
+ if offset:
+ columns = columns + [to_identifier("offset") if offset is True else offset]
+ return columns
+
+
class Floor(Func):
arg_types = {"this": True, "decimals": False}
@@ -5765,7 +5765,7 @@ class StrPosition(Func):
class StrToDate(Func):
- arg_types = {"this": True, "format": True}
+ arg_types = {"this": True, "format": False}
class StrToTime(Func):