sqlglot.expressions API documentation

Edit on GitHub

## Expressions

Every AST node in SQLGlot is represented by a subclass of `Expression`.

This module contains the implementation of all supported `Expression` types. Additionally, it exposes a number of helper functions, which are mainly used to programmatically build SQL expressions, such as `sqlglot.expressions.select`.

View Source

       1"""
       2## Expressions
       3
       4Every AST node in SQLGlot is represented by a subclass of `Expression`.
       5
       6This module contains the implementation of all supported `Expression` types. Additionally,
       7it exposes a number of helper functions, which are mainly used to programmatically build
       8SQL expressions, such as `sqlglot.expressions.select`.
       9
      10----
      11"""
      12
      13from __future__ import annotations
      14
      15import datetime
      16import math
      17import numbers
      18import re
      19import textwrap
      20import typing as t
      21from collections import deque
      22from copy import deepcopy
      23from decimal import Decimal
      24from enum import auto
      25from functools import reduce
      26
      27from sqlglot.errors import ErrorLevel, ParseError
      28from sqlglot.helper import (
      29    AutoName,
      30    camel_to_snake_case,
      31    ensure_collection,
      32    ensure_list,
      33    seq_get,
      34    split_num_words,
      35    subclasses,
      36    to_bool,
      37)
      38from sqlglot.tokens import Token, TokenError
      39
      40if t.TYPE_CHECKING:
      41    from typing_extensions import Self
      42
      43    from sqlglot._typing import E, Lit
      44    from sqlglot.dialects.dialect import DialectType
      45
      46    Q = t.TypeVar("Q", bound="Query")
      47    S = t.TypeVar("S", bound="SetOperation")
      48
      49
      50class _Expression(type):
      51    def __new__(cls, clsname, bases, attrs):
      52        klass = super().__new__(cls, clsname, bases, attrs)
      53
      54        # When an Expression class is created, its key is automatically set
      55        # to be the lowercase version of the class' name.
      56        klass.key = clsname.lower()
      57
      58        # This is so that docstrings are not inherited in pdoc
      59        klass.__doc__ = klass.__doc__ or ""
      60
      61        return klass
      62
      63
      64SQLGLOT_META = "sqlglot.meta"
      65SQLGLOT_ANONYMOUS = "sqlglot.anonymous"
      66TABLE_PARTS = ("this", "db", "catalog")
      67COLUMN_PARTS = ("this", "table", "db", "catalog")
      68POSITION_META_KEYS = ("line", "col", "start", "end")
      69
      70
      71class Expression(metaclass=_Expression):
      72    """
      73    The base class for all expressions in a syntax tree. Each Expression encapsulates any necessary
      74    context, such as its child expressions, their names (arg keys), and whether a given child expression
      75    is optional or not.
      76
      77    Attributes:
      78        key: a unique key for each class in the Expression hierarchy. This is useful for hashing
      79            and representing expressions as strings.
      80        arg_types: determines the arguments (child nodes) supported by an expression. It maps
      81            arg keys to booleans that indicate whether the corresponding args are optional.
      82        parent: a reference to the parent expression (or None, in case of root expressions).
      83        arg_key: the arg key an expression is associated with, i.e. the name its parent expression
      84            uses to refer to it.
      85        index: the index of an expression if it is inside of a list argument in its parent.
      86        comments: a list of comments that are associated with a given expression. This is used in
      87            order to preserve comments when transpiling SQL code.
      88        type: the `sqlglot.expressions.DataType` type of an expression. This is inferred by the
      89            optimizer, in order to enable some transformations that require type information.
      90        meta: a dictionary that can be used to store useful metadata for a given expression.
      91
      92    Example:
      93        >>> class Foo(Expression):
      94        ...     arg_types = {"this": True, "expression": False}
      95
      96        The above definition informs us that Foo is an Expression that requires an argument called
      97        "this" and may also optionally receive an argument called "expression".
      98
      99    Args:
     100        args: a mapping used for retrieving the arguments of an expression, given their arg keys.
     101    """
     102
     103    key = "expression"
     104    arg_types = {"this": True}
     105    __slots__ = ("args", "parent", "arg_key", "index", "comments", "_type", "_meta", "_hash")
     106
     107    def __init__(self, **args: t.Any):
     108        self.args: t.Dict[str, t.Any] = args
     109        self.parent: t.Optional[Expression] = None
     110        self.arg_key: t.Optional[str] = None
     111        self.index: t.Optional[int] = None
     112        self.comments: t.Optional[t.List[str]] = None
     113        self._type: t.Optional[DataType] = None
     114        self._meta: t.Optional[t.Dict[str, t.Any]] = None
     115        self._hash: t.Optional[int] = None
     116
     117        for arg_key, value in self.args.items():
     118            self._set_parent(arg_key, value)
     119
     120    def __eq__(self, other) -> bool:
     121        return type(self) is type(other) and hash(self) == hash(other)
     122
     123    @property
     124    def hashable_args(self) -> t.Any:
     125        return frozenset(
     126            (k, tuple(_norm_arg(a) for a in v) if type(v) is list else _norm_arg(v))
     127            for k, v in self.args.items()
     128            if not (v is None or v is False or (type(v) is list and not v))
     129        )
     130
     131    def __hash__(self) -> int:
     132        if self._hash is not None:
     133            return self._hash
     134
     135        return hash((self.__class__, self.hashable_args))
     136
     137    def __reduce__(self) -> t.Tuple[t.Callable, t.Tuple[t.List[t.Dict[str, t.Any]]]]:
     138        from sqlglot.serde import dump, load
     139
     140        return (load, (dump(self),))
     141
     142    @property
     143    def this(self) -> t.Any:
     144        """
     145        Retrieves the argument with key "this".
     146        """
     147        return self.args.get("this")
     148
     149    @property
     150    def expression(self) -> t.Any:
     151        """
     152        Retrieves the argument with key "expression".
     153        """
     154        return self.args.get("expression")
     155
     156    @property
     157    def expressions(self) -> t.List[t.Any]:
     158        """
     159        Retrieves the argument with key "expressions".
     160        """
     161        return self.args.get("expressions") or []
     162
     163    def text(self, key) -> str:
     164        """
     165        Returns a textual representation of the argument corresponding to "key". This can only be used
     166        for args that are strings or leaf Expression instances, such as identifiers and literals.
     167        """
     168        field = self.args.get(key)
     169        if isinstance(field, str):
     170            return field
     171        if isinstance(field, (Identifier, Literal, Var)):
     172            return field.this
     173        if isinstance(field, (Star, Null)):
     174            return field.name
     175        return ""
     176
     177    @property
     178    def is_string(self) -> bool:
     179        """
     180        Checks whether a Literal expression is a string.
     181        """
     182        return isinstance(self, Literal) and self.args["is_string"]
     183
     184    @property
     185    def is_number(self) -> bool:
     186        """
     187        Checks whether a Literal expression is a number.
     188        """
     189        return (isinstance(self, Literal) and not self.args["is_string"]) or (
     190            isinstance(self, Neg) and self.this.is_number
     191        )
     192
     193    def to_py(self) -> t.Any:
     194        """
     195        Returns a Python object equivalent of the SQL node.
     196        """
     197        raise ValueError(f"{self} cannot be converted to a Python object.")
     198
     199    @property
     200    def is_int(self) -> bool:
     201        """
     202        Checks whether an expression is an integer.
     203        """
     204        return self.is_number and isinstance(self.to_py(), int)
     205
     206    @property
     207    def is_star(self) -> bool:
     208        """Checks whether an expression is a star."""
     209        return isinstance(self, Star) or (isinstance(self, Column) and isinstance(self.this, Star))
     210
     211    @property
     212    def alias(self) -> str:
     213        """
     214        Returns the alias of the expression, or an empty string if it's not aliased.
     215        """
     216        if isinstance(self.args.get("alias"), TableAlias):
     217            return self.args["alias"].name
     218        return self.text("alias")
     219
     220    @property
     221    def alias_column_names(self) -> t.List[str]:
     222        table_alias = self.args.get("alias")
     223        if not table_alias:
     224            return []
     225        return [c.name for c in table_alias.args.get("columns") or []]
     226
     227    @property
     228    def name(self) -> str:
     229        return self.text("this")
     230
     231    @property
     232    def alias_or_name(self) -> str:
     233        return self.alias or self.name
     234
     235    @property
     236    def output_name(self) -> str:
     237        """
     238        Name of the output column if this expression is a selection.
     239
     240        If the Expression has no output name, an empty string is returned.
     241
     242        Example:
     243            >>> from sqlglot import parse_one
     244            >>> parse_one("SELECT a").expressions[0].output_name
     245            'a'
     246            >>> parse_one("SELECT b AS c").expressions[0].output_name
     247            'c'
     248            >>> parse_one("SELECT 1 + 2").expressions[0].output_name
     249            ''
     250        """
     251        return ""
     252
     253    @property
     254    def type(self) -> t.Optional[DataType]:
     255        return self._type
     256
     257    @type.setter
     258    def type(self, dtype: t.Optional[DataType | DataType.Type | str]) -> None:
     259        if dtype and not isinstance(dtype, DataType):
     260            dtype = DataType.build(dtype)
     261        self._type = dtype  # type: ignore
     262
     263    def is_type(self, *dtypes) -> bool:
     264        return self.type is not None and self.type.is_type(*dtypes)
     265
     266    def is_leaf(self) -> bool:
     267        return not any(isinstance(v, (Expression, list)) and v for v in self.args.values())
     268
     269    @property
     270    def meta(self) -> t.Dict[str, t.Any]:
     271        if self._meta is None:
     272            self._meta = {}
     273        return self._meta
     274
     275    def __deepcopy__(self, memo):
     276        root = self.__class__()
     277        stack = [(self, root)]
     278
     279        while stack:
     280            node, copy = stack.pop()
     281
     282            if node.comments is not None:
     283                copy.comments = deepcopy(node.comments)
     284            if node._type is not None:
     285                copy._type = deepcopy(node._type)
     286            if node._meta is not None:
     287                copy._meta = deepcopy(node._meta)
     288            if node._hash is not None:
     289                copy._hash = node._hash
     290
     291            for k, vs in node.args.items():
     292                if hasattr(vs, "parent"):
     293                    stack.append((vs, vs.__class__()))
     294                    copy.set(k, stack[-1][-1])
     295                elif type(vs) is list:
     296                    copy.args[k] = []
     297
     298                    for v in vs:
     299                        if hasattr(v, "parent"):
     300                            stack.append((v, v.__class__()))
     301                            copy.append(k, stack[-1][-1])
     302                        else:
     303                            copy.append(k, v)
     304                else:
     305                    copy.args[k] = vs
     306
     307        return root
     308
     309    def copy(self) -> Self:
     310        """
     311        Returns a deep copy of the expression.
     312        """
     313        return deepcopy(self)
     314
     315    def add_comments(self, comments: t.Optional[t.List[str]] = None, prepend: bool = False) -> None:
     316        if self.comments is None:
     317            self.comments = []
     318
     319        if comments:
     320            for comment in comments:
     321                _, *meta = comment.split(SQLGLOT_META)
     322                if meta:
     323                    for kv in "".join(meta).split(","):
     324                        k, *v = kv.split("=")
     325                        value = v[0].strip() if v else True
     326                        self.meta[k.strip()] = to_bool(value)
     327
     328                if not prepend:
     329                    self.comments.append(comment)
     330
     331            if prepend:
     332                self.comments = comments + self.comments
     333
     334    def pop_comments(self) -> t.List[str]:
     335        comments = self.comments or []
     336        self.comments = None
     337        return comments
     338
     339    def append(self, arg_key: str, value: t.Any) -> None:
     340        """
     341        Appends value to arg_key if it's a list or sets it as a new list.
     342
     343        Args:
     344            arg_key (str): name of the list expression arg
     345            value (Any): value to append to the list
     346        """
     347        if type(self.args.get(arg_key)) is not list:
     348            self.args[arg_key] = []
     349        self._set_parent(arg_key, value)
     350        values = self.args[arg_key]
     351        if hasattr(value, "parent"):
     352            value.index = len(values)
     353        values.append(value)
     354
     355    def set(
     356        self,
     357        arg_key: str,
     358        value: t.Any,
     359        index: t.Optional[int] = None,
     360        overwrite: bool = True,
     361    ) -> None:
     362        """
     363        Sets arg_key to value.
     364
     365        Args:
     366            arg_key: name of the expression arg.
     367            value: value to set the arg to.
     368            index: if the arg is a list, this specifies what position to add the value in it.
     369            overwrite: assuming an index is given, this determines whether to overwrite the
     370                list entry instead of only inserting a new value (i.e., like list.insert).
     371        """
     372        if index is not None:
     373            expressions = self.args.get(arg_key) or []
     374
     375            if seq_get(expressions, index) is None:
     376                return
     377            if value is None:
     378                expressions.pop(index)
     379                for v in expressions[index:]:
     380                    v.index = v.index - 1
     381                return
     382
     383            if isinstance(value, list):
     384                expressions.pop(index)
     385                expressions[index:index] = value
     386            elif overwrite:
     387                expressions[index] = value
     388            else:
     389                expressions.insert(index, value)
     390
     391            value = expressions
     392        elif value is None:
     393            self.args.pop(arg_key, None)
     394            return
     395
     396        self.args[arg_key] = value
     397        self._set_parent(arg_key, value, index)
     398
     399    def _set_parent(self, arg_key: str, value: t.Any, index: t.Optional[int] = None) -> None:
     400        if hasattr(value, "parent"):
     401            value.parent = self
     402            value.arg_key = arg_key
     403            value.index = index
     404        elif type(value) is list:
     405            for index, v in enumerate(value):
     406                if hasattr(v, "parent"):
     407                    v.parent = self
     408                    v.arg_key = arg_key
     409                    v.index = index
     410
     411    @property
     412    def depth(self) -> int:
     413        """
     414        Returns the depth of this tree.
     415        """
     416        if self.parent:
     417            return self.parent.depth + 1
     418        return 0
     419
     420    def iter_expressions(self, reverse: bool = False) -> t.Iterator[Expression]:
     421        """Yields the key and expression for all arguments, exploding list args."""
     422        for vs in reversed(self.args.values()) if reverse else self.args.values():  # type: ignore
     423            if type(vs) is list:
     424                for v in reversed(vs) if reverse else vs:  # type: ignore
     425                    if hasattr(v, "parent"):
     426                        yield v
     427            else:
     428                if hasattr(vs, "parent"):
     429                    yield vs
     430
     431    def find(self, *expression_types: t.Type[E], bfs: bool = True) -> t.Optional[E]:
     432        """
     433        Returns the first node in this tree which matches at least one of
     434        the specified types.
     435
     436        Args:
     437            expression_types: the expression type(s) to match.
     438            bfs: whether to search the AST using the BFS algorithm (DFS is used if false).
     439
     440        Returns:
     441            The node which matches the criteria or None if no such node was found.
     442        """
     443        return next(self.find_all(*expression_types, bfs=bfs), None)
     444
     445    def find_all(self, *expression_types: t.Type[E], bfs: bool = True) -> t.Iterator[E]:
     446        """
     447        Returns a generator object which visits all nodes in this tree and only
     448        yields those that match at least one of the specified expression types.
     449
     450        Args:
     451            expression_types: the expression type(s) to match.
     452            bfs: whether to search the AST using the BFS algorithm (DFS is used if false).
     453
     454        Returns:
     455            The generator object.
     456        """
     457        for expression in self.walk(bfs=bfs):
     458            if isinstance(expression, expression_types):
     459                yield expression
     460
     461    def find_ancestor(self, *expression_types: t.Type[E]) -> t.Optional[E]:
     462        """
     463        Returns a nearest parent matching expression_types.
     464
     465        Args:
     466            expression_types: the expression type(s) to match.
     467
     468        Returns:
     469            The parent node.
     470        """
     471        ancestor = self.parent
     472        while ancestor and not isinstance(ancestor, expression_types):
     473            ancestor = ancestor.parent
     474        return ancestor  # type: ignore
     475
     476    @property
     477    def parent_select(self) -> t.Optional[Select]:
     478        """
     479        Returns the parent select statement.
     480        """
     481        return self.find_ancestor(Select)
     482
     483    @property
     484    def same_parent(self) -> bool:
     485        """Returns if the parent is the same class as itself."""
     486        return type(self.parent) is self.__class__
     487
     488    def root(self) -> Expression:
     489        """
     490        Returns the root expression of this tree.
     491        """
     492        expression = self
     493        while expression.parent:
     494            expression = expression.parent
     495        return expression
     496
     497    def walk(
     498        self, bfs: bool = True, prune: t.Optional[t.Callable[[Expression], bool]] = None
     499    ) -> t.Iterator[Expression]:
     500        """
     501        Returns a generator object which visits all nodes in this tree.
     502
     503        Args:
     504            bfs: if set to True the BFS traversal order will be applied,
     505                otherwise the DFS traversal will be used instead.
     506            prune: callable that returns True if the generator should stop traversing
     507                this branch of the tree.
     508
     509        Returns:
     510            the generator object.
     511        """
     512        if bfs:
     513            yield from self.bfs(prune=prune)
     514        else:
     515            yield from self.dfs(prune=prune)
     516
     517    def dfs(
     518        self, prune: t.Optional[t.Callable[[Expression], bool]] = None
     519    ) -> t.Iterator[Expression]:
     520        """
     521        Returns a generator object which visits all nodes in this tree in
     522        the DFS (Depth-first) order.
     523
     524        Returns:
     525            The generator object.
     526        """
     527        stack = [self]
     528
     529        while stack:
     530            node = stack.pop()
     531
     532            yield node
     533
     534            if prune and prune(node):
     535                continue
     536
     537            for v in node.iter_expressions(reverse=True):
     538                stack.append(v)
     539
     540    def bfs(
     541        self, prune: t.Optional[t.Callable[[Expression], bool]] = None
     542    ) -> t.Iterator[Expression]:
     543        """
     544        Returns a generator object which visits all nodes in this tree in
     545        the BFS (Breadth-first) order.
     546
     547        Returns:
     548            The generator object.
     549        """
     550        queue = deque([self])
     551
     552        while queue:
     553            node = queue.popleft()
     554
     555            yield node
     556
     557            if prune and prune(node):
     558                continue
     559
     560            for v in node.iter_expressions():
     561                queue.append(v)
     562
     563    def unnest(self):
     564        """
     565        Returns the first non parenthesis child or self.
     566        """
     567        expression = self
     568        while type(expression) is Paren:
     569            expression = expression.this
     570        return expression
     571
     572    def unalias(self):
     573        """
     574        Returns the inner expression if this is an Alias.
     575        """
     576        if isinstance(self, Alias):
     577            return self.this
     578        return self
     579
     580    def unnest_operands(self):
     581        """
     582        Returns unnested operands as a tuple.
     583        """
     584        return tuple(arg.unnest() for arg in self.iter_expressions())
     585
     586    def flatten(self, unnest=True):
     587        """
     588        Returns a generator which yields child nodes whose parents are the same class.
     589
     590        A AND B AND C -> [A, B, C]
     591        """
     592        for node in self.dfs(prune=lambda n: n.parent and type(n) is not self.__class__):
     593            if type(node) is not self.__class__:
     594                yield node.unnest() if unnest and not isinstance(node, Subquery) else node
     595
     596    def __str__(self) -> str:
     597        return self.sql()
     598
     599    def __repr__(self) -> str:
     600        return _to_s(self)
     601
     602    def to_s(self) -> str:
     603        """
     604        Same as __repr__, but includes additional information which can be useful
     605        for debugging, like empty or missing args and the AST nodes' object IDs.
     606        """
     607        return _to_s(self, verbose=True)
     608
     609    def sql(self, dialect: DialectType = None, **opts) -> str:
     610        """
     611        Returns SQL string representation of this tree.
     612
     613        Args:
     614            dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").
     615            opts: other `sqlglot.generator.Generator` options.
     616
     617        Returns:
     618            The SQL string.
     619        """
     620        from sqlglot.dialects import Dialect
     621
     622        return Dialect.get_or_raise(dialect).generate(self, **opts)
     623
     624    def transform(self, fun: t.Callable, *args: t.Any, copy: bool = True, **kwargs) -> Expression:
     625        """
     626        Visits all tree nodes (excluding already transformed ones)
     627        and applies the given transformation function to each node.
     628
     629        Args:
     630            fun: a function which takes a node as an argument and returns a
     631                new transformed node or the same node without modifications. If the function
     632                returns None, then the corresponding node will be removed from the syntax tree.
     633            copy: if set to True a new tree instance is constructed, otherwise the tree is
     634                modified in place.
     635
     636        Returns:
     637            The transformed tree.
     638        """
     639        root = None
     640        new_node = None
     641
     642        for node in (self.copy() if copy else self).dfs(prune=lambda n: n is not new_node):
     643            parent, arg_key, index = node.parent, node.arg_key, node.index
     644            new_node = fun(node, *args, **kwargs)
     645
     646            if not root:
     647                root = new_node
     648            elif parent and arg_key and new_node is not node:
     649                parent.set(arg_key, new_node, index)
     650
     651        assert root
     652        return root.assert_is(Expression)
     653
     654    @t.overload
     655    def replace(self, expression: E) -> E: ...
     656
     657    @t.overload
     658    def replace(self, expression: None) -> None: ...
     659
     660    def replace(self, expression):
     661        """
     662        Swap out this expression with a new expression.
     663
     664        For example::
     665
     666            >>> tree = Select().select("x").from_("tbl")
     667            >>> tree.find(Column).replace(column("y"))
     668            Column(
     669              this=Identifier(this=y, quoted=False))
     670            >>> tree.sql()
     671            'SELECT y FROM tbl'
     672
     673        Args:
     674            expression: new node
     675
     676        Returns:
     677            The new expression or expressions.
     678        """
     679        parent = self.parent
     680
     681        if not parent or parent is expression:
     682            return expression
     683
     684        key = self.arg_key
     685        value = parent.args.get(key)
     686
     687        if type(expression) is list and isinstance(value, Expression):
     688            # We are trying to replace an Expression with a list, so it's assumed that
     689            # the intention was to really replace the parent of this expression.
     690            value.parent.replace(expression)
     691        else:
     692            parent.set(key, expression, self.index)
     693
     694        if expression is not self:
     695            self.parent = None
     696            self.arg_key = None
     697            self.index = None
     698
     699        return expression
     700
     701    def pop(self: E) -> E:
     702        """
     703        Remove this expression from its AST.
     704
     705        Returns:
     706            The popped expression.
     707        """
     708        self.replace(None)
     709        return self
     710
     711    def assert_is(self, type_: t.Type[E]) -> E:
     712        """
     713        Assert that this `Expression` is an instance of `type_`.
     714
     715        If it is NOT an instance of `type_`, this raises an assertion error.
     716        Otherwise, this returns this expression.
     717
     718        Examples:
     719            This is useful for type security in chained expressions:
     720
     721            >>> import sqlglot
     722            >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()
     723            'SELECT x, z FROM y'
     724        """
     725        if not isinstance(self, type_):
     726            raise AssertionError(f"{self} is not {type_}.")
     727        return self
     728
     729    def error_messages(self, args: t.Optional[t.Sequence] = None) -> t.List[str]:
     730        """
     731        Checks if this expression is valid (e.g. all mandatory args are set).
     732
     733        Args:
     734            args: a sequence of values that were used to instantiate a Func expression. This is used
     735                to check that the provided arguments don't exceed the function argument limit.
     736
     737        Returns:
     738            A list of error messages for all possible errors that were found.
     739        """
     740        errors: t.List[str] = []
     741
     742        for k in self.args:
     743            if k not in self.arg_types:
     744                errors.append(f"Unexpected keyword: '{k}' for {self.__class__}")
     745        for k, mandatory in self.arg_types.items():
     746            v = self.args.get(k)
     747            if mandatory and (v is None or (isinstance(v, list) and not v)):
     748                errors.append(f"Required keyword: '{k}' missing for {self.__class__}")
     749
     750        if (
     751            args
     752            and isinstance(self, Func)
     753            and len(args) > len(self.arg_types)
     754            and not self.is_var_len_args
     755        ):
     756            errors.append(
     757                f"The number of provided arguments ({len(args)}) is greater than "
     758                f"the maximum number of supported arguments ({len(self.arg_types)})"
     759            )
     760
     761        return errors
     762
     763    def dump(self):
     764        """
     765        Dump this Expression to a JSON-serializable dict.
     766        """
     767        from sqlglot.serde import dump
     768
     769        return dump(self)
     770
     771    @classmethod
     772    def load(cls, obj):
     773        """
     774        Load a dict (as returned by `Expression.dump`) into an Expression instance.
     775        """
     776        from sqlglot.serde import load
     777
     778        return load(obj)
     779
     780    def and_(
     781        self,
     782        *expressions: t.Optional[ExpOrStr],
     783        dialect: DialectType = None,
     784        copy: bool = True,
     785        wrap: bool = True,
     786        **opts,
     787    ) -> Condition:
     788        """
     789        AND this condition with one or multiple expressions.
     790
     791        Example:
     792            >>> condition("x=1").and_("y=1").sql()
     793            'x = 1 AND y = 1'
     794
     795        Args:
     796            *expressions: the SQL code strings to parse.
     797                If an `Expression` instance is passed, it will be used as-is.
     798            dialect: the dialect used to parse the input expression.
     799            copy: whether to copy the involved expressions (only applies to Expressions).
     800            wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
     801                precedence issues, but can be turned off when the produced AST is too deep and
     802                causes recursion-related issues.
     803            opts: other options to use to parse the input expressions.
     804
     805        Returns:
     806            The new And condition.
     807        """
     808        return and_(self, *expressions, dialect=dialect, copy=copy, wrap=wrap, **opts)
     809
     810    def or_(
     811        self,
     812        *expressions: t.Optional[ExpOrStr],
     813        dialect: DialectType = None,
     814        copy: bool = True,
     815        wrap: bool = True,
     816        **opts,
     817    ) -> Condition:
     818        """
     819        OR this condition with one or multiple expressions.
     820
     821        Example:
     822            >>> condition("x=1").or_("y=1").sql()
     823            'x = 1 OR y = 1'
     824
     825        Args:
     826            *expressions: the SQL code strings to parse.
     827                If an `Expression` instance is passed, it will be used as-is.
     828            dialect: the dialect used to parse the input expression.
     829            copy: whether to copy the involved expressions (only applies to Expressions).
     830            wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
     831                precedence issues, but can be turned off when the produced AST is too deep and
     832                causes recursion-related issues.
     833            opts: other options to use to parse the input expressions.
     834
     835        Returns:
     836            The new Or condition.
     837        """
     838        return or_(self, *expressions, dialect=dialect, copy=copy, wrap=wrap, **opts)
     839
     840    def not_(self, copy: bool = True):
     841        """
     842        Wrap this condition with NOT.
     843
     844        Example:
     845            >>> condition("x=1").not_().sql()
     846            'NOT x = 1'
     847
     848        Args:
     849            copy: whether to copy this object.
     850
     851        Returns:
     852            The new Not instance.
     853        """
     854        return not_(self, copy=copy)
     855
     856    def update_positions(
     857        self: E, other: t.Optional[Token | Expression] = None, **kwargs: t.Any
     858    ) -> E:
     859        """
     860        Update this expression with positions from a token or other expression.
     861
     862        Args:
     863            other: a token or expression to update this expression with.
     864
     865        Returns:
     866            The updated expression.
     867        """
     868        if isinstance(other, Expression):
     869            self.meta.update({k: v for k, v in other.meta.items() if k in POSITION_META_KEYS})
     870        elif other is not None:
     871            self.meta.update(
     872                {
     873                    "line": other.line,
     874                    "col": other.col,
     875                    "start": other.start,
     876                    "end": other.end,
     877                }
     878            )
     879        self.meta.update({k: v for k, v in kwargs.items() if k in POSITION_META_KEYS})
     880        return self
     881
     882    def as_(
     883        self,
     884        alias: str | Identifier,
     885        quoted: t.Optional[bool] = None,
     886        dialect: DialectType = None,
     887        copy: bool = True,
     888        **opts,
     889    ) -> Alias:
     890        return alias_(self, alias, quoted=quoted, dialect=dialect, copy=copy, **opts)
     891
     892    def _binop(self, klass: t.Type[E], other: t.Any, reverse: bool = False) -> E:
     893        this = self.copy()
     894        other = convert(other, copy=True)
     895        if not isinstance(this, klass) and not isinstance(other, klass):
     896            this = _wrap(this, Binary)
     897            other = _wrap(other, Binary)
     898        if reverse:
     899            return klass(this=other, expression=this)
     900        return klass(this=this, expression=other)
     901
     902    def __getitem__(self, other: ExpOrStr | t.Tuple[ExpOrStr]) -> Bracket:
     903        return Bracket(
     904            this=self.copy(), expressions=[convert(e, copy=True) for e in ensure_list(other)]
     905        )
     906
     907    def __iter__(self) -> t.Iterator:
     908        if "expressions" in self.arg_types:
     909            return iter(self.args.get("expressions") or [])
     910        # We define this because __getitem__ converts Expression into an iterable, which is
     911        # problematic because one can hit infinite loops if they do "for x in some_expr: ..."
     912        # See: https://peps.python.org/pep-0234/
     913        raise TypeError(f"'{self.__class__.__name__}' object is not iterable")
     914
     915    def isin(
     916        self,
     917        *expressions: t.Any,
     918        query: t.Optional[ExpOrStr] = None,
     919        unnest: t.Optional[ExpOrStr] | t.Collection[ExpOrStr] = None,
     920        copy: bool = True,
     921        **opts,
     922    ) -> In:
     923        subquery = maybe_parse(query, copy=copy, **opts) if query else None
     924        if subquery and not isinstance(subquery, Subquery):
     925            subquery = subquery.subquery(copy=False)
     926
     927        return In(
     928            this=maybe_copy(self, copy),
     929            expressions=[convert(e, copy=copy) for e in expressions],
     930            query=subquery,
     931            unnest=(
     932                Unnest(
     933                    expressions=[
     934                        maybe_parse(t.cast(ExpOrStr, e), copy=copy, **opts)
     935                        for e in ensure_list(unnest)
     936                    ]
     937                )
     938                if unnest
     939                else None
     940            ),
     941        )
     942
     943    def between(
     944        self,
     945        low: t.Any,
     946        high: t.Any,
     947        copy: bool = True,
     948        symmetric: t.Optional[bool] = None,
     949        **opts,
     950    ) -> Between:
     951        between = Between(
     952            this=maybe_copy(self, copy),
     953            low=convert(low, copy=copy, **opts),
     954            high=convert(high, copy=copy, **opts),
     955        )
     956        if symmetric is not None:
     957            between.set("symmetric", symmetric)
     958
     959        return between
     960
     961    def is_(self, other: ExpOrStr) -> Is:
     962        return self._binop(Is, other)
     963
     964    def like(self, other: ExpOrStr) -> Like:
     965        return self._binop(Like, other)
     966
     967    def ilike(self, other: ExpOrStr) -> ILike:
     968        return self._binop(ILike, other)
     969
     970    def eq(self, other: t.Any) -> EQ:
     971        return self._binop(EQ, other)
     972
     973    def neq(self, other: t.Any) -> NEQ:
     974        return self._binop(NEQ, other)
     975
     976    def rlike(self, other: ExpOrStr) -> RegexpLike:
     977        return self._binop(RegexpLike, other)
     978
     979    def div(self, other: ExpOrStr, typed: bool = False, safe: bool = False) -> Div:
     980        div = self._binop(Div, other)
     981        div.args["typed"] = typed
     982        div.args["safe"] = safe
     983        return div
     984
     985    def asc(self, nulls_first: bool = True) -> Ordered:
     986        return Ordered(this=self.copy(), nulls_first=nulls_first)
     987
     988    def desc(self, nulls_first: bool = False) -> Ordered:
     989        return Ordered(this=self.copy(), desc=True, nulls_first=nulls_first)
     990
     991    def __lt__(self, other: t.Any) -> LT:
     992        return self._binop(LT, other)
     993
     994    def __le__(self, other: t.Any) -> LTE:
     995        return self._binop(LTE, other)
     996
     997    def __gt__(self, other: t.Any) -> GT:
     998        return self._binop(GT, other)
     999
    1000    def __ge__(self, other: t.Any) -> GTE:
    1001        return self._binop(GTE, other)
    1002
    1003    def __add__(self, other: t.Any) -> Add:
    1004        return self._binop(Add, other)
    1005
    1006    def __radd__(self, other: t.Any) -> Add:
    1007        return self._binop(Add, other, reverse=True)
    1008
    1009    def __sub__(self, other: t.Any) -> Sub:
    1010        return self._binop(Sub, other)
    1011
    1012    def __rsub__(self, other: t.Any) -> Sub:
    1013        return self._binop(Sub, other, reverse=True)
    1014
    1015    def __mul__(self, other: t.Any) -> Mul:
    1016        return self._binop(Mul, other)
    1017
    1018    def __rmul__(self, other: t.Any) -> Mul:
    1019        return self._binop(Mul, other, reverse=True)
    1020
    1021    def __truediv__(self, other: t.Any) -> Div:
    1022        return self._binop(Div, other)
    1023
    1024    def __rtruediv__(self, other: t.Any) -> Div:
    1025        return self._binop(Div, other, reverse=True)
    1026
    1027    def __floordiv__(self, other: t.Any) -> IntDiv:
    1028        return self._binop(IntDiv, other)
    1029
    1030    def __rfloordiv__(self, other: t.Any) -> IntDiv:
    1031        return self._binop(IntDiv, other, reverse=True)
    1032
    1033    def __mod__(self, other: t.Any) -> Mod:
    1034        return self._binop(Mod, other)
    1035
    1036    def __rmod__(self, other: t.Any) -> Mod:
    1037        return self._binop(Mod, other, reverse=True)
    1038
    1039    def __pow__(self, other: t.Any) -> Pow:
    1040        return self._binop(Pow, other)
    1041
    1042    def __rpow__(self, other: t.Any) -> Pow:
    1043        return self._binop(Pow, other, reverse=True)
    1044
    1045    def __and__(self, other: t.Any) -> And:
    1046        return self._binop(And, other)
    1047
    1048    def __rand__(self, other: t.Any) -> And:
    1049        return self._binop(And, other, reverse=True)
    1050
    1051    def __or__(self, other: t.Any) -> Or:
    1052        return self._binop(Or, other)
    1053
    1054    def __ror__(self, other: t.Any) -> Or:
    1055        return self._binop(Or, other, reverse=True)
    1056
    1057    def __neg__(self) -> Neg:
    1058        return Neg(this=_wrap(self.copy(), Binary))
    1059
    1060    def __invert__(self) -> Not:
    1061        return not_(self.copy())
    1062
    1063
    1064IntoType = t.Union[
    1065    str,
    1066    t.Type[Expression],
    1067    t.Collection[t.Union[str, t.Type[Expression]]],
    1068]
    1069ExpOrStr = t.Union[str, Expression]
    1070
    1071
    1072class Condition(Expression):
    1073    """Logical conditions like x AND y, or simply x"""
    1074
    1075
    1076class Predicate(Condition):
    1077    """Relationships like x = y, x > 1, x >= y."""
    1078
    1079
    1080class DerivedTable(Expression):
    1081    @property
    1082    def selects(self) -> t.List[Expression]:
    1083        return self.this.selects if isinstance(self.this, Query) else []
    1084
    1085    @property
    1086    def named_selects(self) -> t.List[str]:
    1087        return [select.output_name for select in self.selects]
    1088
    1089
    1090class Query(Expression):
    1091    def subquery(self, alias: t.Optional[ExpOrStr] = None, copy: bool = True) -> Subquery:
    1092        """
    1093        Returns a `Subquery` that wraps around this query.
    1094
    1095        Example:
    1096            >>> subquery = Select().select("x").from_("tbl").subquery()
    1097            >>> Select().select("x").from_(subquery).sql()
    1098            'SELECT x FROM (SELECT x FROM tbl)'
    1099
    1100        Args:
    1101            alias: an optional alias for the subquery.
    1102            copy: if `False`, modify this expression instance in-place.
    1103        """
    1104        instance = maybe_copy(self, copy)
    1105        if not isinstance(alias, Expression):
    1106            alias = TableAlias(this=to_identifier(alias)) if alias else None
    1107
    1108        return Subquery(this=instance, alias=alias)
    1109
    1110    def limit(
    1111        self: Q, expression: ExpOrStr | int, dialect: DialectType = None, copy: bool = True, **opts
    1112    ) -> Q:
    1113        """
    1114        Adds a LIMIT clause to this query.
    1115
    1116        Example:
    1117            >>> select("1").union(select("1")).limit(1).sql()
    1118            'SELECT 1 UNION SELECT 1 LIMIT 1'
    1119
    1120        Args:
    1121            expression: the SQL code string to parse.
    1122                This can also be an integer.
    1123                If a `Limit` instance is passed, it will be used as-is.
    1124                If another `Expression` instance is passed, it will be wrapped in a `Limit`.
    1125            dialect: the dialect used to parse the input expression.
    1126            copy: if `False`, modify this expression instance in-place.
    1127            opts: other options to use to parse the input expressions.
    1128
    1129        Returns:
    1130            A limited Select expression.
    1131        """
    1132        return _apply_builder(
    1133            expression=expression,
    1134            instance=self,
    1135            arg="limit",
    1136            into=Limit,
    1137            prefix="LIMIT",
    1138            dialect=dialect,
    1139            copy=copy,
    1140            into_arg="expression",
    1141            **opts,
    1142        )
    1143
    1144    def offset(
    1145        self: Q, expression: ExpOrStr | int, dialect: DialectType = None, copy: bool = True, **opts
    1146    ) -> Q:
    1147        """
    1148        Set the OFFSET expression.
    1149
    1150        Example:
    1151            >>> Select().from_("tbl").select("x").offset(10).sql()
    1152            'SELECT x FROM tbl OFFSET 10'
    1153
    1154        Args:
    1155            expression: the SQL code string to parse.
    1156                This can also be an integer.
    1157                If a `Offset` instance is passed, this is used as-is.
    1158                If another `Expression` instance is passed, it will be wrapped in a `Offset`.
    1159            dialect: the dialect used to parse the input expression.
    1160            copy: if `False`, modify this expression instance in-place.
    1161            opts: other options to use to parse the input expressions.
    1162
    1163        Returns:
    1164            The modified Select expression.
    1165        """
    1166        return _apply_builder(
    1167            expression=expression,
    1168            instance=self,
    1169            arg="offset",
    1170            into=Offset,
    1171            prefix="OFFSET",
    1172            dialect=dialect,
    1173            copy=copy,
    1174            into_arg="expression",
    1175            **opts,
    1176        )
    1177
    1178    def order_by(
    1179        self: Q,
    1180        *expressions: t.Optional[ExpOrStr],
    1181        append: bool = True,
    1182        dialect: DialectType = None,
    1183        copy: bool = True,
    1184        **opts,
    1185    ) -> Q:
    1186        """
    1187        Set the ORDER BY expression.
    1188
    1189        Example:
    1190            >>> Select().from_("tbl").select("x").order_by("x DESC").sql()
    1191            'SELECT x FROM tbl ORDER BY x DESC'
    1192
    1193        Args:
    1194            *expressions: the SQL code strings to parse.
    1195                If a `Group` instance is passed, this is used as-is.
    1196                If another `Expression` instance is passed, it will be wrapped in a `Order`.
    1197            append: if `True`, add to any existing expressions.
    1198                Otherwise, this flattens all the `Order` expression into a single expression.
    1199            dialect: the dialect used to parse the input expression.
    1200            copy: if `False`, modify this expression instance in-place.
    1201            opts: other options to use to parse the input expressions.
    1202
    1203        Returns:
    1204            The modified Select expression.
    1205        """
    1206        return _apply_child_list_builder(
    1207            *expressions,
    1208            instance=self,
    1209            arg="order",
    1210            append=append,
    1211            copy=copy,
    1212            prefix="ORDER BY",
    1213            into=Order,
    1214            dialect=dialect,
    1215            **opts,
    1216        )
    1217
    1218    @property
    1219    def ctes(self) -> t.List[CTE]:
    1220        """Returns a list of all the CTEs attached to this query."""
    1221        with_ = self.args.get("with")
    1222        return with_.expressions if with_ else []
    1223
    1224    @property
    1225    def selects(self) -> t.List[Expression]:
    1226        """Returns the query's projections."""
    1227        raise NotImplementedError("Query objects must implement `selects`")
    1228
    1229    @property
    1230    def named_selects(self) -> t.List[str]:
    1231        """Returns the output names of the query's projections."""
    1232        raise NotImplementedError("Query objects must implement `named_selects`")
    1233
    1234    def select(
    1235        self: Q,
    1236        *expressions: t.Optional[ExpOrStr],
    1237        append: bool = True,
    1238        dialect: DialectType = None,
    1239        copy: bool = True,
    1240        **opts,
    1241    ) -> Q:
    1242        """
    1243        Append to or set the SELECT expressions.
    1244
    1245        Example:
    1246            >>> Select().select("x", "y").sql()
    1247            'SELECT x, y'
    1248
    1249        Args:
    1250            *expressions: the SQL code strings to parse.
    1251                If an `Expression` instance is passed, it will be used as-is.
    1252            append: if `True`, add to any existing expressions.
    1253                Otherwise, this resets the expressions.
    1254            dialect: the dialect used to parse the input expressions.
    1255            copy: if `False`, modify this expression instance in-place.
    1256            opts: other options to use to parse the input expressions.
    1257
    1258        Returns:
    1259            The modified Query expression.
    1260        """
    1261        raise NotImplementedError("Query objects must implement `select`")
    1262
    1263    def where(
    1264        self: Q,
    1265        *expressions: t.Optional[ExpOrStr],
    1266        append: bool = True,
    1267        dialect: DialectType = None,
    1268        copy: bool = True,
    1269        **opts,
    1270    ) -> Q:
    1271        """
    1272        Append to or set the WHERE expressions.
    1273
    1274        Examples:
    1275            >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()
    1276            "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"
    1277
    1278        Args:
    1279            *expressions: the SQL code strings to parse.
    1280                If an `Expression` instance is passed, it will be used as-is.
    1281                Multiple expressions are combined with an AND operator.
    1282            append: if `True`, AND the new expressions to any existing expression.
    1283                Otherwise, this resets the expression.
    1284            dialect: the dialect used to parse the input expressions.
    1285            copy: if `False`, modify this expression instance in-place.
    1286            opts: other options to use to parse the input expressions.
    1287
    1288        Returns:
    1289            The modified expression.
    1290        """
    1291        return _apply_conjunction_builder(
    1292            *[expr.this if isinstance(expr, Where) else expr for expr in expressions],
    1293            instance=self,
    1294            arg="where",
    1295            append=append,
    1296            into=Where,
    1297            dialect=dialect,
    1298            copy=copy,
    1299            **opts,
    1300        )
    1301
    1302    def with_(
    1303        self: Q,
    1304        alias: ExpOrStr,
    1305        as_: ExpOrStr,
    1306        recursive: t.Optional[bool] = None,
    1307        materialized: t.Optional[bool] = None,
    1308        append: bool = True,
    1309        dialect: DialectType = None,
    1310        copy: bool = True,
    1311        scalar: bool = False,
    1312        **opts,
    1313    ) -> Q:
    1314        """
    1315        Append to or set the common table expressions.
    1316
    1317        Example:
    1318            >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()
    1319            'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'
    1320
    1321        Args:
    1322            alias: the SQL code string to parse as the table name.
    1323                If an `Expression` instance is passed, this is used as-is.
    1324            as_: the SQL code string to parse as the table expression.
    1325                If an `Expression` instance is passed, it will be used as-is.
    1326            recursive: set the RECURSIVE part of the expression. Defaults to `False`.
    1327            materialized: set the MATERIALIZED part of the expression.
    1328            append: if `True`, add to any existing expressions.
    1329                Otherwise, this resets the expressions.
    1330            dialect: the dialect used to parse the input expression.
    1331            copy: if `False`, modify this expression instance in-place.
    1332            scalar: if `True`, this is a scalar common table expression.
    1333            opts: other options to use to parse the input expressions.
    1334
    1335        Returns:
    1336            The modified expression.
    1337        """
    1338        return _apply_cte_builder(
    1339            self,
    1340            alias,
    1341            as_,
    1342            recursive=recursive,
    1343            materialized=materialized,
    1344            append=append,
    1345            dialect=dialect,
    1346            copy=copy,
    1347            scalar=scalar,
    1348            **opts,
    1349        )
    1350
    1351    def union(
    1352        self, *expressions: ExpOrStr, distinct: bool = True, dialect: DialectType = None, **opts
    1353    ) -> Union:
    1354        """
    1355        Builds a UNION expression.
    1356
    1357        Example:
    1358            >>> import sqlglot
    1359            >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()
    1360            'SELECT * FROM foo UNION SELECT * FROM bla'
    1361
    1362        Args:
    1363            expressions: the SQL code strings.
    1364                If `Expression` instances are passed, they will be used as-is.
    1365            distinct: set the DISTINCT flag if and only if this is true.
    1366            dialect: the dialect used to parse the input expression.
    1367            opts: other options to use to parse the input expressions.
    1368
    1369        Returns:
    1370            The new Union expression.
    1371        """
    1372        return union(self, *expressions, distinct=distinct, dialect=dialect, **opts)
    1373
    1374    def intersect(
    1375        self, *expressions: ExpOrStr, distinct: bool = True, dialect: DialectType = None, **opts
    1376    ) -> Intersect:
    1377        """
    1378        Builds an INTERSECT expression.
    1379
    1380        Example:
    1381            >>> import sqlglot
    1382            >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()
    1383            'SELECT * FROM foo INTERSECT SELECT * FROM bla'
    1384
    1385        Args:
    1386            expressions: the SQL code strings.
    1387                If `Expression` instances are passed, they will be used as-is.
    1388            distinct: set the DISTINCT flag if and only if this is true.
    1389            dialect: the dialect used to parse the input expression.
    1390            opts: other options to use to parse the input expressions.
    1391
    1392        Returns:
    1393            The new Intersect expression.
    1394        """
    1395        return intersect(self, *expressions, distinct=distinct, dialect=dialect, **opts)
    1396
    1397    def except_(
    1398        self, *expressions: ExpOrStr, distinct: bool = True, dialect: DialectType = None, **opts
    1399    ) -> Except:
    1400        """
    1401        Builds an EXCEPT expression.
    1402
    1403        Example:
    1404            >>> import sqlglot
    1405            >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()
    1406            'SELECT * FROM foo EXCEPT SELECT * FROM bla'
    1407
    1408        Args:
    1409            expressions: the SQL code strings.
    1410                If `Expression` instance are passed, they will be used as-is.
    1411            distinct: set the DISTINCT flag if and only if this is true.
    1412            dialect: the dialect used to parse the input expression.
    1413            opts: other options to use to parse the input expressions.
    1414
    1415        Returns:
    1416            The new Except expression.
    1417        """
    1418        return except_(self, *expressions, distinct=distinct, dialect=dialect, **opts)
    1419
    1420
    1421class UDTF(DerivedTable):
    1422    @property
    1423    def selects(self) -> t.List[Expression]:
    1424        alias = self.args.get("alias")
    1425        return alias.columns if alias else []
    1426
    1427
    1428class Cache(Expression):
    1429    arg_types = {
    1430        "this": True,
    1431        "lazy": False,
    1432        "options": False,
    1433        "expression": False,
    1434    }
    1435
    1436
    1437class Uncache(Expression):
    1438    arg_types = {"this": True, "exists": False}
    1439
    1440
    1441class Refresh(Expression):
    1442    pass
    1443
    1444
    1445class DDL(Expression):
    1446    @property
    1447    def ctes(self) -> t.List[CTE]:
    1448        """Returns a list of all the CTEs attached to this statement."""
    1449        with_ = self.args.get("with")
    1450        return with_.expressions if with_ else []
    1451
    1452    @property
    1453    def selects(self) -> t.List[Expression]:
    1454        """If this statement contains a query (e.g. a CTAS), this returns the query's projections."""
    1455        return self.expression.selects if isinstance(self.expression, Query) else []
    1456
    1457    @property
    1458    def named_selects(self) -> t.List[str]:
    1459        """
    1460        If this statement contains a query (e.g. a CTAS), this returns the output
    1461        names of the query's projections.
    1462        """
    1463        return self.expression.named_selects if isinstance(self.expression, Query) else []
    1464
    1465
    1466# https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/SQL-Data-Manipulation-Language/Statement-Syntax/LOCKING-Request-Modifier/LOCKING-Request-Modifier-Syntax
    1467class LockingStatement(Expression):
    1468    arg_types = {"this": True, "expression": True}
    1469
    1470
    1471class DML(Expression):
    1472    def returning(
    1473        self,
    1474        expression: ExpOrStr,
    1475        dialect: DialectType = None,
    1476        copy: bool = True,
    1477        **opts,
    1478    ) -> "Self":
    1479        """
    1480        Set the RETURNING expression. Not supported by all dialects.
    1481
    1482        Example:
    1483            >>> delete("tbl").returning("*", dialect="postgres").sql()
    1484            'DELETE FROM tbl RETURNING *'
    1485
    1486        Args:
    1487            expression: the SQL code strings to parse.
    1488                If an `Expression` instance is passed, it will be used as-is.
    1489            dialect: the dialect used to parse the input expressions.
    1490            copy: if `False`, modify this expression instance in-place.
    1491            opts: other options to use to parse the input expressions.
    1492
    1493        Returns:
    1494            Delete: the modified expression.
    1495        """
    1496        return _apply_builder(
    1497            expression=expression,
    1498            instance=self,
    1499            arg="returning",
    1500            prefix="RETURNING",
    1501            dialect=dialect,
    1502            copy=copy,
    1503            into=Returning,
    1504            **opts,
    1505        )
    1506
    1507
    1508class Create(DDL):
    1509    arg_types = {
    1510        "with": False,
    1511        "this": True,
    1512        "kind": True,
    1513        "expression": False,
    1514        "exists": False,
    1515        "properties": False,
    1516        "replace": False,
    1517        "refresh": False,
    1518        "unique": False,
    1519        "indexes": False,
    1520        "no_schema_binding": False,
    1521        "begin": False,
    1522        "end": False,
    1523        "clone": False,
    1524        "concurrently": False,
    1525        "clustered": False,
    1526    }
    1527
    1528    @property
    1529    def kind(self) -> t.Optional[str]:
    1530        kind = self.args.get("kind")
    1531        return kind and kind.upper()
    1532
    1533
    1534class SequenceProperties(Expression):
    1535    arg_types = {
    1536        "increment": False,
    1537        "minvalue": False,
    1538        "maxvalue": False,
    1539        "cache": False,
    1540        "start": False,
    1541        "owned": False,
    1542        "options": False,
    1543    }
    1544
    1545
    1546class TruncateTable(Expression):
    1547    arg_types = {
    1548        "expressions": True,
    1549        "is_database": False,
    1550        "exists": False,
    1551        "only": False,
    1552        "cluster": False,
    1553        "identity": False,
    1554        "option": False,
    1555        "partition": False,
    1556    }
    1557
    1558
    1559# https://docs.snowflake.com/en/sql-reference/sql/create-clone
    1560# https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_table_clone_statement
    1561# https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#create_table_copy
    1562class Clone(Expression):
    1563    arg_types = {"this": True, "shallow": False, "copy": False}
    1564
    1565
    1566class Describe(Expression):
    1567    arg_types = {
    1568        "this": True,
    1569        "style": False,
    1570        "kind": False,
    1571        "expressions": False,
    1572        "partition": False,
    1573        "format": False,
    1574    }
    1575
    1576
    1577# https://duckdb.org/docs/sql/statements/attach.html#attach
    1578class Attach(Expression):
    1579    arg_types = {"this": True, "exists": False, "expressions": False}
    1580
    1581
    1582# https://duckdb.org/docs/sql/statements/attach.html#detach
    1583class Detach(Expression):
    1584    arg_types = {"this": True, "exists": False}
    1585
    1586
    1587# https://duckdb.org/docs/sql/statements/load_and_install.html
    1588class Install(Expression):
    1589    arg_types = {"this": True, "from": False, "force": False}
    1590
    1591
    1592# https://duckdb.org/docs/guides/meta/summarize.html
    1593class Summarize(Expression):
    1594    arg_types = {"this": True, "table": False}
    1595
    1596
    1597class Kill(Expression):
    1598    arg_types = {"this": True, "kind": False}
    1599
    1600
    1601class Pragma(Expression):
    1602    pass
    1603
    1604
    1605class Declare(Expression):
    1606    arg_types = {"expressions": True}
    1607
    1608
    1609class DeclareItem(Expression):
    1610    arg_types = {"this": True, "kind": False, "default": False}
    1611
    1612
    1613class Set(Expression):
    1614    arg_types = {"expressions": False, "unset": False, "tag": False}
    1615
    1616
    1617class Heredoc(Expression):
    1618    arg_types = {"this": True, "tag": False}
    1619
    1620
    1621class SetItem(Expression):
    1622    arg_types = {
    1623        "this": False,
    1624        "expressions": False,
    1625        "kind": False,
    1626        "collate": False,  # MySQL SET NAMES statement
    1627        "global": False,
    1628    }
    1629
    1630
    1631class QueryBand(Expression):
    1632    arg_types = {"this": True, "scope": False, "update": False}
    1633
    1634
    1635class Show(Expression):
    1636    arg_types = {
    1637        "this": True,
    1638        "history": False,
    1639        "terse": False,
    1640        "target": False,
    1641        "offset": False,
    1642        "starts_with": False,
    1643        "limit": False,
    1644        "from": False,
    1645        "like": False,
    1646        "where": False,
    1647        "db": False,
    1648        "scope": False,
    1649        "scope_kind": False,
    1650        "full": False,
    1651        "mutex": False,
    1652        "query": False,
    1653        "channel": False,
    1654        "global": False,
    1655        "log": False,
    1656        "position": False,
    1657        "types": False,
    1658        "privileges": False,
    1659        "for_table": False,
    1660        "for_group": False,
    1661        "for_user": False,
    1662        "for_role": False,
    1663        "into_outfile": False,
    1664        "json": False,
    1665    }
    1666
    1667
    1668class UserDefinedFunction(Expression):
    1669    arg_types = {"this": True, "expressions": False, "wrapped": False}
    1670
    1671
    1672class CharacterSet(Expression):
    1673    arg_types = {"this": True, "default": False}
    1674
    1675
    1676class RecursiveWithSearch(Expression):
    1677    arg_types = {"kind": True, "this": True, "expression": True, "using": False}
    1678
    1679
    1680class With(Expression):
    1681    arg_types = {"expressions": True, "recursive": False, "search": False}
    1682
    1683    @property
    1684    def recursive(self) -> bool:
    1685        return bool(self.args.get("recursive"))
    1686
    1687
    1688class WithinGroup(Expression):
    1689    arg_types = {"this": True, "expression": False}
    1690
    1691
    1692# clickhouse supports scalar ctes
    1693# https://clickhouse.com/docs/en/sql-reference/statements/select/with
    1694class CTE(DerivedTable):
    1695    arg_types = {
    1696        "this": True,
    1697        "alias": True,
    1698        "scalar": False,
    1699        "materialized": False,
    1700    }
    1701
    1702
    1703class ProjectionDef(Expression):
    1704    arg_types = {"this": True, "expression": True}
    1705
    1706
    1707class TableAlias(Expression):
    1708    arg_types = {"this": False, "columns": False}
    1709
    1710    @property
    1711    def columns(self):
    1712        return self.args.get("columns") or []
    1713
    1714
    1715class BitString(Condition):
    1716    pass
    1717
    1718
    1719class HexString(Condition):
    1720    arg_types = {"this": True, "is_integer": False}
    1721
    1722
    1723class ByteString(Condition):
    1724    pass
    1725
    1726
    1727class RawString(Condition):
    1728    pass
    1729
    1730
    1731class UnicodeString(Condition):
    1732    arg_types = {"this": True, "escape": False}
    1733
    1734
    1735class Column(Condition):
    1736    arg_types = {"this": True, "table": False, "db": False, "catalog": False, "join_mark": False}
    1737
    1738    @property
    1739    def table(self) -> str:
    1740        return self.text("table")
    1741
    1742    @property
    1743    def db(self) -> str:
    1744        return self.text("db")
    1745
    1746    @property
    1747    def catalog(self) -> str:
    1748        return self.text("catalog")
    1749
    1750    @property
    1751    def output_name(self) -> str:
    1752        return self.name
    1753
    1754    @property
    1755    def parts(self) -> t.List[Identifier]:
    1756        """Return the parts of a column in order catalog, db, table, name."""
    1757        return [
    1758            t.cast(Identifier, self.args[part])
    1759            for part in ("catalog", "db", "table", "this")
    1760            if self.args.get(part)
    1761        ]
    1762
    1763    def to_dot(self, include_dots: bool = True) -> Dot | Identifier:
    1764        """Converts the column into a dot expression."""
    1765        parts = self.parts
    1766        parent = self.parent
    1767
    1768        if include_dots:
    1769            while isinstance(parent, Dot):
    1770                parts.append(parent.expression)
    1771                parent = parent.parent
    1772
    1773        return Dot.build(deepcopy(parts)) if len(parts) > 1 else parts[0]
    1774
    1775
    1776class ColumnPosition(Expression):
    1777    arg_types = {"this": False, "position": True}
    1778
    1779
    1780class ColumnDef(Expression):
    1781    arg_types = {
    1782        "this": True,
    1783        "kind": False,
    1784        "constraints": False,
    1785        "exists": False,
    1786        "position": False,
    1787        "default": False,
    1788        "output": False,
    1789    }
    1790
    1791    @property
    1792    def constraints(self) -> t.List[ColumnConstraint]:
    1793        return self.args.get("constraints") or []
    1794
    1795    @property
    1796    def kind(self) -> t.Optional[DataType]:
    1797        return self.args.get("kind")
    1798
    1799
    1800class AlterColumn(Expression):
    1801    arg_types = {
    1802        "this": True,
    1803        "dtype": False,
    1804        "collate": False,
    1805        "using": False,
    1806        "default": False,
    1807        "drop": False,
    1808        "comment": False,
    1809        "allow_null": False,
    1810        "visible": False,
    1811    }
    1812
    1813
    1814# https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html
    1815class AlterIndex(Expression):
    1816    arg_types = {"this": True, "visible": True}
    1817
    1818
    1819# https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html
    1820class AlterDistStyle(Expression):
    1821    pass
    1822
    1823
    1824class AlterSortKey(Expression):
    1825    arg_types = {"this": False, "expressions": False, "compound": False}
    1826
    1827
    1828class AlterSet(Expression):
    1829    arg_types = {
    1830        "expressions": False,
    1831        "option": False,
    1832        "tablespace": False,
    1833        "access_method": False,
    1834        "file_format": False,
    1835        "copy_options": False,
    1836        "tag": False,
    1837        "location": False,
    1838        "serde": False,
    1839    }
    1840
    1841
    1842class RenameColumn(Expression):
    1843    arg_types = {"this": True, "to": True, "exists": False}
    1844
    1845
    1846class AlterRename(Expression):
    1847    pass
    1848
    1849
    1850class SwapTable(Expression):
    1851    pass
    1852
    1853
    1854class Comment(Expression):
    1855    arg_types = {
    1856        "this": True,
    1857        "kind": True,
    1858        "expression": True,
    1859        "exists": False,
    1860        "materialized": False,
    1861    }
    1862
    1863
    1864class Comprehension(Expression):
    1865    arg_types = {"this": True, "expression": True, "iterator": True, "condition": False}
    1866
    1867
    1868# https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#mergetree-table-ttl
    1869class MergeTreeTTLAction(Expression):
    1870    arg_types = {
    1871        "this": True,
    1872        "delete": False,
    1873        "recompress": False,
    1874        "to_disk": False,
    1875        "to_volume": False,
    1876    }
    1877
    1878
    1879# https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#mergetree-table-ttl
    1880class MergeTreeTTL(Expression):
    1881    arg_types = {
    1882        "expressions": True,
    1883        "where": False,
    1884        "group": False,
    1885        "aggregates": False,
    1886    }
    1887
    1888
    1889# https://dev.mysql.com/doc/refman/8.0/en/create-table.html
    1890class IndexConstraintOption(Expression):
    1891    arg_types = {
    1892        "key_block_size": False,
    1893        "using": False,
    1894        "parser": False,
    1895        "comment": False,
    1896        "visible": False,
    1897        "engine_attr": False,
    1898        "secondary_engine_attr": False,
    1899    }
    1900
    1901
    1902class ColumnConstraint(Expression):
    1903    arg_types = {"this": False, "kind": True}
    1904
    1905    @property
    1906    def kind(self) -> ColumnConstraintKind:
    1907        return self.args["kind"]
    1908
    1909
    1910class ColumnConstraintKind(Expression):
    1911    pass
    1912
    1913
    1914class AutoIncrementColumnConstraint(ColumnConstraintKind):
    1915    pass
    1916
    1917
    1918class PeriodForSystemTimeConstraint(ColumnConstraintKind):
    1919    arg_types = {"this": True, "expression": True}
    1920
    1921
    1922class CaseSpecificColumnConstraint(ColumnConstraintKind):
    1923    arg_types = {"not_": True}
    1924
    1925
    1926class CharacterSetColumnConstraint(ColumnConstraintKind):
    1927    arg_types = {"this": True}
    1928
    1929
    1930class CheckColumnConstraint(ColumnConstraintKind):
    1931    arg_types = {"this": True, "enforced": False}
    1932
    1933
    1934class ClusteredColumnConstraint(ColumnConstraintKind):
    1935    pass
    1936
    1937
    1938class CollateColumnConstraint(ColumnConstraintKind):
    1939    pass
    1940
    1941
    1942class CommentColumnConstraint(ColumnConstraintKind):
    1943    pass
    1944
    1945
    1946class CompressColumnConstraint(ColumnConstraintKind):
    1947    arg_types = {"this": False}
    1948
    1949
    1950class DateFormatColumnConstraint(ColumnConstraintKind):
    1951    arg_types = {"this": True}
    1952
    1953
    1954class DefaultColumnConstraint(ColumnConstraintKind):
    1955    pass
    1956
    1957
    1958class EncodeColumnConstraint(ColumnConstraintKind):
    1959    pass
    1960
    1961
    1962# https://www.postgresql.org/docs/current/sql-createtable.html#SQL-CREATETABLE-EXCLUDE
    1963class ExcludeColumnConstraint(ColumnConstraintKind):
    1964    pass
    1965
    1966
    1967class EphemeralColumnConstraint(ColumnConstraintKind):
    1968    arg_types = {"this": False}
    1969
    1970
    1971class WithOperator(Expression):
    1972    arg_types = {"this": True, "op": True}
    1973
    1974
    1975class GeneratedAsIdentityColumnConstraint(ColumnConstraintKind):
    1976    # this: True -> ALWAYS, this: False -> BY DEFAULT
    1977    arg_types = {
    1978        "this": False,
    1979        "expression": False,
    1980        "on_null": False,
    1981        "start": False,
    1982        "increment": False,
    1983        "minvalue": False,
    1984        "maxvalue": False,
    1985        "cycle": False,
    1986        "order": False,
    1987    }
    1988
    1989
    1990class GeneratedAsRowColumnConstraint(ColumnConstraintKind):
    1991    arg_types = {"start": False, "hidden": False}
    1992
    1993
    1994# https://dev.mysql.com/doc/refman/8.0/en/create-table.html
    1995# https://github.com/ClickHouse/ClickHouse/blob/master/src/Parsers/ParserCreateQuery.h#L646
    1996class IndexColumnConstraint(ColumnConstraintKind):
    1997    arg_types = {
    1998        "this": False,
    1999        "expressions": False,
    2000        "kind": False,
    2001        "index_type": False,
    2002        "options": False,
    2003        "expression": False,  # Clickhouse
    2004        "granularity": False,
    2005    }
    2006
    2007
    2008class InlineLengthColumnConstraint(ColumnConstraintKind):
    2009    pass
    2010
    2011
    2012class NonClusteredColumnConstraint(ColumnConstraintKind):
    2013    pass
    2014
    2015
    2016class NotForReplicationColumnConstraint(ColumnConstraintKind):
    2017    arg_types = {}
    2018
    2019
    2020# https://docs.snowflake.com/en/sql-reference/sql/create-table
    2021class MaskingPolicyColumnConstraint(ColumnConstraintKind):
    2022    arg_types = {"this": True, "expressions": False}
    2023
    2024
    2025class NotNullColumnConstraint(ColumnConstraintKind):
    2026    arg_types = {"allow_null": False}
    2027
    2028
    2029# https://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html
    2030class OnUpdateColumnConstraint(ColumnConstraintKind):
    2031    pass
    2032
    2033
    2034class PrimaryKeyColumnConstraint(ColumnConstraintKind):
    2035    arg_types = {"desc": False, "options": False}
    2036
    2037
    2038class TitleColumnConstraint(ColumnConstraintKind):
    2039    pass
    2040
    2041
    2042class UniqueColumnConstraint(ColumnConstraintKind):
    2043    arg_types = {
    2044        "this": False,
    2045        "index_type": False,
    2046        "on_conflict": False,
    2047        "nulls": False,
    2048        "options": False,
    2049    }
    2050
    2051
    2052class UppercaseColumnConstraint(ColumnConstraintKind):
    2053    arg_types: t.Dict[str, t.Any] = {}
    2054
    2055
    2056# https://docs.risingwave.com/processing/watermarks#syntax
    2057class WatermarkColumnConstraint(Expression):
    2058    arg_types = {"this": True, "expression": True}
    2059
    2060
    2061class PathColumnConstraint(ColumnConstraintKind):
    2062    pass
    2063
    2064
    2065# https://docs.snowflake.com/en/sql-reference/sql/create-table
    2066class ProjectionPolicyColumnConstraint(ColumnConstraintKind):
    2067    pass
    2068
    2069
    2070# computed column expression
    2071# https://learn.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql?view=sql-server-ver16
    2072class ComputedColumnConstraint(ColumnConstraintKind):
    2073    arg_types = {"this": True, "persisted": False, "not_null": False, "data_type": False}
    2074
    2075
    2076class Constraint(Expression):
    2077    arg_types = {"this": True, "expressions": True}
    2078
    2079
    2080class Delete(DML):
    2081    arg_types = {
    2082        "with": False,
    2083        "this": False,
    2084        "using": False,
    2085        "where": False,
    2086        "returning": False,
    2087        "limit": False,
    2088        "tables": False,  # Multiple-Table Syntax (MySQL)
    2089        "cluster": False,  # Clickhouse
    2090    }
    2091
    2092    def delete(
    2093        self,
    2094        table: ExpOrStr,
    2095        dialect: DialectType = None,
    2096        copy: bool = True,
    2097        **opts,
    2098    ) -> Delete:
    2099        """
    2100        Create a DELETE expression or replace the table on an existing DELETE expression.
    2101
    2102        Example:
    2103            >>> delete("tbl").sql()
    2104            'DELETE FROM tbl'
    2105
    2106        Args:
    2107            table: the table from which to delete.
    2108            dialect: the dialect used to parse the input expression.
    2109            copy: if `False`, modify this expression instance in-place.
    2110            opts: other options to use to parse the input expressions.
    2111
    2112        Returns:
    2113            Delete: the modified expression.
    2114        """
    2115        return _apply_builder(
    2116            expression=table,
    2117            instance=self,
    2118            arg="this",
    2119            dialect=dialect,
    2120            into=Table,
    2121            copy=copy,
    2122            **opts,
    2123        )
    2124
    2125    def where(
    2126        self,
    2127        *expressions: t.Optional[ExpOrStr],
    2128        append: bool = True,
    2129        dialect: DialectType = None,
    2130        copy: bool = True,
    2131        **opts,
    2132    ) -> Delete:
    2133        """
    2134        Append to or set the WHERE expressions.
    2135
    2136        Example:
    2137            >>> delete("tbl").where("x = 'a' OR x < 'b'").sql()
    2138            "DELETE FROM tbl WHERE x = 'a' OR x < 'b'"
    2139
    2140        Args:
    2141            *expressions: the SQL code strings to parse.
    2142                If an `Expression` instance is passed, it will be used as-is.
    2143                Multiple expressions are combined with an AND operator.
    2144            append: if `True`, AND the new expressions to any existing expression.
    2145                Otherwise, this resets the expression.
    2146            dialect: the dialect used to parse the input expressions.
    2147            copy: if `False`, modify this expression instance in-place.
    2148            opts: other options to use to parse the input expressions.
    2149
    2150        Returns:
    2151            Delete: the modified expression.
    2152        """
    2153        return _apply_conjunction_builder(
    2154            *expressions,
    2155            instance=self,
    2156            arg="where",
    2157            append=append,
    2158            into=Where,
    2159            dialect=dialect,
    2160            copy=copy,
    2161            **opts,
    2162        )
    2163
    2164
    2165class Drop(Expression):
    2166    arg_types = {
    2167        "this": False,
    2168        "kind": False,
    2169        "expressions": False,
    2170        "exists": False,
    2171        "temporary": False,
    2172        "materialized": False,
    2173        "cascade": False,
    2174        "constraints": False,
    2175        "purge": False,
    2176        "cluster": False,
    2177        "concurrently": False,
    2178    }
    2179
    2180    @property
    2181    def kind(self) -> t.Optional[str]:
    2182        kind = self.args.get("kind")
    2183        return kind and kind.upper()
    2184
    2185
    2186# https://cloud.google.com/bigquery/docs/reference/standard-sql/export-statements
    2187class Export(Expression):
    2188    arg_types = {"this": True, "connection": False, "options": True}
    2189
    2190
    2191class Filter(Expression):
    2192    arg_types = {"this": True, "expression": True}
    2193
    2194
    2195class Check(Expression):
    2196    pass
    2197
    2198
    2199class Changes(Expression):
    2200    arg_types = {"information": True, "at_before": False, "end": False}
    2201
    2202
    2203# https://docs.snowflake.com/en/sql-reference/constructs/connect-by
    2204class Connect(Expression):
    2205    arg_types = {"start": False, "connect": True, "nocycle": False}
    2206
    2207
    2208class CopyParameter(Expression):
    2209    arg_types = {"this": True, "expression": False, "expressions": False}
    2210
    2211
    2212class Copy(DML):
    2213    arg_types = {
    2214        "this": True,
    2215        "kind": True,
    2216        "files": False,
    2217        "credentials": False,
    2218        "format": False,
    2219        "params": False,
    2220    }
    2221
    2222
    2223class Credentials(Expression):
    2224    arg_types = {
    2225        "credentials": False,
    2226        "encryption": False,
    2227        "storage": False,
    2228        "iam_role": False,
    2229        "region": False,
    2230    }
    2231
    2232
    2233class Prior(Expression):
    2234    pass
    2235
    2236
    2237class Directory(Expression):
    2238    # https://spark.apache.org/docs/3.0.0-preview/sql-ref-syntax-dml-insert-overwrite-directory-hive.html
    2239    arg_types = {"this": True, "local": False, "row_format": False}
    2240
    2241
    2242class ForeignKey(Expression):
    2243    arg_types = {
    2244        "expressions": False,
    2245        "reference": False,
    2246        "delete": False,
    2247        "update": False,
    2248        "options": False,
    2249    }
    2250
    2251
    2252class ColumnPrefix(Expression):
    2253    arg_types = {"this": True, "expression": True}
    2254
    2255
    2256class PrimaryKey(Expression):
    2257    arg_types = {"expressions": True, "options": False, "include": False}
    2258
    2259
    2260# https://www.postgresql.org/docs/9.1/sql-selectinto.html
    2261# https://docs.aws.amazon.com/redshift/latest/dg/r_SELECT_INTO.html#r_SELECT_INTO-examples
    2262class Into(Expression):
    2263    arg_types = {
    2264        "this": False,
    2265        "temporary": False,
    2266        "unlogged": False,
    2267        "bulk_collect": False,
    2268        "expressions": False,
    2269    }
    2270
    2271
    2272class From(Expression):
    2273    @property
    2274    def name(self) -> str:
    2275        return self.this.name
    2276
    2277    @property
    2278    def alias_or_name(self) -> str:
    2279        return self.this.alias_or_name
    2280
    2281
    2282class Having(Expression):
    2283    pass
    2284
    2285
    2286class Hint(Expression):
    2287    arg_types = {"expressions": True}
    2288
    2289
    2290class JoinHint(Expression):
    2291    arg_types = {"this": True, "expressions": True}
    2292
    2293
    2294class Identifier(Expression):
    2295    arg_types = {"this": True, "quoted": False, "global": False, "temporary": False}
    2296
    2297    @property
    2298    def quoted(self) -> bool:
    2299        return bool(self.args.get("quoted"))
    2300
    2301    @property
    2302    def hashable_args(self) -> t.Any:
    2303        return (self.this, self.quoted)
    2304
    2305    @property
    2306    def output_name(self) -> str:
    2307        return self.name
    2308
    2309
    2310# https://www.postgresql.org/docs/current/indexes-opclass.html
    2311class Opclass(Expression):
    2312    arg_types = {"this": True, "expression": True}
    2313
    2314
    2315class Index(Expression):
    2316    arg_types = {
    2317        "this": False,
    2318        "table": False,
    2319        "unique": False,
    2320        "primary": False,
    2321        "amp": False,  # teradata
    2322        "params": False,
    2323    }
    2324
    2325
    2326class IndexParameters(Expression):
    2327    arg_types = {
    2328        "using": False,
    2329        "include": False,
    2330        "columns": False,
    2331        "with_storage": False,
    2332        "partition_by": False,
    2333        "tablespace": False,
    2334        "where": False,
    2335        "on": False,
    2336    }
    2337
    2338
    2339class Insert(DDL, DML):
    2340    arg_types = {
    2341        "hint": False,
    2342        "with": False,
    2343        "is_function": False,
    2344        "this": False,
    2345        "expression": False,
    2346        "conflict": False,
    2347        "returning": False,
    2348        "overwrite": False,
    2349        "exists": False,
    2350        "alternative": False,
    2351        "where": False,
    2352        "ignore": False,
    2353        "by_name": False,
    2354        "stored": False,
    2355        "partition": False,
    2356        "settings": False,
    2357        "source": False,
    2358    }
    2359
    2360    def with_(
    2361        self,
    2362        alias: ExpOrStr,
    2363        as_: ExpOrStr,
    2364        recursive: t.Optional[bool] = None,
    2365        materialized: t.Optional[bool] = None,
    2366        append: bool = True,
    2367        dialect: DialectType = None,
    2368        copy: bool = True,
    2369        **opts,
    2370    ) -> Insert:
    2371        """
    2372        Append to or set the common table expressions.
    2373
    2374        Example:
    2375            >>> insert("SELECT x FROM cte", "t").with_("cte", as_="SELECT * FROM tbl").sql()
    2376            'WITH cte AS (SELECT * FROM tbl) INSERT INTO t SELECT x FROM cte'
    2377
    2378        Args:
    2379            alias: the SQL code string to parse as the table name.
    2380                If an `Expression` instance is passed, this is used as-is.
    2381            as_: the SQL code string to parse as the table expression.
    2382                If an `Expression` instance is passed, it will be used as-is.
    2383            recursive: set the RECURSIVE part of the expression. Defaults to `False`.
    2384            materialized: set the MATERIALIZED part of the expression.
    2385            append: if `True`, add to any existing expressions.
    2386                Otherwise, this resets the expressions.
    2387            dialect: the dialect used to parse the input expression.
    2388            copy: if `False`, modify this expression instance in-place.
    2389            opts: other options to use to parse the input expressions.
    2390
    2391        Returns:
    2392            The modified expression.
    2393        """
    2394        return _apply_cte_builder(
    2395            self,
    2396            alias,
    2397            as_,
    2398            recursive=recursive,
    2399            materialized=materialized,
    2400            append=append,
    2401            dialect=dialect,
    2402            copy=copy,
    2403            **opts,
    2404        )
    2405
    2406
    2407class ConditionalInsert(Expression):
    2408    arg_types = {"this": True, "expression": False, "else_": False}
    2409
    2410
    2411class MultitableInserts(Expression):
    2412    arg_types = {"expressions": True, "kind": True, "source": True}
    2413
    2414
    2415class OnConflict(Expression):
    2416    arg_types = {
    2417        "duplicate": False,
    2418        "expressions": False,
    2419        "action": False,
    2420        "conflict_keys": False,
    2421        "constraint": False,
    2422        "where": False,
    2423    }
    2424
    2425
    2426class OnCondition(Expression):
    2427    arg_types = {"error": False, "empty": False, "null": False}
    2428
    2429
    2430class Returning(Expression):
    2431    arg_types = {"expressions": True, "into": False}
    2432
    2433
    2434# https://dev.mysql.com/doc/refman/8.0/en/charset-introducer.html
    2435class Introducer(Expression):
    2436    arg_types = {"this": True, "expression": True}
    2437
    2438
    2439# national char, like n'utf8'
    2440class National(Expression):
    2441    pass
    2442
    2443
    2444class LoadData(Expression):
    2445    arg_types = {
    2446        "this": True,
    2447        "local": False,
    2448        "overwrite": False,
    2449        "inpath": True,
    2450        "partition": False,
    2451        "input_format": False,
    2452        "serde": False,
    2453    }
    2454
    2455
    2456class Partition(Expression):
    2457    arg_types = {"expressions": True, "subpartition": False}
    2458
    2459
    2460class PartitionRange(Expression):
    2461    arg_types = {"this": True, "expression": False, "expressions": False}
    2462
    2463
    2464# https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#how-to-set-partition-expression
    2465class PartitionId(Expression):
    2466    pass
    2467
    2468
    2469class Fetch(Expression):
    2470    arg_types = {
    2471        "direction": False,
    2472        "count": False,
    2473        "limit_options": False,
    2474    }
    2475
    2476
    2477class Grant(Expression):
    2478    arg_types = {
    2479        "privileges": True,
    2480        "kind": False,
    2481        "securable": True,
    2482        "principals": True,
    2483        "grant_option": False,
    2484    }
    2485
    2486
    2487class Revoke(Expression):
    2488    arg_types = {**Grant.arg_types, "cascade": False}
    2489
    2490
    2491class Group(Expression):
    2492    arg_types = {
    2493        "expressions": False,
    2494        "grouping_sets": False,
    2495        "cube": False,
    2496        "rollup": False,
    2497        "totals": False,
    2498        "all": False,
    2499    }
    2500
    2501
    2502class Cube(Expression):
    2503    arg_types = {"expressions": False}
    2504
    2505
    2506class Rollup(Expression):
    2507    arg_types = {"expressions": False}
    2508
    2509
    2510class GroupingSets(Expression):
    2511    arg_types = {"expressions": True}
    2512
    2513
    2514class Lambda(Expression):
    2515    arg_types = {"this": True, "expressions": True, "colon": False}
    2516
    2517
    2518class Limit(Expression):
    2519    arg_types = {
    2520        "this": False,
    2521        "expression": True,
    2522        "offset": False,
    2523        "limit_options": False,
    2524        "expressions": False,
    2525    }
    2526
    2527
    2528class LimitOptions(Expression):
    2529    arg_types = {
    2530        "percent": False,
    2531        "rows": False,
    2532        "with_ties": False,
    2533    }
    2534
    2535
    2536class Literal(Condition):
    2537    arg_types = {"this": True, "is_string": True}
    2538
    2539    @property
    2540    def hashable_args(self) -> t.Any:
    2541        return (self.this, self.args.get("is_string"))
    2542
    2543    @classmethod
    2544    def number(cls, number) -> Literal:
    2545        return cls(this=str(number), is_string=False)
    2546
    2547    @classmethod
    2548    def string(cls, string) -> Literal:
    2549        return cls(this=str(string), is_string=True)
    2550
    2551    @property
    2552    def output_name(self) -> str:
    2553        return self.name
    2554
    2555    def to_py(self) -> int | str | Decimal:
    2556        if self.is_number:
    2557            try:
    2558                return int(self.this)
    2559            except ValueError:
    2560                return Decimal(self.this)
    2561        return self.this
    2562
    2563
    2564class Join(Expression):
    2565    arg_types = {
    2566        "this": True,
    2567        "on": False,
    2568        "side": False,
    2569        "kind": False,
    2570        "using": False,
    2571        "method": False,
    2572        "global": False,
    2573        "hint": False,
    2574        "match_condition": False,  # Snowflake
    2575        "expressions": False,
    2576        "pivots": False,
    2577    }
    2578
    2579    @property
    2580    def method(self) -> str:
    2581        return self.text("method").upper()
    2582
    2583    @property
    2584    def kind(self) -> str:
    2585        return self.text("kind").upper()
    2586
    2587    @property
    2588    def side(self) -> str:
    2589        return self.text("side").upper()
    2590
    2591    @property
    2592    def hint(self) -> str:
    2593        return self.text("hint").upper()
    2594
    2595    @property
    2596    def alias_or_name(self) -> str:
    2597        return self.this.alias_or_name
    2598
    2599    @property
    2600    def is_semi_or_anti_join(self) -> bool:
    2601        return self.kind in ("SEMI", "ANTI")
    2602
    2603    def on(
    2604        self,
    2605        *expressions: t.Optional[ExpOrStr],
    2606        append: bool = True,
    2607        dialect: DialectType = None,
    2608        copy: bool = True,
    2609        **opts,
    2610    ) -> Join:
    2611        """
    2612        Append to or set the ON expressions.
    2613
    2614        Example:
    2615            >>> import sqlglot
    2616            >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()
    2617            'JOIN x ON y = 1'
    2618
    2619        Args:
    2620            *expressions: the SQL code strings to parse.
    2621                If an `Expression` instance is passed, it will be used as-is.
    2622                Multiple expressions are combined with an AND operator.
    2623            append: if `True`, AND the new expressions to any existing expression.
    2624                Otherwise, this resets the expression.
    2625            dialect: the dialect used to parse the input expressions.
    2626            copy: if `False`, modify this expression instance in-place.
    2627            opts: other options to use to parse the input expressions.
    2628
    2629        Returns:
    2630            The modified Join expression.
    2631        """
    2632        join = _apply_conjunction_builder(
    2633            *expressions,
    2634            instance=self,
    2635            arg="on",
    2636            append=append,
    2637            dialect=dialect,
    2638            copy=copy,
    2639            **opts,
    2640        )
    2641
    2642        if join.kind == "CROSS":
    2643            join.set("kind", None)
    2644
    2645        return join
    2646
    2647    def using(
    2648        self,
    2649        *expressions: t.Optional[ExpOrStr],
    2650        append: bool = True,
    2651        dialect: DialectType = None,
    2652        copy: bool = True,
    2653        **opts,
    2654    ) -> Join:
    2655        """
    2656        Append to or set the USING expressions.
    2657
    2658        Example:
    2659            >>> import sqlglot
    2660            >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()
    2661            'JOIN x USING (foo, bla)'
    2662
    2663        Args:
    2664            *expressions: the SQL code strings to parse.
    2665                If an `Expression` instance is passed, it will be used as-is.
    2666            append: if `True`, concatenate the new expressions to the existing "using" list.
    2667                Otherwise, this resets the expression.
    2668            dialect: the dialect used to parse the input expressions.
    2669            copy: if `False`, modify this expression instance in-place.
    2670            opts: other options to use to parse the input expressions.
    2671
    2672        Returns:
    2673            The modified Join expression.
    2674        """
    2675        join = _apply_list_builder(
    2676            *expressions,
    2677            instance=self,
    2678            arg="using",
    2679            append=append,
    2680            dialect=dialect,
    2681            copy=copy,
    2682            **opts,
    2683        )
    2684
    2685        if join.kind == "CROSS":
    2686            join.set("kind", None)
    2687
    2688        return join
    2689
    2690
    2691class Lateral(UDTF):
    2692    arg_types = {
    2693        "this": True,
    2694        "view": False,
    2695        "outer": False,
    2696        "alias": False,
    2697        "cross_apply": False,  # True -> CROSS APPLY, False -> OUTER APPLY
    2698        "ordinality": False,
    2699    }
    2700
    2701
    2702# https://docs.snowflake.com/sql-reference/literals-table
    2703# https://docs.snowflake.com/en/sql-reference/functions-table#using-a-table-function
    2704class TableFromRows(UDTF):
    2705    arg_types = {
    2706        "this": True,
    2707        "alias": False,
    2708        "joins": False,
    2709        "pivots": False,
    2710        "sample": False,
    2711    }
    2712
    2713
    2714class MatchRecognizeMeasure(Expression):
    2715    arg_types = {
    2716        "this": True,
    2717        "window_frame": False,
    2718    }
    2719
    2720
    2721class MatchRecognize(Expression):
    2722    arg_types = {
    2723        "partition_by": False,
    2724        "order": False,
    2725        "measures": False,
    2726        "rows": False,
    2727        "after": False,
    2728        "pattern": False,
    2729        "define": False,
    2730        "alias": False,
    2731    }
    2732
    2733
    2734# Clickhouse FROM FINAL modifier
    2735# https://clickhouse.com/docs/en/sql-reference/statements/select/from/#final-modifier
    2736class Final(Expression):
    2737    pass
    2738
    2739
    2740class Offset(Expression):
    2741    arg_types = {"this": False, "expression": True, "expressions": False}
    2742
    2743
    2744class Order(Expression):
    2745    arg_types = {"this": False, "expressions": True, "siblings": False}
    2746
    2747
    2748# https://clickhouse.com/docs/en/sql-reference/statements/select/order-by#order-by-expr-with-fill-modifier
    2749class WithFill(Expression):
    2750    arg_types = {
    2751        "from": False,
    2752        "to": False,
    2753        "step": False,
    2754        "interpolate": False,
    2755    }
    2756
    2757
    2758# hive specific sorts
    2759# https://cwiki.apache.org/confluence/display/Hive/LanguageManual+SortBy
    2760class Cluster(Order):
    2761    pass
    2762
    2763
    2764class Distribute(Order):
    2765    pass
    2766
    2767
    2768class Sort(Order):
    2769    pass
    2770
    2771
    2772class Ordered(Expression):
    2773    arg_types = {"this": True, "desc": False, "nulls_first": True, "with_fill": False}
    2774
    2775    @property
    2776    def name(self) -> str:
    2777        return self.this.name
    2778
    2779
    2780class Property(Expression):
    2781    arg_types = {"this": True, "value": True}
    2782
    2783
    2784class GrantPrivilege(Expression):
    2785    arg_types = {"this": True, "expressions": False}
    2786
    2787
    2788class GrantPrincipal(Expression):
    2789    arg_types = {"this": True, "kind": False}
    2790
    2791
    2792class AllowedValuesProperty(Expression):
    2793    arg_types = {"expressions": True}
    2794
    2795
    2796class AlgorithmProperty(Property):
    2797    arg_types = {"this": True}
    2798
    2799
    2800class AutoIncrementProperty(Property):
    2801    arg_types = {"this": True}
    2802
    2803
    2804# https://docs.aws.amazon.com/prescriptive-guidance/latest/materialized-views-redshift/refreshing-materialized-views.html
    2805class AutoRefreshProperty(Property):
    2806    arg_types = {"this": True}
    2807
    2808
    2809class BackupProperty(Property):
    2810    arg_types = {"this": True}
    2811
    2812
    2813# https://doris.apache.org/docs/sql-manual/sql-statements/table-and-view/async-materialized-view/CREATE-ASYNC-MATERIALIZED-VIEW/
    2814class BuildProperty(Property):
    2815    arg_types = {"this": True}
    2816
    2817
    2818class BlockCompressionProperty(Property):
    2819    arg_types = {
    2820        "autotemp": False,
    2821        "always": False,
    2822        "default": False,
    2823        "manual": False,
    2824        "never": False,
    2825    }
    2826
    2827
    2828class CharacterSetProperty(Property):
    2829    arg_types = {"this": True, "default": True}
    2830
    2831
    2832class ChecksumProperty(Property):
    2833    arg_types = {"on": False, "default": False}
    2834
    2835
    2836class CollateProperty(Property):
    2837    arg_types = {"this": True, "default": False}
    2838
    2839
    2840class CopyGrantsProperty(Property):
    2841    arg_types = {}
    2842
    2843
    2844class DataBlocksizeProperty(Property):
    2845    arg_types = {
    2846        "size": False,
    2847        "units": False,
    2848        "minimum": False,
    2849        "maximum": False,
    2850        "default": False,
    2851    }
    2852
    2853
    2854class DataDeletionProperty(Property):
    2855    arg_types = {"on": True, "filter_col": False, "retention_period": False}
    2856
    2857
    2858class DefinerProperty(Property):
    2859    arg_types = {"this": True}
    2860
    2861
    2862class DistKeyProperty(Property):
    2863    arg_types = {"this": True}
    2864
    2865
    2866# https://docs.starrocks.io/docs/sql-reference/sql-statements/data-definition/CREATE_TABLE/#distribution_desc
    2867# https://doris.apache.org/docs/sql-manual/sql-statements/Data-Definition-Statements/Create/CREATE-TABLE?_highlight=create&_highlight=table#distribution_desc
    2868class DistributedByProperty(Property):
    2869    arg_types = {"expressions": False, "kind": True, "buckets": False, "order": False}
    2870
    2871
    2872class DistStyleProperty(Property):
    2873    arg_types = {"this": True}
    2874
    2875
    2876class DuplicateKeyProperty(Property):
    2877    arg_types = {"expressions": True}
    2878
    2879
    2880class EngineProperty(Property):
    2881    arg_types = {"this": True}
    2882
    2883
    2884class HeapProperty(Property):
    2885    arg_types = {}
    2886
    2887
    2888class ToTableProperty(Property):
    2889    arg_types = {"this": True}
    2890
    2891
    2892class ExecuteAsProperty(Property):
    2893    arg_types = {"this": True}
    2894
    2895
    2896class ExternalProperty(Property):
    2897    arg_types = {"this": False}
    2898
    2899
    2900class FallbackProperty(Property):
    2901    arg_types = {"no": True, "protection": False}
    2902
    2903
    2904# https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-create-table-hiveformat
    2905class FileFormatProperty(Property):
    2906    arg_types = {"this": False, "expressions": False, "hive_format": False}
    2907
    2908
    2909class CredentialsProperty(Property):
    2910    arg_types = {"expressions": True}
    2911
    2912
    2913class FreespaceProperty(Property):
    2914    arg_types = {"this": True, "percent": False}
    2915
    2916
    2917class GlobalProperty(Property):
    2918    arg_types = {}
    2919
    2920
    2921class IcebergProperty(Property):
    2922    arg_types = {}
    2923
    2924
    2925class InheritsProperty(Property):
    2926    arg_types = {"expressions": True}
    2927
    2928
    2929class InputModelProperty(Property):
    2930    arg_types = {"this": True}
    2931
    2932
    2933class OutputModelProperty(Property):
    2934    arg_types = {"this": True}
    2935
    2936
    2937class IsolatedLoadingProperty(Property):
    2938    arg_types = {"no": False, "concurrent": False, "target": False}
    2939
    2940
    2941class JournalProperty(Property):
    2942    arg_types = {
    2943        "no": False,
    2944        "dual": False,
    2945        "before": False,
    2946        "local": False,
    2947        "after": False,
    2948    }
    2949
    2950
    2951class LanguageProperty(Property):
    2952    arg_types = {"this": True}
    2953
    2954
    2955class EnviromentProperty(Property):
    2956    arg_types = {"expressions": True}
    2957
    2958
    2959# spark ddl
    2960class ClusteredByProperty(Property):
    2961    arg_types = {"expressions": True, "sorted_by": False, "buckets": True}
    2962
    2963
    2964class DictProperty(Property):
    2965    arg_types = {"this": True, "kind": True, "settings": False}
    2966
    2967
    2968class DictSubProperty(Property):
    2969    pass
    2970
    2971
    2972class DictRange(Property):
    2973    arg_types = {"this": True, "min": True, "max": True}
    2974
    2975
    2976class DynamicProperty(Property):
    2977    arg_types = {}
    2978
    2979
    2980# Clickhouse CREATE ... ON CLUSTER modifier
    2981# https://clickhouse.com/docs/en/sql-reference/distributed-ddl
    2982class OnCluster(Property):
    2983    arg_types = {"this": True}
    2984
    2985
    2986# Clickhouse EMPTY table "property"
    2987class EmptyProperty(Property):
    2988    arg_types = {}
    2989
    2990
    2991class LikeProperty(Property):
    2992    arg_types = {"this": True, "expressions": False}
    2993
    2994
    2995class LocationProperty(Property):
    2996    arg_types = {"this": True}
    2997
    2998
    2999class LockProperty(Property):
    3000    arg_types = {"this": True}
    3001
    3002
    3003class LockingProperty(Property):
    3004    arg_types = {
    3005        "this": False,
    3006        "kind": True,
    3007        "for_or_in": False,
    3008        "lock_type": True,
    3009        "override": False,
    3010    }
    3011
    3012
    3013class LogProperty(Property):
    3014    arg_types = {"no": True}
    3015
    3016
    3017class MaterializedProperty(Property):
    3018    arg_types = {"this": False}
    3019
    3020
    3021class MergeBlockRatioProperty(Property):
    3022    arg_types = {"this": False, "no": False, "default": False, "percent": False}
    3023
    3024
    3025class NoPrimaryIndexProperty(Property):
    3026    arg_types = {}
    3027
    3028
    3029class OnProperty(Property):
    3030    arg_types = {"this": True}
    3031
    3032
    3033class OnCommitProperty(Property):
    3034    arg_types = {"delete": False}
    3035
    3036
    3037class PartitionedByProperty(Property):
    3038    arg_types = {"this": True}
    3039
    3040
    3041class PartitionedByBucket(Property):
    3042    arg_types = {"this": True, "expression": True}
    3043
    3044
    3045class PartitionByTruncate(Property):
    3046    arg_types = {"this": True, "expression": True}
    3047
    3048
    3049# https://docs.starrocks.io/docs/sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE/
    3050class PartitionByRangeProperty(Property):
    3051    arg_types = {"partition_expressions": True, "create_expressions": True}
    3052
    3053
    3054# https://docs.starrocks.io/docs/table_design/data_distribution/#range-partitioning
    3055class PartitionByRangePropertyDynamic(Expression):
    3056    arg_types = {"this": False, "start": True, "end": True, "every": True}
    3057
    3058
    3059# https://doris.apache.org/docs/table-design/data-partitioning/manual-partitioning
    3060class PartitionByListProperty(Property):
    3061    arg_types = {"partition_expressions": True, "create_expressions": True}
    3062
    3063
    3064# https://doris.apache.org/docs/table-design/data-partitioning/manual-partitioning
    3065class PartitionList(Expression):
    3066    arg_types = {"this": True, "expressions": True}
    3067
    3068
    3069# https://doris.apache.org/docs/sql-manual/sql-statements/table-and-view/async-materialized-view/CREATE-ASYNC-MATERIALIZED-VIEW
    3070class RefreshTriggerProperty(Property):
    3071    arg_types = {
    3072        "method": True,
    3073        "kind": False,
    3074        "every": False,
    3075        "unit": False,
    3076        "starts": False,
    3077    }
    3078
    3079
    3080# https://docs.starrocks.io/docs/sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE/
    3081class UniqueKeyProperty(Property):
    3082    arg_types = {"expressions": True}
    3083
    3084
    3085# https://www.postgresql.org/docs/current/sql-createtable.html
    3086class PartitionBoundSpec(Expression):
    3087    # this -> IN / MODULUS, expression -> REMAINDER, from_expressions -> FROM (...), to_expressions -> TO (...)
    3088    arg_types = {
    3089        "this": False,
    3090        "expression": False,
    3091        "from_expressions": False,
    3092        "to_expressions": False,
    3093    }
    3094
    3095
    3096class PartitionedOfProperty(Property):
    3097    # this -> parent_table (schema), expression -> FOR VALUES ... / DEFAULT
    3098    arg_types = {"this": True, "expression": True}
    3099
    3100
    3101class StreamingTableProperty(Property):
    3102    arg_types = {}
    3103
    3104
    3105class RemoteWithConnectionModelProperty(Property):
    3106    arg_types = {"this": True}
    3107
    3108
    3109class ReturnsProperty(Property):
    3110    arg_types = {"this": False, "is_table": False, "table": False, "null": False}
    3111
    3112
    3113class StrictProperty(Property):
    3114    arg_types = {}
    3115
    3116
    3117class RowFormatProperty(Property):
    3118    arg_types = {"this": True}
    3119
    3120
    3121class RowFormatDelimitedProperty(Property):
    3122    # https://cwiki.apache.org/confluence/display/hive/languagemanual+dml
    3123    arg_types = {
    3124        "fields": False,
    3125        "escaped": False,
    3126        "collection_items": False,
    3127        "map_keys": False,
    3128        "lines": False,
    3129        "null": False,
    3130        "serde": False,
    3131    }
    3132
    3133
    3134class RowFormatSerdeProperty(Property):
    3135    arg_types = {"this": True, "serde_properties": False}
    3136
    3137
    3138# https://spark.apache.org/docs/3.1.2/sql-ref-syntax-qry-select-transform.html
    3139class QueryTransform(Expression):
    3140    arg_types = {
    3141        "expressions": True,
    3142        "command_script": True,
    3143        "schema": False,
    3144        "row_format_before": False,
    3145        "record_writer": False,
    3146        "row_format_after": False,
    3147        "record_reader": False,
    3148    }
    3149
    3150
    3151class SampleProperty(Property):
    3152    arg_types = {"this": True}
    3153
    3154
    3155# https://prestodb.io/docs/current/sql/create-view.html#synopsis
    3156class SecurityProperty(Property):
    3157    arg_types = {"this": True}
    3158
    3159
    3160class SchemaCommentProperty(Property):
    3161    arg_types = {"this": True}
    3162
    3163
    3164class SemanticView(Expression):
    3165    arg_types = {"this": True, "metrics": False, "dimensions": False, "where": False}
    3166
    3167
    3168class SerdeProperties(Property):
    3169    arg_types = {"expressions": True, "with": False}
    3170
    3171
    3172class SetProperty(Property):
    3173    arg_types = {"multi": True}
    3174
    3175
    3176class SharingProperty(Property):
    3177    arg_types = {"this": False}
    3178
    3179
    3180class SetConfigProperty(Property):
    3181    arg_types = {"this": True}
    3182
    3183
    3184class SettingsProperty(Property):
    3185    arg_types = {"expressions": True}
    3186
    3187
    3188class SortKeyProperty(Property):
    3189    arg_types = {"this": True, "compound": False}
    3190
    3191
    3192class SqlReadWriteProperty(Property):
    3193    arg_types = {"this": True}
    3194
    3195
    3196class SqlSecurityProperty(Property):
    3197    arg_types = {"definer": True}
    3198
    3199
    3200class StabilityProperty(Property):
    3201    arg_types = {"this": True}
    3202
    3203
    3204class StorageHandlerProperty(Property):
    3205    arg_types = {"this": True}
    3206
    3207
    3208class TemporaryProperty(Property):
    3209    arg_types = {"this": False}
    3210
    3211
    3212class SecureProperty(Property):
    3213    arg_types = {}
    3214
    3215
    3216# https://docs.snowflake.com/en/sql-reference/sql/create-table
    3217class Tags(ColumnConstraintKind, Property):
    3218    arg_types = {"expressions": True}
    3219
    3220
    3221class TransformModelProperty(Property):
    3222    arg_types = {"expressions": True}
    3223
    3224
    3225class TransientProperty(Property):
    3226    arg_types = {"this": False}
    3227
    3228
    3229class UnloggedProperty(Property):
    3230    arg_types = {}
    3231
    3232
    3233# https://docs.snowflake.com/en/sql-reference/sql/create-table#create-table-using-template
    3234class UsingTemplateProperty(Property):
    3235    arg_types = {"this": True}
    3236
    3237
    3238# https://learn.microsoft.com/en-us/sql/t-sql/statements/create-view-transact-sql?view=sql-server-ver16
    3239class ViewAttributeProperty(Property):
    3240    arg_types = {"this": True}
    3241
    3242
    3243class VolatileProperty(Property):
    3244    arg_types = {"this": False}
    3245
    3246
    3247class WithDataProperty(Property):
    3248    arg_types = {"no": True, "statistics": False}
    3249
    3250
    3251class WithJournalTableProperty(Property):
    3252    arg_types = {"this": True}
    3253
    3254
    3255class WithSchemaBindingProperty(Property):
    3256    arg_types = {"this": True}
    3257
    3258
    3259class WithSystemVersioningProperty(Property):
    3260    arg_types = {
    3261        "on": False,
    3262        "this": False,
    3263        "data_consistency": False,
    3264        "retention_period": False,
    3265        "with": True,
    3266    }
    3267
    3268
    3269class WithProcedureOptions(Property):
    3270    arg_types = {"expressions": True}
    3271
    3272
    3273class EncodeProperty(Property):
    3274    arg_types = {"this": True, "properties": False, "key": False}
    3275
    3276
    3277class IncludeProperty(Property):
    3278    arg_types = {"this": True, "alias": False, "column_def": False}
    3279
    3280
    3281class ForceProperty(Property):
    3282    arg_types = {}
    3283
    3284
    3285class Properties(Expression):
    3286    arg_types = {"expressions": True}
    3287
    3288    NAME_TO_PROPERTY = {
    3289        "ALGORITHM": AlgorithmProperty,
    3290        "AUTO_INCREMENT": AutoIncrementProperty,
    3291        "CHARACTER SET": CharacterSetProperty,
    3292        "CLUSTERED_BY": ClusteredByProperty,
    3293        "COLLATE": CollateProperty,
    3294        "COMMENT": SchemaCommentProperty,
    3295        "CREDENTIALS": CredentialsProperty,
    3296        "DEFINER": DefinerProperty,
    3297        "DISTKEY": DistKeyProperty,
    3298        "DISTRIBUTED_BY": DistributedByProperty,
    3299        "DISTSTYLE": DistStyleProperty,
    3300        "ENGINE": EngineProperty,
    3301        "EXECUTE AS": ExecuteAsProperty,
    3302        "FORMAT": FileFormatProperty,
    3303        "LANGUAGE": LanguageProperty,
    3304        "LOCATION": LocationProperty,
    3305        "LOCK": LockProperty,
    3306        "PARTITIONED_BY": PartitionedByProperty,
    3307        "RETURNS": ReturnsProperty,
    3308        "ROW_FORMAT": RowFormatProperty,
    3309        "SORTKEY": SortKeyProperty,
    3310        "ENCODE": EncodeProperty,
    3311        "INCLUDE": IncludeProperty,
    3312    }
    3313
    3314    PROPERTY_TO_NAME = {v: k for k, v in NAME_TO_PROPERTY.items()}
    3315
    3316    # CREATE property locations
    3317    # Form: schema specified
    3318    #   create [POST_CREATE]
    3319    #     table a [POST_NAME]
    3320    #     (b int) [POST_SCHEMA]
    3321    #     with ([POST_WITH])
    3322    #     index (b) [POST_INDEX]
    3323    #
    3324    # Form: alias selection
    3325    #   create [POST_CREATE]
    3326    #     table a [POST_NAME]
    3327    #     as [POST_ALIAS] (select * from b) [POST_EXPRESSION]
    3328    #     index (c) [POST_INDEX]
    3329    class Location(AutoName):
    3330        POST_CREATE = auto()
    3331        POST_NAME = auto()
    3332        POST_SCHEMA = auto()
    3333        POST_WITH = auto()
    3334        POST_ALIAS = auto()
    3335        POST_EXPRESSION = auto()
    3336        POST_INDEX = auto()
    3337        UNSUPPORTED = auto()
    3338
    3339    @classmethod
    3340    def from_dict(cls, properties_dict: t.Dict) -> Properties:
    3341        expressions = []
    3342        for key, value in properties_dict.items():
    3343            property_cls = cls.NAME_TO_PROPERTY.get(key.upper())
    3344            if property_cls:
    3345                expressions.append(property_cls(this=convert(value)))
    3346            else:
    3347                expressions.append(Property(this=Literal.string(key), value=convert(value)))
    3348
    3349        return cls(expressions=expressions)
    3350
    3351
    3352class Qualify(Expression):
    3353    pass
    3354
    3355
    3356class InputOutputFormat(Expression):
    3357    arg_types = {"input_format": False, "output_format": False}
    3358
    3359
    3360# https://www.ibm.com/docs/en/ias?topic=procedures-return-statement-in-sql
    3361class Return(Expression):
    3362    pass
    3363
    3364
    3365class Reference(Expression):
    3366    arg_types = {"this": True, "expressions": False, "options": False}
    3367
    3368
    3369class Tuple(Expression):
    3370    arg_types = {"expressions": False}
    3371
    3372    def isin(
    3373        self,
    3374        *expressions: t.Any,
    3375        query: t.Optional[ExpOrStr] = None,
    3376        unnest: t.Optional[ExpOrStr] | t.Collection[ExpOrStr] = None,
    3377        copy: bool = True,
    3378        **opts,
    3379    ) -> In:
    3380        return In(
    3381            this=maybe_copy(self, copy),
    3382            expressions=[convert(e, copy=copy) for e in expressions],
    3383            query=maybe_parse(query, copy=copy, **opts) if query else None,
    3384            unnest=(
    3385                Unnest(
    3386                    expressions=[
    3387                        maybe_parse(t.cast(ExpOrStr, e), copy=copy, **opts)
    3388                        for e in ensure_list(unnest)
    3389                    ]
    3390                )
    3391                if unnest
    3392                else None
    3393            ),
    3394        )
    3395
    3396
    3397QUERY_MODIFIERS = {
    3398    "match": False,
    3399    "laterals": False,
    3400    "joins": False,
    3401    "connect": False,
    3402    "pivots": False,
    3403    "prewhere": False,
    3404    "where": False,
    3405    "group": False,
    3406    "having": False,
    3407    "qualify": False,
    3408    "windows": False,
    3409    "distribute": False,
    3410    "sort": False,
    3411    "cluster": False,
    3412    "order": False,
    3413    "limit": False,
    3414    "offset": False,
    3415    "locks": False,
    3416    "sample": False,
    3417    "settings": False,
    3418    "format": False,
    3419    "options": False,
    3420}
    3421
    3422
    3423# https://learn.microsoft.com/en-us/sql/t-sql/queries/option-clause-transact-sql?view=sql-server-ver16
    3424# https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query?view=sql-server-ver16
    3425class QueryOption(Expression):
    3426    arg_types = {"this": True, "expression": False}
    3427
    3428
    3429# https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table?view=sql-server-ver16
    3430class WithTableHint(Expression):
    3431    arg_types = {"expressions": True}
    3432
    3433
    3434# https://dev.mysql.com/doc/refman/8.0/en/index-hints.html
    3435class IndexTableHint(Expression):
    3436    arg_types = {"this": True, "expressions": False, "target": False}
    3437
    3438
    3439# https://docs.snowflake.com/en/sql-reference/constructs/at-before
    3440class HistoricalData(Expression):
    3441    arg_types = {"this": True, "kind": True, "expression": True}
    3442
    3443
    3444# https://docs.snowflake.com/en/sql-reference/sql/put
    3445class Put(Expression):
    3446    arg_types = {"this": True, "target": True, "properties": False}
    3447
    3448
    3449# https://docs.snowflake.com/en/sql-reference/sql/get
    3450class Get(Expression):
    3451    arg_types = {"this": True, "target": True, "properties": False}
    3452
    3453
    3454class Table(Expression):
    3455    arg_types = {
    3456        "this": False,
    3457        "alias": False,
    3458        "db": False,
    3459        "catalog": False,
    3460        "laterals": False,
    3461        "joins": False,
    3462        "pivots": False,
    3463        "hints": False,
    3464        "system_time": False,
    3465        "version": False,
    3466        "format": False,
    3467        "pattern": False,
    3468        "ordinality": False,
    3469        "when": False,
    3470        "only": False,
    3471        "partition": False,
    3472        "changes": False,
    3473        "rows_from": False,
    3474        "sample": False,
    3475    }
    3476
    3477    @property
    3478    def name(self) -> str:
    3479        if not self.this or isinstance(self.this, Func):
    3480            return ""
    3481        return self.this.name
    3482
    3483    @property
    3484    def db(self) -> str:
    3485        return self.text("db")
    3486
    3487    @property
    3488    def catalog(self) -> str:
    3489        return self.text("catalog")
    3490
    3491    @property
    3492    def selects(self) -> t.List[Expression]:
    3493        return []
    3494
    3495    @property
    3496    def named_selects(self) -> t.List[str]:
    3497        return []
    3498
    3499    @property
    3500    def parts(self) -> t.List[Expression]:
    3501        """Return the parts of a table in order catalog, db, table."""
    3502        parts: t.List[Expression] = []
    3503
    3504        for arg in ("catalog", "db", "this"):
    3505            part = self.args.get(arg)
    3506
    3507            if isinstance(part, Dot):
    3508                parts.extend(part.flatten())
    3509            elif isinstance(part, Expression):
    3510                parts.append(part)
    3511
    3512        return parts
    3513
    3514    def to_column(self, copy: bool = True) -> Expression:
    3515        parts = self.parts
    3516        last_part = parts[-1]
    3517
    3518        if isinstance(last_part, Identifier):
    3519            col: Expression = column(*reversed(parts[0:4]), fields=parts[4:], copy=copy)  # type: ignore
    3520        else:
    3521            # This branch will be reached if a function or array is wrapped in a `Table`
    3522            col = last_part
    3523
    3524        alias = self.args.get("alias")
    3525        if alias:
    3526            col = alias_(col, alias.this, copy=copy)
    3527
    3528        return col
    3529
    3530
    3531class SetOperation(Query):
    3532    arg_types = {
    3533        "with": False,
    3534        "this": True,
    3535        "expression": True,
    3536        "distinct": False,
    3537        "by_name": False,
    3538        "side": False,
    3539        "kind": False,
    3540        "on": False,
    3541        **QUERY_MODIFIERS,
    3542    }
    3543
    3544    def select(
    3545        self: S,
    3546        *expressions: t.Optional[ExpOrStr],
    3547        append: bool = True,
    3548        dialect: DialectType = None,
    3549        copy: bool = True,
    3550        **opts,
    3551    ) -> S:
    3552        this = maybe_copy(self, copy)
    3553        this.this.unnest().select(*expressions, append=append, dialect=dialect, copy=False, **opts)
    3554        this.expression.unnest().select(
    3555            *expressions, append=append, dialect=dialect, copy=False, **opts
    3556        )
    3557        return this
    3558
    3559    @property
    3560    def named_selects(self) -> t.List[str]:
    3561        return self.this.unnest().named_selects
    3562
    3563    @property
    3564    def is_star(self) -> bool:
    3565        return self.this.is_star or self.expression.is_star
    3566
    3567    @property
    3568    def selects(self) -> t.List[Expression]:
    3569        return self.this.unnest().selects
    3570
    3571    @property
    3572    def left(self) -> Query:
    3573        return self.this
    3574
    3575    @property
    3576    def right(self) -> Query:
    3577        return self.expression
    3578
    3579    @property
    3580    def kind(self) -> str:
    3581        return self.text("kind").upper()
    3582
    3583    @property
    3584    def side(self) -> str:
    3585        return self.text("side").upper()
    3586
    3587
    3588class Union(SetOperation):
    3589    pass
    3590
    3591
    3592class Except(SetOperation):
    3593    pass
    3594
    3595
    3596class Intersect(SetOperation):
    3597    pass
    3598
    3599
    3600class Update(DML):
    3601    arg_types = {
    3602        "with": False,
    3603        "this": False,
    3604        "expressions": True,
    3605        "from": False,
    3606        "where": False,
    3607        "returning": False,
    3608        "order": False,
    3609        "limit": False,
    3610    }
    3611
    3612    def table(
    3613        self, expression: ExpOrStr, dialect: DialectType = None, copy: bool = True, **opts
    3614    ) -> Update:
    3615        """
    3616        Set the table to update.
    3617
    3618        Example:
    3619            >>> Update().table("my_table").set_("x = 1").sql()
    3620            'UPDATE my_table SET x = 1'
    3621
    3622        Args:
    3623            expression : the SQL code strings to parse.
    3624                If a `Table` instance is passed, this is used as-is.
    3625                If another `Expression` instance is passed, it will be wrapped in a `Table`.
    3626            dialect: the dialect used to parse the input expression.
    3627            copy: if `False`, modify this expression instance in-place.
    3628            opts: other options to use to parse the input expressions.
    3629
    3630        Returns:
    3631            The modified Update expression.
    3632        """
    3633        return _apply_builder(
    3634            expression=expression,
    3635            instance=self,
    3636            arg="this",
    3637            into=Table,
    3638            prefix=None,
    3639            dialect=dialect,
    3640            copy=copy,
    3641            **opts,
    3642        )
    3643
    3644    def set_(
    3645        self,
    3646        *expressions: ExpOrStr,
    3647        append: bool = True,
    3648        dialect: DialectType = None,
    3649        copy: bool = True,
    3650        **opts,
    3651    ) -> Update:
    3652        """
    3653        Append to or set the SET expressions.
    3654
    3655        Example:
    3656            >>> Update().table("my_table").set_("x = 1").sql()
    3657            'UPDATE my_table SET x = 1'
    3658
    3659        Args:
    3660            *expressions: the SQL code strings to parse.
    3661                If `Expression` instance(s) are passed, they will be used as-is.
    3662                Multiple expressions are combined with a comma.
    3663            append: if `True`, add the new expressions to any existing SET expressions.
    3664                Otherwise, this resets the expressions.
    3665            dialect: the dialect used to parse the input expressions.
    3666            copy: if `False`, modify this expression instance in-place.
    3667            opts: other options to use to parse the input expressions.
    3668        """
    3669        return _apply_list_builder(
    3670            *expressions,
    3671            instance=self,
    3672            arg="expressions",
    3673            append=append,
    3674            into=Expression,
    3675            prefix=None,
    3676            dialect=dialect,
    3677            copy=copy,
    3678            **opts,
    3679        )
    3680
    3681    def where(
    3682        self,
    3683        *expressions: t.Optional[ExpOrStr],
    3684        append: bool = True,
    3685        dialect: DialectType = None,
    3686        copy: bool = True,
    3687        **opts,
    3688    ) -> Select:
    3689        """
    3690        Append to or set the WHERE expressions.
    3691
    3692        Example:
    3693            >>> Update().table("tbl").set_("x = 1").where("x = 'a' OR x < 'b'").sql()
    3694            "UPDATE tbl SET x = 1 WHERE x = 'a' OR x < 'b'"
    3695
    3696        Args:
    3697            *expressions: the SQL code strings to parse.
    3698                If an `Expression` instance is passed, it will be used as-is.
    3699                Multiple expressions are combined with an AND operator.
    3700            append: if `True`, AND the new expressions to any existing expression.
    3701                Otherwise, this resets the expression.
    3702            dialect: the dialect used to parse the input expressions.
    3703            copy: if `False`, modify this expression instance in-place.
    3704            opts: other options to use to parse the input expressions.
    3705
    3706        Returns:
    3707            Select: the modified expression.
    3708        """
    3709        return _apply_conjunction_builder(
    3710            *expressions,
    3711            instance=self,
    3712            arg="where",
    3713            append=append,
    3714            into=Where,
    3715            dialect=dialect,
    3716            copy=copy,
    3717            **opts,
    3718        )
    3719
    3720    def from_(
    3721        self,
    3722        expression: t.Optional[ExpOrStr] = None,
    3723        dialect: DialectType = None,
    3724        copy: bool = True,
    3725        **opts,
    3726    ) -> Update:
    3727        """
    3728        Set the FROM expression.
    3729
    3730        Example:
    3731            >>> Update().table("my_table").set_("x = 1").from_("baz").sql()
    3732            'UPDATE my_table SET x = 1 FROM baz'
    3733
    3734        Args:
    3735            expression : the SQL code strings to parse.
    3736                If a `From` instance is passed, this is used as-is.
    3737                If another `Expression` instance is passed, it will be wrapped in a `From`.
    3738                If nothing is passed in then a from is not applied to the expression
    3739            dialect: the dialect used to parse the input expression.
    3740            copy: if `False`, modify this expression instance in-place.
    3741            opts: other options to use to parse the input expressions.
    3742
    3743        Returns:
    3744            The modified Update expression.
    3745        """
    3746        if not expression:
    3747            return maybe_copy(self, copy)
    3748
    3749        return _apply_builder(
    3750            expression=expression,
    3751            instance=self,
    3752            arg="from",
    3753            into=From,
    3754            prefix="FROM",
    3755            dialect=dialect,
    3756            copy=copy,
    3757            **opts,
    3758        )
    3759
    3760    def with_(
    3761        self,
    3762        alias: ExpOrStr,
    3763        as_: ExpOrStr,
    3764        recursive: t.Optional[bool] = None,
    3765        materialized: t.Optional[bool] = None,
    3766        append: bool = True,
    3767        dialect: DialectType = None,
    3768        copy: bool = True,
    3769        **opts,
    3770    ) -> Update:
    3771        """
    3772        Append to or set the common table expressions.
    3773
    3774        Example:
    3775            >>> Update().table("my_table").set_("x = 1").from_("baz").with_("baz", "SELECT id FROM foo").sql()
    3776            'WITH baz AS (SELECT id FROM foo) UPDATE my_table SET x = 1 FROM baz'
    3777
    3778        Args:
    3779            alias: the SQL code string to parse as the table name.
    3780                If an `Expression` instance is passed, this is used as-is.
    3781            as_: the SQL code string to parse as the table expression.
    3782                If an `Expression` instance is passed, it will be used as-is.
    3783            recursive: set the RECURSIVE part of the expression. Defaults to `False`.
    3784            materialized: set the MATERIALIZED part of the expression.
    3785            append: if `True`, add to any existing expressions.
    3786                Otherwise, this resets the expressions.
    3787            dialect: the dialect used to parse the input expression.
    3788            copy: if `False`, modify this expression instance in-place.
    3789            opts: other options to use to parse the input expressions.
    3790
    3791        Returns:
    3792            The modified expression.
    3793        """
    3794        return _apply_cte_builder(
    3795            self,
    3796            alias,
    3797            as_,
    3798            recursive=recursive,
    3799            materialized=materialized,
    3800            append=append,
    3801            dialect=dialect,
    3802            copy=copy,
    3803            **opts,
    3804        )
    3805
    3806
    3807class Values(UDTF):
    3808    arg_types = {"expressions": True, "alias": False}
    3809
    3810
    3811class Var(Expression):
    3812    pass
    3813
    3814
    3815class Version(Expression):
    3816    """
    3817    Time travel, iceberg, bigquery etc
    3818    https://trino.io/docs/current/connector/iceberg.html?highlight=snapshot#using-snapshots
    3819    https://www.databricks.com/blog/2019/02/04/introducing-delta-time-travel-for-large-scale-data-lakes.html
    3820    https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#for_system_time_as_of
    3821    https://learn.microsoft.com/en-us/sql/relational-databases/tables/querying-data-in-a-system-versioned-temporal-table?view=sql-server-ver16
    3822    this is either TIMESTAMP or VERSION
    3823    kind is ("AS OF", "BETWEEN")
    3824    """
    3825
    3826    arg_types = {"this": True, "kind": True, "expression": False}
    3827
    3828
    3829class Schema(Expression):
    3830    arg_types = {"this": False, "expressions": False}
    3831
    3832
    3833# https://dev.mysql.com/doc/refman/8.0/en/select.html
    3834# https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/SELECT.html
    3835class Lock(Expression):
    3836    arg_types = {"update": True, "expressions": False, "wait": False, "key": False}
    3837
    3838
    3839class Select(Query):
    3840    arg_types = {
    3841        "with": False,
    3842        "kind": False,
    3843        "expressions": False,
    3844        "hint": False,
    3845        "distinct": False,
    3846        "into": False,
    3847        "from": False,
    3848        "operation_modifiers": False,
    3849        **QUERY_MODIFIERS,
    3850    }
    3851
    3852    def from_(
    3853        self, expression: ExpOrStr, dialect: DialectType = None, copy: bool = True, **opts
    3854    ) -> Select:
    3855        """
    3856        Set the FROM expression.
    3857
    3858        Example:
    3859            >>> Select().from_("tbl").select("x").sql()
    3860            'SELECT x FROM tbl'
    3861
    3862        Args:
    3863            expression : the SQL code strings to parse.
    3864                If a `From` instance is passed, this is used as-is.
    3865                If another `Expression` instance is passed, it will be wrapped in a `From`.
    3866            dialect: the dialect used to parse the input expression.
    3867            copy: if `False`, modify this expression instance in-place.
    3868            opts: other options to use to parse the input expressions.
    3869
    3870        Returns:
    3871            The modified Select expression.
    3872        """
    3873        return _apply_builder(
    3874            expression=expression,
    3875            instance=self,
    3876            arg="from",
    3877            into=From,
    3878            prefix="FROM",
    3879            dialect=dialect,
    3880            copy=copy,
    3881            **opts,
    3882        )
    3883
    3884    def group_by(
    3885        self,
    3886        *expressions: t.Optional[ExpOrStr],
    3887        append: bool = True,
    3888        dialect: DialectType = None,
    3889        copy: bool = True,
    3890        **opts,
    3891    ) -> Select:
    3892        """
    3893        Set the GROUP BY expression.
    3894
    3895        Example:
    3896            >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()
    3897            'SELECT x, COUNT(1) FROM tbl GROUP BY x'
    3898
    3899        Args:
    3900            *expressions: the SQL code strings to parse.
    3901                If a `Group` instance is passed, this is used as-is.
    3902                If another `Expression` instance is passed, it will be wrapped in a `Group`.
    3903                If nothing is passed in then a group by is not applied to the expression
    3904            append: if `True`, add to any existing expressions.
    3905                Otherwise, this flattens all the `Group` expression into a single expression.
    3906            dialect: the dialect used to parse the input expression.
    3907            copy: if `False`, modify this expression instance in-place.
    3908            opts: other options to use to parse the input expressions.
    3909
    3910        Returns:
    3911            The modified Select expression.
    3912        """
    3913        if not expressions:
    3914            return self if not copy else self.copy()
    3915
    3916        return _apply_child_list_builder(
    3917            *expressions,
    3918            instance=self,
    3919            arg="group",
    3920            append=append,
    3921            copy=copy,
    3922            prefix="GROUP BY",
    3923            into=Group,
    3924            dialect=dialect,
    3925            **opts,
    3926        )
    3927
    3928    def sort_by(
    3929        self,
    3930        *expressions: t.Optional[ExpOrStr],
    3931        append: bool = True,
    3932        dialect: DialectType = None,
    3933        copy: bool = True,
    3934        **opts,
    3935    ) -> Select:
    3936        """
    3937        Set the SORT BY expression.
    3938
    3939        Example:
    3940            >>> Select().from_("tbl").select("x").sort_by("x DESC").sql(dialect="hive")
    3941            'SELECT x FROM tbl SORT BY x DESC'
    3942
    3943        Args:
    3944            *expressions: the SQL code strings to parse.
    3945                If a `Group` instance is passed, this is used as-is.
    3946                If another `Expression` instance is passed, it will be wrapped in a `SORT`.
    3947            append: if `True`, add to any existing expressions.
    3948                Otherwise, this flattens all the `Order` expression into a single expression.
    3949            dialect: the dialect used to parse the input expression.
    3950            copy: if `False`, modify this expression instance in-place.
    3951            opts: other options to use to parse the input expressions.
    3952
    3953        Returns:
    3954            The modified Select expression.
    3955        """
    3956        return _apply_child_list_builder(
    3957            *expressions,
    3958            instance=self,
    3959            arg="sort",
    3960            append=append,
    3961            copy=copy,
    3962            prefix="SORT BY",
    3963            into=Sort,
    3964            dialect=dialect,
    3965            **opts,
    3966        )
    3967
    3968    def cluster_by(
    3969        self,
    3970        *expressions: t.Optional[ExpOrStr],
    3971        append: bool = True,
    3972        dialect: DialectType = None,
    3973        copy: bool = True,
    3974        **opts,
    3975    ) -> Select:
    3976        """
    3977        Set the CLUSTER BY expression.
    3978
    3979        Example:
    3980            >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql(dialect="hive")
    3981            'SELECT x FROM tbl CLUSTER BY x DESC'
    3982
    3983        Args:
    3984            *expressions: the SQL code strings to parse.
    3985                If a `Group` instance is passed, this is used as-is.
    3986                If another `Expression` instance is passed, it will be wrapped in a `Cluster`.
    3987            append: if `True`, add to any existing expressions.
    3988                Otherwise, this flattens all the `Order` expression into a single expression.
    3989            dialect: the dialect used to parse the input expression.
    3990            copy: if `False`, modify this expression instance in-place.
    3991            opts: other options to use to parse the input expressions.
    3992
    3993        Returns:
    3994            The modified Select expression.
    3995        """
    3996        return _apply_child_list_builder(
    3997            *expressions,
    3998            instance=self,
    3999            arg="cluster",
    4000            append=append,
    4001            copy=copy,
    4002            prefix="CLUSTER BY",
    4003            into=Cluster,
    4004            dialect=dialect,
    4005            **opts,
    4006        )
    4007
    4008    def select(
    4009        self,
    4010        *expressions: t.Optional[ExpOrStr],
    4011        append: bool = True,
    4012        dialect: DialectType = None,
    4013        copy: bool = True,
    4014        **opts,
    4015    ) -> Select:
    4016        return _apply_list_builder(
    4017            *expressions,
    4018            instance=self,
    4019            arg="expressions",
    4020            append=append,
    4021            dialect=dialect,
    4022            into=Expression,
    4023            copy=copy,
    4024            **opts,
    4025        )
    4026
    4027    def lateral(
    4028        self,
    4029        *expressions: t.Optional[ExpOrStr],
    4030        append: bool = True,
    4031        dialect: DialectType = None,
    4032        copy: bool = True,
    4033        **opts,
    4034    ) -> Select:
    4035        """
    4036        Append to or set the LATERAL expressions.
    4037
    4038        Example:
    4039            >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()
    4040            'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'
    4041
    4042        Args:
    4043            *expressions: the SQL code strings to parse.
    4044                If an `Expression` instance is passed, it will be used as-is.
    4045            append: if `True`, add to any existing expressions.
    4046                Otherwise, this resets the expressions.
    4047            dialect: the dialect used to parse the input expressions.
    4048            copy: if `False`, modify this expression instance in-place.
    4049            opts: other options to use to parse the input expressions.
    4050
    4051        Returns:
    4052            The modified Select expression.
    4053        """
    4054        return _apply_list_builder(
    4055            *expressions,
    4056            instance=self,
    4057            arg="laterals",
    4058            append=append,
    4059            into=Lateral,
    4060            prefix="LATERAL VIEW",
    4061            dialect=dialect,
    4062            copy=copy,
    4063            **opts,
    4064        )
    4065
    4066    def join(
    4067        self,
    4068        expression: ExpOrStr,
    4069        on: t.Optional[ExpOrStr] = None,
    4070        using: t.Optional[ExpOrStr | t.Collection[ExpOrStr]] = None,
    4071        append: bool = True,
    4072        join_type: t.Optional[str] = None,
    4073        join_alias: t.Optional[Identifier | str] = None,
    4074        dialect: DialectType = None,
    4075        copy: bool = True,
    4076        **opts,
    4077    ) -> Select:
    4078        """
    4079        Append to or set the JOIN expressions.
    4080
    4081        Example:
    4082            >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()
    4083            'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'
    4084
    4085            >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()
    4086            'SELECT 1 FROM a JOIN b USING (x, y, z)'
    4087
    4088            Use `join_type` to change the type of join:
    4089
    4090            >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()
    4091            'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'
    4092
    4093        Args:
    4094            expression: the SQL code string to parse.
    4095                If an `Expression` instance is passed, it will be used as-is.
    4096            on: optionally specify the join "on" criteria as a SQL string.
    4097                If an `Expression` instance is passed, it will be used as-is.
    4098            using: optionally specify the join "using" criteria as a SQL string.
    4099                If an `Expression` instance is passed, it will be used as-is.
    4100            append: if `True`, add to any existing expressions.
    4101                Otherwise, this resets the expressions.
    4102            join_type: if set, alter the parsed join type.
    4103            join_alias: an optional alias for the joined source.
    4104            dialect: the dialect used to parse the input expressions.
    4105            copy: if `False`, modify this expression instance in-place.
    4106            opts: other options to use to parse the input expressions.
    4107
    4108        Returns:
    4109            Select: the modified expression.
    4110        """
    4111        parse_args: t.Dict[str, t.Any] = {"dialect": dialect, **opts}
    4112
    4113        try:
    4114            expression = maybe_parse(expression, into=Join, prefix="JOIN", **parse_args)
    4115        except ParseError:
    4116            expression = maybe_parse(expression, into=(Join, Expression), **parse_args)
    4117
    4118        join = expression if isinstance(expression, Join) else Join(this=expression)
    4119
    4120        if isinstance(join.this, Select):
    4121            join.this.replace(join.this.subquery())
    4122
    4123        if join_type:
    4124            method: t.Optional[Token]
    4125            side: t.Optional[Token]
    4126            kind: t.Optional[Token]
    4127
    4128            method, side, kind = maybe_parse(join_type, into="JOIN_TYPE", **parse_args)  # type: ignore
    4129
    4130            if method:
    4131                join.set("method", method.text)
    4132            if side:
    4133                join.set("side", side.text)
    4134            if kind:
    4135                join.set("kind", kind.text)
    4136
    4137        if on:
    4138            on = and_(*ensure_list(on), dialect=dialect, copy=copy, **opts)
    4139            join.set("on", on)
    4140
    4141        if using:
    4142            join = _apply_list_builder(
    4143                *ensure_list(using),
    4144                instance=join,
    4145                arg="using",
    4146                append=append,
    4147                copy=copy,
    4148                into=Identifier,
    4149                **opts,
    4150            )
    4151
    4152        if join_alias:
    4153            join.set("this", alias_(join.this, join_alias, table=True))
    4154
    4155        return _apply_list_builder(
    4156            join,
    4157            instance=self,
    4158            arg="joins",
    4159            append=append,
    4160            copy=copy,
    4161            **opts,
    4162        )
    4163
    4164    def having(
    4165        self,
    4166        *expressions: t.Optional[ExpOrStr],
    4167        append: bool = True,
    4168        dialect: DialectType = None,
    4169        copy: bool = True,
    4170        **opts,
    4171    ) -> Select:
    4172        """
    4173        Append to or set the HAVING expressions.
    4174
    4175        Example:
    4176            >>> Select().select("x", "COUNT(y)").from_("tbl").group_by("x").having("COUNT(y) > 3").sql()
    4177            'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'
    4178
    4179        Args:
    4180            *expressions: the SQL code strings to parse.
    4181                If an `Expression` instance is passed, it will be used as-is.
    4182                Multiple expressions are combined with an AND operator.
    4183            append: if `True`, AND the new expressions to any existing expression.
    4184                Otherwise, this resets the expression.
    4185            dialect: the dialect used to parse the input expressions.
    4186            copy: if `False`, modify this expression instance in-place.
    4187            opts: other options to use to parse the input expressions.
    4188
    4189        Returns:
    4190            The modified Select expression.
    4191        """
    4192        return _apply_conjunction_builder(
    4193            *expressions,
    4194            instance=self,
    4195            arg="having",
    4196            append=append,
    4197            into=Having,
    4198            dialect=dialect,
    4199            copy=copy,
    4200            **opts,
    4201        )
    4202
    4203    def window(
    4204        self,
    4205        *expressions: t.Optional[ExpOrStr],
    4206        append: bool = True,
    4207        dialect: DialectType = None,
    4208        copy: bool = True,
    4209        **opts,
    4210    ) -> Select:
    4211        return _apply_list_builder(
    4212            *expressions,
    4213            instance=self,
    4214            arg="windows",
    4215            append=append,
    4216            into=Window,
    4217            dialect=dialect,
    4218            copy=copy,
    4219            **opts,
    4220        )
    4221
    4222    def qualify(
    4223        self,
    4224        *expressions: t.Optional[ExpOrStr],
    4225        append: bool = True,
    4226        dialect: DialectType = None,
    4227        copy: bool = True,
    4228        **opts,
    4229    ) -> Select:
    4230        return _apply_conjunction_builder(
    4231            *expressions,
    4232            instance=self,
    4233            arg="qualify",
    4234            append=append,
    4235            into=Qualify,
    4236            dialect=dialect,
    4237            copy=copy,
    4238            **opts,
    4239        )
    4240
    4241    def distinct(
    4242        self, *ons: t.Optional[ExpOrStr], distinct: bool = True, copy: bool = True
    4243    ) -> Select:
    4244        """
    4245        Set the OFFSET expression.
    4246
    4247        Example:
    4248            >>> Select().from_("tbl").select("x").distinct().sql()
    4249            'SELECT DISTINCT x FROM tbl'
    4250
    4251        Args:
    4252            ons: the expressions to distinct on
    4253            distinct: whether the Select should be distinct
    4254            copy: if `False`, modify this expression instance in-place.
    4255
    4256        Returns:
    4257            Select: the modified expression.
    4258        """
    4259        instance = maybe_copy(self, copy)
    4260        on = Tuple(expressions=[maybe_parse(on, copy=copy) for on in ons if on]) if ons else None
    4261        instance.set("distinct", Distinct(on=on) if distinct else None)
    4262        return instance
    4263
    4264    def ctas(
    4265        self,
    4266        table: ExpOrStr,
    4267        properties: t.Optional[t.Dict] = None,
    4268        dialect: DialectType = None,
    4269        copy: bool = True,
    4270        **opts,
    4271    ) -> Create:
    4272        """
    4273        Convert this expression to a CREATE TABLE AS statement.
    4274
    4275        Example:
    4276            >>> Select().select("*").from_("tbl").ctas("x").sql()
    4277            'CREATE TABLE x AS SELECT * FROM tbl'
    4278
    4279        Args:
    4280            table: the SQL code string to parse as the table name.
    4281                If another `Expression` instance is passed, it will be used as-is.
    4282            properties: an optional mapping of table properties
    4283            dialect: the dialect used to parse the input table.
    4284            copy: if `False`, modify this expression instance in-place.
    4285            opts: other options to use to parse the input table.
    4286
    4287        Returns:
    4288            The new Create expression.
    4289        """
    4290        instance = maybe_copy(self, copy)
    4291        table_expression = maybe_parse(table, into=Table, dialect=dialect, **opts)
    4292
    4293        properties_expression = None
    4294        if properties:
    4295            properties_expression = Properties.from_dict(properties)
    4296
    4297        return Create(
    4298            this=table_expression,
    4299            kind="TABLE",
    4300            expression=instance,
    4301            properties=properties_expression,
    4302        )
    4303
    4304    def lock(self, update: bool = True, copy: bool = True) -> Select:
    4305        """
    4306        Set the locking read mode for this expression.
    4307
    4308        Examples:
    4309            >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")
    4310            "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"
    4311
    4312            >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")
    4313            "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"
    4314
    4315        Args:
    4316            update: if `True`, the locking type will be `FOR UPDATE`, else it will be `FOR SHARE`.
    4317            copy: if `False`, modify this expression instance in-place.
    4318
    4319        Returns:
    4320            The modified expression.
    4321        """
    4322        inst = maybe_copy(self, copy)
    4323        inst.set("locks", [Lock(update=update)])
    4324
    4325        return inst
    4326
    4327    def hint(self, *hints: ExpOrStr, dialect: DialectType = None, copy: bool = True) -> Select:
    4328        """
    4329        Set hints for this expression.
    4330
    4331        Examples:
    4332            >>> Select().select("x").from_("tbl").hint("BROADCAST(y)").sql(dialect="spark")
    4333            'SELECT /*+ BROADCAST(y) */ x FROM tbl'
    4334
    4335        Args:
    4336            hints: The SQL code strings to parse as the hints.
    4337                If an `Expression` instance is passed, it will be used as-is.
    4338            dialect: The dialect used to parse the hints.
    4339            copy: If `False`, modify this expression instance in-place.
    4340
    4341        Returns:
    4342            The modified expression.
    4343        """
    4344        inst = maybe_copy(self, copy)
    4345        inst.set(
    4346            "hint", Hint(expressions=[maybe_parse(h, copy=copy, dialect=dialect) for h in hints])
    4347        )
    4348
    4349        return inst
    4350
    4351    @property
    4352    def named_selects(self) -> t.List[str]:
    4353        selects = []
    4354
    4355        for e in self.expressions:
    4356            if e.alias_or_name:
    4357                selects.append(e.output_name)
    4358            elif isinstance(e, Aliases):
    4359                selects.extend([a.name for a in e.aliases])
    4360        return selects
    4361
    4362    @property
    4363    def is_star(self) -> bool:
    4364        return any(expression.is_star for expression in self.expressions)
    4365
    4366    @property
    4367    def selects(self) -> t.List[Expression]:
    4368        return self.expressions
    4369
    4370
    4371UNWRAPPED_QUERIES = (Select, SetOperation)
    4372
    4373
    4374class Subquery(DerivedTable, Query):
    4375    arg_types = {
    4376        "this": True,
    4377        "alias": False,
    4378        "with": False,
    4379        **QUERY_MODIFIERS,
    4380    }
    4381
    4382    def unnest(self):
    4383        """Returns the first non subquery."""
    4384        expression = self
    4385        while isinstance(expression, Subquery):
    4386            expression = expression.this
    4387        return expression
    4388
    4389    def unwrap(self) -> Subquery:
    4390        expression = self
    4391        while expression.same_parent and expression.is_wrapper:
    4392            expression = t.cast(Subquery, expression.parent)
    4393        return expression
    4394
    4395    def select(
    4396        self,
    4397        *expressions: t.Optional[ExpOrStr],
    4398        append: bool = True,
    4399        dialect: DialectType = None,
    4400        copy: bool = True,
    4401        **opts,
    4402    ) -> Subquery:
    4403        this = maybe_copy(self, copy)
    4404        this.unnest().select(*expressions, append=append, dialect=dialect, copy=False, **opts)
    4405        return this
    4406
    4407    @property
    4408    def is_wrapper(self) -> bool:
    4409        """
    4410        Whether this Subquery acts as a simple wrapper around another expression.
    4411
    4412        SELECT * FROM (((SELECT * FROM t)))
    4413                      ^
    4414                      This corresponds to a "wrapper" Subquery node
    4415        """
    4416        return all(v is None for k, v in self.args.items() if k != "this")
    4417
    4418    @property
    4419    def is_star(self) -> bool:
    4420        return self.this.is_star
    4421
    4422    @property
    4423    def output_name(self) -> str:
    4424        return self.alias
    4425
    4426
    4427class TableSample(Expression):
    4428    arg_types = {
    4429        "expressions": False,
    4430        "method": False,
    4431        "bucket_numerator": False,
    4432        "bucket_denominator": False,
    4433        "bucket_field": False,
    4434        "percent": False,
    4435        "rows": False,
    4436        "size": False,
    4437        "seed": False,
    4438    }
    4439
    4440
    4441class Tag(Expression):
    4442    """Tags are used for generating arbitrary sql like SELECT <span>x</span>."""
    4443
    4444    arg_types = {
    4445        "this": False,
    4446        "prefix": False,
    4447        "postfix": False,
    4448    }
    4449
    4450
    4451# Represents both the standard SQL PIVOT operator and DuckDB's "simplified" PIVOT syntax
    4452# https://duckdb.org/docs/sql/statements/pivot
    4453class Pivot(Expression):
    4454    arg_types = {
    4455        "this": False,
    4456        "alias": False,
    4457        "expressions": False,
    4458        "fields": False,
    4459        "unpivot": False,
    4460        "using": False,
    4461        "group": False,
    4462        "columns": False,
    4463        "include_nulls": False,
    4464        "default_on_null": False,
    4465        "into": False,
    4466    }
    4467
    4468    @property
    4469    def unpivot(self) -> bool:
    4470        return bool(self.args.get("unpivot"))
    4471
    4472    @property
    4473    def fields(self) -> t.List[Expression]:
    4474        return self.args.get("fields", [])
    4475
    4476
    4477# https://duckdb.org/docs/sql/statements/unpivot#simplified-unpivot-syntax
    4478# UNPIVOT ... INTO [NAME <col_name> VALUE <col_value>][...,]
    4479class UnpivotColumns(Expression):
    4480    arg_types = {"this": True, "expressions": True}
    4481
    4482
    4483class Window(Condition):
    4484    arg_types = {
    4485        "this": True,
    4486        "partition_by": False,
    4487        "order": False,
    4488        "spec": False,
    4489        "alias": False,
    4490        "over": False,
    4491        "first": False,
    4492    }
    4493
    4494
    4495class WindowSpec(Expression):
    4496    arg_types = {
    4497        "kind": False,
    4498        "start": False,
    4499        "start_side": False,
    4500        "end": False,
    4501        "end_side": False,
    4502        "exclude": False,
    4503    }
    4504
    4505
    4506class PreWhere(Expression):
    4507    pass
    4508
    4509
    4510class Where(Expression):
    4511    pass
    4512
    4513
    4514class Star(Expression):
    4515    arg_types = {"except": False, "replace": False, "rename": False}
    4516
    4517    @property
    4518    def name(self) -> str:
    4519        return "*"
    4520
    4521    @property
    4522    def output_name(self) -> str:
    4523        return self.name
    4524
    4525
    4526class Parameter(Condition):
    4527    arg_types = {"this": True, "expression": False}
    4528
    4529
    4530class SessionParameter(Condition):
    4531    arg_types = {"this": True, "kind": False}
    4532
    4533
    4534# https://www.databricks.com/blog/parameterized-queries-pyspark
    4535# https://jdbc.postgresql.org/documentation/query/#using-the-statement-or-preparedstatement-interface
    4536class Placeholder(Condition):
    4537    arg_types = {"this": False, "kind": False, "widget": False, "jdbc": False}
    4538
    4539    @property
    4540    def name(self) -> str:
    4541        return self.this or "?"
    4542
    4543
    4544class Null(Condition):
    4545    arg_types: t.Dict[str, t.Any] = {}
    4546
    4547    @property
    4548    def name(self) -> str:
    4549        return "NULL"
    4550
    4551    def to_py(self) -> Lit[None]:
    4552        return None
    4553
    4554
    4555class Boolean(Condition):
    4556    def to_py(self) -> bool:
    4557        return self.this
    4558
    4559
    4560class DataTypeParam(Expression):
    4561    arg_types = {"this": True, "expression": False}
    4562
    4563    @property
    4564    def name(self) -> str:
    4565        return self.this.name
    4566
    4567
    4568# The `nullable` arg is helpful when transpiling types from other dialects to ClickHouse, which
    4569# assumes non-nullable types by default. Values `None` and `True` mean the type is nullable.
    4570class DataType(Expression):
    4571    arg_types = {
    4572        "this": True,
    4573        "expressions": False,
    4574        "nested": False,
    4575        "values": False,
    4576        "prefix": False,
    4577        "kind": False,
    4578        "nullable": False,
    4579    }
    4580
    4581    class Type(AutoName):
    4582        ARRAY = auto()
    4583        AGGREGATEFUNCTION = auto()
    4584        SIMPLEAGGREGATEFUNCTION = auto()
    4585        BIGDECIMAL = auto()
    4586        BIGINT = auto()
    4587        BIGSERIAL = auto()
    4588        BINARY = auto()
    4589        BIT = auto()
    4590        BLOB = auto()
    4591        BOOLEAN = auto()
    4592        BPCHAR = auto()
    4593        CHAR = auto()
    4594        DATE = auto()
    4595        DATE32 = auto()
    4596        DATEMULTIRANGE = auto()
    4597        DATERANGE = auto()
    4598        DATETIME = auto()
    4599        DATETIME2 = auto()
    4600        DATETIME64 = auto()
    4601        DECIMAL = auto()
    4602        DECIMAL32 = auto()
    4603        DECIMAL64 = auto()
    4604        DECIMAL128 = auto()
    4605        DECIMAL256 = auto()
    4606        DOUBLE = auto()
    4607        DYNAMIC = auto()
    4608        ENUM = auto()
    4609        ENUM8 = auto()
    4610        ENUM16 = auto()
    4611        FIXEDSTRING = auto()
    4612        FLOAT = auto()
    4613        GEOGRAPHY = auto()
    4614        GEOGRAPHYPOINT = auto()
    4615        GEOMETRY = auto()
    4616        POINT = auto()
    4617        RING = auto()
    4618        LINESTRING = auto()
    4619        MULTILINESTRING = auto()
    4620        POLYGON = auto()
    4621        MULTIPOLYGON = auto()
    4622        HLLSKETCH = auto()
    4623        HSTORE = auto()
    4624        IMAGE = auto()
    4625        INET = auto()
    4626        INT = auto()
    4627        INT128 = auto()
    4628        INT256 = auto()
    4629        INT4MULTIRANGE = auto()
    4630        INT4RANGE = auto()
    4631        INT8MULTIRANGE = auto()
    4632        INT8RANGE = auto()
    4633        INTERVAL = auto()
    4634        IPADDRESS = auto()
    4635        IPPREFIX = auto()
    4636        IPV4 = auto()
    4637        IPV6 = auto()
    4638        JSON = auto()
    4639        JSONB = auto()
    4640        LIST = auto()
    4641        LONGBLOB = auto()
    4642        LONGTEXT = auto()
    4643        LOWCARDINALITY = auto()
    4644        MAP = auto()
    4645        MEDIUMBLOB = auto()
    4646        MEDIUMINT = auto()
    4647        MEDIUMTEXT = auto()
    4648        MONEY = auto()
    4649        NAME = auto()
    4650        NCHAR = auto()
    4651        NESTED = auto()
    4652        NOTHING = auto()
    4653        NULL = auto()
    4654        NUMMULTIRANGE = auto()
    4655        NUMRANGE = auto()
    4656        NVARCHAR = auto()
    4657        OBJECT = auto()
    4658        RANGE = auto()
    4659        ROWVERSION = auto()
    4660        SERIAL = auto()
    4661        SET = auto()
    4662        SMALLDATETIME = auto()
    4663        SMALLINT = auto()
    4664        SMALLMONEY = auto()
    4665        SMALLSERIAL = auto()
    4666        STRUCT = auto()
    4667        SUPER = auto()
    4668        TEXT = auto()
    4669        TINYBLOB = auto()
    4670        TINYTEXT = auto()
    4671        TIME = auto()
    4672        TIMETZ = auto()
    4673        TIMESTAMP = auto()
    4674        TIMESTAMPNTZ = auto()
    4675        TIMESTAMPLTZ = auto()
    4676        TIMESTAMPTZ = auto()
    4677        TIMESTAMP_S = auto()
    4678        TIMESTAMP_MS = auto()
    4679        TIMESTAMP_NS = auto()
    4680        TINYINT = auto()
    4681        TSMULTIRANGE = auto()
    4682        TSRANGE = auto()
    4683        TSTZMULTIRANGE = auto()
    4684        TSTZRANGE = auto()
    4685        UBIGINT = auto()
    4686        UINT = auto()
    4687        UINT128 = auto()
    4688        UINT256 = auto()
    4689        UMEDIUMINT = auto()
    4690        UDECIMAL = auto()
    4691        UDOUBLE = auto()
    4692        UNION = auto()
    4693        UNKNOWN = auto()  # Sentinel value, useful for type annotation
    4694        USERDEFINED = "USER-DEFINED"
    4695        USMALLINT = auto()
    4696        UTINYINT = auto()
    4697        UUID = auto()
    4698        VARBINARY = auto()
    4699        VARCHAR = auto()
    4700        VARIANT = auto()
    4701        VECTOR = auto()
    4702        XML = auto()
    4703        YEAR = auto()
    4704        TDIGEST = auto()
    4705
    4706    STRUCT_TYPES = {
    4707        Type.NESTED,
    4708        Type.OBJECT,
    4709        Type.STRUCT,
    4710        Type.UNION,
    4711    }
    4712
    4713    ARRAY_TYPES = {
    4714        Type.ARRAY,
    4715        Type.LIST,
    4716    }
    4717
    4718    NESTED_TYPES = {
    4719        *STRUCT_TYPES,
    4720        *ARRAY_TYPES,
    4721        Type.MAP,
    4722    }
    4723
    4724    TEXT_TYPES = {
    4725        Type.CHAR,
    4726        Type.NCHAR,
    4727        Type.NVARCHAR,
    4728        Type.TEXT,
    4729        Type.VARCHAR,
    4730        Type.NAME,
    4731    }
    4732
    4733    SIGNED_INTEGER_TYPES = {
    4734        Type.BIGINT,
    4735        Type.INT,
    4736        Type.INT128,
    4737        Type.INT256,
    4738        Type.MEDIUMINT,
    4739        Type.SMALLINT,
    4740        Type.TINYINT,
    4741    }
    4742
    4743    UNSIGNED_INTEGER_TYPES = {
    4744        Type.UBIGINT,
    4745        Type.UINT,
    4746        Type.UINT128,
    4747        Type.UINT256,
    4748        Type.UMEDIUMINT,
    4749        Type.USMALLINT,
    4750        Type.UTINYINT,
    4751    }
    4752
    4753    INTEGER_TYPES = {
    4754        *SIGNED_INTEGER_TYPES,
    4755        *UNSIGNED_INTEGER_TYPES,
    4756        Type.BIT,
    4757    }
    4758
    4759    FLOAT_TYPES = {
    4760        Type.DOUBLE,
    4761        Type.FLOAT,
    4762    }
    4763
    4764    REAL_TYPES = {
    4765        *FLOAT_TYPES,
    4766        Type.BIGDECIMAL,
    4767        Type.DECIMAL,
    4768        Type.DECIMAL32,
    4769        Type.DECIMAL64,
    4770        Type.DECIMAL128,
    4771        Type.DECIMAL256,
    4772        Type.MONEY,
    4773        Type.SMALLMONEY,
    4774        Type.UDECIMAL,
    4775        Type.UDOUBLE,
    4776    }
    4777
    4778    NUMERIC_TYPES = {
    4779        *INTEGER_TYPES,
    4780        *REAL_TYPES,
    4781    }
    4782
    4783    TEMPORAL_TYPES = {
    4784        Type.DATE,
    4785        Type.DATE32,
    4786        Type.DATETIME,
    4787        Type.DATETIME2,
    4788        Type.DATETIME64,
    4789        Type.SMALLDATETIME,
    4790        Type.TIME,
    4791        Type.TIMESTAMP,
    4792        Type.TIMESTAMPNTZ,
    4793        Type.TIMESTAMPLTZ,
    4794        Type.TIMESTAMPTZ,
    4795        Type.TIMESTAMP_MS,
    4796        Type.TIMESTAMP_NS,
    4797        Type.TIMESTAMP_S,
    4798        Type.TIMETZ,
    4799    }
    4800
    4801    @classmethod
    4802    def build(
    4803        cls,
    4804        dtype: DATA_TYPE,
    4805        dialect: DialectType = None,
    4806        udt: bool = False,
    4807        copy: bool = True,
    4808        **kwargs,
    4809    ) -> DataType:
    4810        """
    4811        Constructs a DataType object.
    4812
    4813        Args:
    4814            dtype: the data type of interest.
    4815            dialect: the dialect to use for parsing `dtype`, in case it's a string.
    4816            udt: when set to True, `dtype` will be used as-is if it can't be parsed into a
    4817                DataType, thus creating a user-defined type.
    4818            copy: whether to copy the data type.
    4819            kwargs: additional arguments to pass in the constructor of DataType.
    4820
    4821        Returns:
    4822            The constructed DataType object.
    4823        """
    4824        from sqlglot import parse_one
    4825
    4826        if isinstance(dtype, str):
    4827            if dtype.upper() == "UNKNOWN":
    4828                return DataType(this=DataType.Type.UNKNOWN, **kwargs)
    4829
    4830            try:
    4831                data_type_exp = parse_one(
    4832                    dtype, read=dialect, into=DataType, error_level=ErrorLevel.IGNORE
    4833                )
    4834            except ParseError:
    4835                if udt:
    4836                    return DataType(this=DataType.Type.USERDEFINED, kind=dtype, **kwargs)
    4837                raise
    4838        elif isinstance(dtype, (Identifier, Dot)) and udt:
    4839            return DataType(this=DataType.Type.USERDEFINED, kind=dtype, **kwargs)
    4840        elif isinstance(dtype, DataType.Type):
    4841            data_type_exp = DataType(this=dtype)
    4842        elif isinstance(dtype, DataType):
    4843            return maybe_copy(dtype, copy)
    4844        else:
    4845            raise ValueError(f"Invalid data type: {type(dtype)}. Expected str or DataType.Type")
    4846
    4847        return DataType(**{**data_type_exp.args, **kwargs})
    4848
    4849    def is_type(self, *dtypes: DATA_TYPE, check_nullable: bool = False) -> bool:
    4850        """
    4851        Checks whether this DataType matches one of the provided data types. Nested types or precision
    4852        will be compared using "structural equivalence" semantics, so e.g. array<int> != array<float>.
    4853
    4854        Args:
    4855            dtypes: the data types to compare this DataType to.
    4856            check_nullable: whether to take the NULLABLE type constructor into account for the comparison.
    4857                If false, it means that NULLABLE<INT> is equivalent to INT.
    4858
    4859        Returns:
    4860            True, if and only if there is a type in `dtypes` which is equal to this DataType.
    4861        """
    4862        self_is_nullable = self.args.get("nullable")
    4863        for dtype in dtypes:
    4864            other_type = DataType.build(dtype, copy=False, udt=True)
    4865            other_is_nullable = other_type.args.get("nullable")
    4866            if (
    4867                other_type.expressions
    4868                or (check_nullable and (self_is_nullable or other_is_nullable))
    4869                or self.this == DataType.Type.USERDEFINED
    4870                or other_type.this == DataType.Type.USERDEFINED
    4871            ):
    4872                matches = self == other_type
    4873            else:
    4874                matches = self.this == other_type.this
    4875
    4876            if matches:
    4877                return True
    4878        return False
    4879
    4880
    4881# https://www.postgresql.org/docs/15/datatype-pseudo.html
    4882class PseudoType(DataType):
    4883    arg_types = {"this": True}
    4884
    4885
    4886# https://www.postgresql.org/docs/15/datatype-oid.html
    4887class ObjectIdentifier(DataType):
    4888    arg_types = {"this": True}
    4889
    4890
    4891# WHERE x <OP> EXISTS|ALL|ANY|SOME(SELECT ...)
    4892class SubqueryPredicate(Predicate):
    4893    pass
    4894
    4895
    4896class All(SubqueryPredicate):
    4897    pass
    4898
    4899
    4900class Any(SubqueryPredicate):
    4901    pass
    4902
    4903
    4904# Commands to interact with the databases or engines. For most of the command
    4905# expressions we parse whatever comes after the command's name as a string.
    4906class Command(Expression):
    4907    arg_types = {"this": True, "expression": False}
    4908
    4909
    4910class Transaction(Expression):
    4911    arg_types = {"this": False, "modes": False, "mark": False}
    4912
    4913
    4914class Commit(Expression):
    4915    arg_types = {"chain": False, "this": False, "durability": False}
    4916
    4917
    4918class Rollback(Expression):
    4919    arg_types = {"savepoint": False, "this": False}
    4920
    4921
    4922class Alter(Expression):
    4923    arg_types = {
    4924        "this": False,
    4925        "kind": True,
    4926        "actions": True,
    4927        "exists": False,
    4928        "only": False,
    4929        "options": False,
    4930        "cluster": False,
    4931        "not_valid": False,
    4932        "check": False,
    4933    }
    4934
    4935    @property
    4936    def kind(self) -> t.Optional[str]:
    4937        kind = self.args.get("kind")
    4938        return kind and kind.upper()
    4939
    4940    @property
    4941    def actions(self) -> t.List[Expression]:
    4942        return self.args.get("actions") or []
    4943
    4944
    4945class AlterSession(Expression):
    4946    arg_types = {"expressions": True, "unset": False}
    4947
    4948
    4949class Analyze(Expression):
    4950    arg_types = {
    4951        "kind": False,
    4952        "this": False,
    4953        "options": False,
    4954        "mode": False,
    4955        "partition": False,
    4956        "expression": False,
    4957        "properties": False,
    4958    }
    4959
    4960
    4961class AnalyzeStatistics(Expression):
    4962    arg_types = {
    4963        "kind": True,
    4964        "option": False,
    4965        "this": False,
    4966        "expressions": False,
    4967    }
    4968
    4969
    4970class AnalyzeHistogram(Expression):
    4971    arg_types = {
    4972        "this": True,
    4973        "expressions": True,
    4974        "expression": False,
    4975        "update_options": False,
    4976    }
    4977
    4978
    4979class AnalyzeSample(Expression):
    4980    arg_types = {"kind": True, "sample": True}
    4981
    4982
    4983class AnalyzeListChainedRows(Expression):
    4984    arg_types = {"expression": False}
    4985
    4986
    4987class AnalyzeDelete(Expression):
    4988    arg_types = {"kind": False}
    4989
    4990
    4991class AnalyzeWith(Expression):
    4992    arg_types = {"expressions": True}
    4993
    4994
    4995class AnalyzeValidate(Expression):
    4996    arg_types = {
    4997        "kind": True,
    4998        "this": False,
    4999        "expression": False,
    5000    }
    5001
    5002
    5003class AnalyzeColumns(Expression):
    5004    pass
    5005
    5006
    5007class UsingData(Expression):
    5008    pass
    5009
    5010
    5011class AddConstraint(Expression):
    5012    arg_types = {"expressions": True}
    5013
    5014
    5015class AddPartition(Expression):
    5016    arg_types = {"this": True, "exists": False, "location": False}
    5017
    5018
    5019class AttachOption(Expression):
    5020    arg_types = {"this": True, "expression": False}
    5021
    5022
    5023class DropPartition(Expression):
    5024    arg_types = {"expressions": True, "exists": False}
    5025
    5026
    5027# https://clickhouse.com/docs/en/sql-reference/statements/alter/partition#replace-partition
    5028class ReplacePartition(Expression):
    5029    arg_types = {"expression": True, "source": True}
    5030
    5031
    5032# Binary expressions like (ADD a b)
    5033class Binary(Condition):
    5034    arg_types = {"this": True, "expression": True}
    5035
    5036    @property
    5037    def left(self) -> Expression:
    5038        return self.this
    5039
    5040    @property
    5041    def right(self) -> Expression:
    5042        return self.expression
    5043
    5044
    5045class Add(Binary):
    5046    pass
    5047
    5048
    5049class Connector(Binary):
    5050    pass
    5051
    5052
    5053class BitwiseAnd(Binary):
    5054    pass
    5055
    5056
    5057class BitwiseLeftShift(Binary):
    5058    pass
    5059
    5060
    5061class BitwiseOr(Binary):
    5062    pass
    5063
    5064
    5065class BitwiseRightShift(Binary):
    5066    pass
    5067
    5068
    5069class BitwiseXor(Binary):
    5070    pass
    5071
    5072
    5073class Div(Binary):
    5074    arg_types = {"this": True, "expression": True, "typed": False, "safe": False}
    5075
    5076
    5077class Overlaps(Binary):
    5078    pass
    5079
    5080
    5081class Dot(Binary):
    5082    @property
    5083    def is_star(self) -> bool:
    5084        return self.expression.is_star
    5085
    5086    @property
    5087    def name(self) -> str:
    5088        return self.expression.name
    5089
    5090    @property
    5091    def output_name(self) -> str:
    5092        return self.name
    5093
    5094    @classmethod
    5095    def build(self, expressions: t.Sequence[Expression]) -> Dot:
    5096        """Build a Dot object with a sequence of expressions."""
    5097        if len(expressions) < 2:
    5098            raise ValueError("Dot requires >= 2 expressions.")
    5099
    5100        return t.cast(Dot, reduce(lambda x, y: Dot(this=x, expression=y), expressions))
    5101
    5102    @property
    5103    def parts(self) -> t.List[Expression]:
    5104        """Return the parts of a table / column in order catalog, db, table."""
    5105        this, *parts = self.flatten()
    5106
    5107        parts.reverse()
    5108
    5109        for arg in COLUMN_PARTS:
    5110            part = this.args.get(arg)
    5111
    5112            if isinstance(part, Expression):
    5113                parts.append(part)
    5114
    5115        parts.reverse()
    5116        return parts
    5117
    5118
    5119DATA_TYPE = t.Union[str, Identifier, Dot, DataType, DataType.Type]
    5120
    5121
    5122class DPipe(Binary):
    5123    arg_types = {"this": True, "expression": True, "safe": False}
    5124
    5125
    5126class EQ(Binary, Predicate):
    5127    pass
    5128
    5129
    5130class NullSafeEQ(Binary, Predicate):
    5131    pass
    5132
    5133
    5134class NullSafeNEQ(Binary, Predicate):
    5135    pass
    5136
    5137
    5138# Represents e.g. := in DuckDB which is mostly used for setting parameters
    5139class PropertyEQ(Binary):
    5140    pass
    5141
    5142
    5143class Distance(Binary):
    5144    pass
    5145
    5146
    5147class Escape(Binary):
    5148    pass
    5149
    5150
    5151class Glob(Binary, Predicate):
    5152    pass
    5153
    5154
    5155class GT(Binary, Predicate):
    5156    pass
    5157
    5158
    5159class GTE(Binary, Predicate):
    5160    pass
    5161
    5162
    5163class ILike(Binary, Predicate):
    5164    pass
    5165
    5166
    5167class IntDiv(Binary):
    5168    pass
    5169
    5170
    5171class Is(Binary, Predicate):
    5172    pass
    5173
    5174
    5175class Kwarg(Binary):
    5176    """Kwarg in special functions like func(kwarg => y)."""
    5177
    5178
    5179class Like(Binary, Predicate):
    5180    pass
    5181
    5182
    5183class LT(Binary, Predicate):
    5184    pass
    5185
    5186
    5187class LTE(Binary, Predicate):
    5188    pass
    5189
    5190
    5191class Mod(Binary):
    5192    pass
    5193
    5194
    5195class Mul(Binary):
    5196    pass
    5197
    5198
    5199class NEQ(Binary, Predicate):
    5200    pass
    5201
    5202
    5203# https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH
    5204class Operator(Binary):
    5205    arg_types = {"this": True, "operator": True, "expression": True}
    5206
    5207
    5208class SimilarTo(Binary, Predicate):
    5209    pass
    5210
    5211
    5212class Slice(Binary):
    5213    arg_types = {"this": False, "expression": False}
    5214
    5215
    5216class Sub(Binary):
    5217    pass
    5218
    5219
    5220# Unary Expressions
    5221# (NOT a)
    5222class Unary(Condition):
    5223    pass
    5224
    5225
    5226class BitwiseNot(Unary):
    5227    pass
    5228
    5229
    5230class Not(Unary):
    5231    pass
    5232
    5233
    5234class Paren(Unary):
    5235    @property
    5236    def output_name(self) -> str:
    5237        return self.this.name
    5238
    5239
    5240class Neg(Unary):
    5241    def to_py(self) -> int | Decimal:
    5242        if self.is_number:
    5243            return self.this.to_py() * -1
    5244        return super().to_py()
    5245
    5246
    5247class Alias(Expression):
    5248    arg_types = {"this": True, "alias": False}
    5249
    5250    @property
    5251    def output_name(self) -> str:
    5252        return self.alias
    5253
    5254
    5255# BigQuery requires the UNPIVOT column list aliases to be either strings or ints, but
    5256# other dialects require identifiers. This enables us to transpile between them easily.
    5257class PivotAlias(Alias):
    5258    pass
    5259
    5260
    5261# Represents Snowflake's ANY [ ORDER BY ... ] syntax
    5262# https://docs.snowflake.com/en/sql-reference/constructs/pivot
    5263class PivotAny(Expression):
    5264    arg_types = {"this": False}
    5265
    5266
    5267class Aliases(Expression):
    5268    arg_types = {"this": True, "expressions": True}
    5269
    5270    @property
    5271    def aliases(self):
    5272        return self.expressions
    5273
    5274
    5275# https://docs.aws.amazon.com/redshift/latest/dg/query-super.html
    5276class AtIndex(Expression):
    5277    arg_types = {"this": True, "expression": True}
    5278
    5279
    5280class AtTimeZone(Expression):
    5281    arg_types = {"this": True, "zone": True}
    5282
    5283
    5284class FromTimeZone(Expression):
    5285    arg_types = {"this": True, "zone": True}
    5286
    5287
    5288class FormatPhrase(Expression):
    5289    """Format override for a column in Teradata.
    5290    Can be expanded to additional dialects as needed
    5291
    5292    https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/SQL-Data-Types-and-Literals/Data-Type-Formats-and-Format-Phrases/FORMAT
    5293    """
    5294
    5295    arg_types = {"this": True, "format": True}
    5296
    5297
    5298class Between(Predicate):
    5299    arg_types = {"this": True, "low": True, "high": True, "symmetric": False}
    5300
    5301
    5302class Bracket(Condition):
    5303    # https://cloud.google.com/bigquery/docs/reference/standard-sql/operators#array_subscript_operator
    5304    arg_types = {
    5305        "this": True,
    5306        "expressions": True,
    5307        "offset": False,
    5308        "safe": False,
    5309        "returns_list_for_maps": False,
    5310    }
    5311
    5312    @property
    5313    def output_name(self) -> str:
    5314        if len(self.expressions) == 1:
    5315            return self.expressions[0].output_name
    5316
    5317        return super().output_name
    5318
    5319
    5320class Distinct(Expression):
    5321    arg_types = {"expressions": False, "on": False}
    5322
    5323
    5324class In(Predicate):
    5325    arg_types = {
    5326        "this": True,
    5327        "expressions": False,
    5328        "query": False,
    5329        "unnest": False,
    5330        "field": False,
    5331        "is_global": False,
    5332    }
    5333
    5334
    5335# https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#for-in
    5336class ForIn(Expression):
    5337    arg_types = {"this": True, "expression": True}
    5338
    5339
    5340class TimeUnit(Expression):
    5341    """Automatically converts unit arg into a var."""
    5342
    5343    arg_types = {"unit": False}
    5344
    5345    UNABBREVIATED_UNIT_NAME = {
    5346        "D": "DAY",
    5347        "H": "HOUR",
    5348        "M": "MINUTE",
    5349        "MS": "MILLISECOND",
    5350        "NS": "NANOSECOND",
    5351        "Q": "QUARTER",
    5352        "S": "SECOND",
    5353        "US": "MICROSECOND",
    5354        "W": "WEEK",
    5355        "Y": "YEAR",
    5356    }
    5357
    5358    VAR_LIKE = (Column, Literal, Var)
    5359
    5360    def __init__(self, **args):
    5361        unit = args.get("unit")
    5362        if type(unit) in self.VAR_LIKE:
    5363            args["unit"] = Var(
    5364                this=(self.UNABBREVIATED_UNIT_NAME.get(unit.name) or unit.name).upper()
    5365            )
    5366        elif isinstance(unit, Week):
    5367            unit.set("this", Var(this=unit.this.name.upper()))
    5368
    5369        super().__init__(**args)
    5370
    5371    @property
    5372    def unit(self) -> t.Optional[Var | IntervalSpan]:
    5373        return self.args.get("unit")
    5374
    5375
    5376class IntervalOp(TimeUnit):
    5377    arg_types = {"unit": False, "expression": True}
    5378
    5379    def interval(self):
    5380        return Interval(
    5381            this=self.expression.copy(),
    5382            unit=self.unit.copy() if self.unit else None,
    5383        )
    5384
    5385
    5386# https://www.oracletutorial.com/oracle-basics/oracle-interval/
    5387# https://trino.io/docs/current/language/types.html#interval-day-to-second
    5388# https://docs.databricks.com/en/sql/language-manual/data-types/interval-type.html
    5389class IntervalSpan(DataType):
    5390    arg_types = {"this": True, "expression": True}
    5391
    5392
    5393class Interval(TimeUnit):
    5394    arg_types = {"this": False, "unit": False}
    5395
    5396
    5397class IgnoreNulls(Expression):
    5398    pass
    5399
    5400
    5401class RespectNulls(Expression):
    5402    pass
    5403
    5404
    5405# https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate-function-calls#max_min_clause
    5406class HavingMax(Expression):
    5407    arg_types = {"this": True, "expression": True, "max": True}
    5408
    5409
    5410# Functions
    5411class Func(Condition):
    5412    """
    5413    The base class for all function expressions.
    5414
    5415    Attributes:
    5416        is_var_len_args (bool): if set to True the last argument defined in arg_types will be
    5417            treated as a variable length argument and the argument's value will be stored as a list.
    5418        _sql_names (list): the SQL name (1st item in the list) and aliases (subsequent items) for this
    5419            function expression. These values are used to map this node to a name during parsing as
    5420            well as to provide the function's name during SQL string generation. By default the SQL
    5421            name is set to the expression's class name transformed to snake case.
    5422    """
    5423
    5424    is_var_len_args = False
    5425
    5426    @classmethod
    5427    def from_arg_list(cls, args):
    5428        if cls.is_var_len_args:
    5429            all_arg_keys = list(cls.arg_types)
    5430            # If this function supports variable length argument treat the last argument as such.
    5431            non_var_len_arg_keys = all_arg_keys[:-1] if cls.is_var_len_args else all_arg_keys
    5432            num_non_var = len(non_var_len_arg_keys)
    5433
    5434            args_dict = {arg_key: arg for arg, arg_key in zip(args, non_var_len_arg_keys)}
    5435            args_dict[all_arg_keys[-1]] = args[num_non_var:]
    5436        else:
    5437            args_dict = {arg_key: arg for arg, arg_key in zip(args, cls.arg_types)}
    5438
    5439        return cls(**args_dict)
    5440
    5441    @classmethod
    5442    def sql_names(cls):
    5443        if cls is Func:
    5444            raise NotImplementedError(
    5445                "SQL name is only supported by concrete function implementations"
    5446            )
    5447        if "_sql_names" not in cls.__dict__:
    5448            cls._sql_names = [camel_to_snake_case(cls.__name__)]
    5449        return cls._sql_names
    5450
    5451    @classmethod
    5452    def sql_name(cls):
    5453        sql_names = cls.sql_names()
    5454        assert sql_names, f"Expected non-empty 'sql_names' for Func: {cls.__name__}."
    5455        return sql_names[0]
    5456
    5457    @classmethod
    5458    def default_parser_mappings(cls):
    5459        return {name: cls.from_arg_list for name in cls.sql_names()}
    5460
    5461
    5462class Typeof(Func):
    5463    pass
    5464
    5465
    5466class Acos(Func):
    5467    pass
    5468
    5469
    5470class Acosh(Func):
    5471    pass
    5472
    5473
    5474class Asin(Func):
    5475    pass
    5476
    5477
    5478class Asinh(Func):
    5479    pass
    5480
    5481
    5482class Atan(Func):
    5483    arg_types = {"this": True, "expression": False}
    5484
    5485
    5486class Atanh(Func):
    5487    pass
    5488
    5489
    5490class Atan2(Func):
    5491    arg_types = {"this": True, "expression": True}
    5492
    5493
    5494class Cot(Func):
    5495    pass
    5496
    5497
    5498class Coth(Func):
    5499    pass
    5500
    5501
    5502class Csc(Func):
    5503    pass
    5504
    5505
    5506class Csch(Func):
    5507    pass
    5508
    5509
    5510class Sec(Func):
    5511    pass
    5512
    5513
    5514class Sech(Func):
    5515    pass
    5516
    5517
    5518class Sin(Func):
    5519    pass
    5520
    5521
    5522class Sinh(Func):
    5523    pass
    5524
    5525
    5526class CosineDistance(Func):
    5527    arg_types = {"this": True, "expression": True}
    5528
    5529
    5530class EuclideanDistance(Func):
    5531    arg_types = {"this": True, "expression": True}
    5532
    5533
    5534class AggFunc(Func):
    5535    pass
    5536
    5537
    5538class BitwiseAndAgg(AggFunc):
    5539    pass
    5540
    5541
    5542class BitwiseOrAgg(AggFunc):
    5543    pass
    5544
    5545
    5546class BitwiseXorAgg(AggFunc):
    5547    pass
    5548
    5549
    5550class BitwiseCountAgg(AggFunc):
    5551    pass
    5552
    5553
    5554class ByteLength(Func):
    5555    pass
    5556
    5557
    5558# https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#bool_for_json
    5559class JSONBool(Func):
    5560    pass
    5561
    5562
    5563class ArrayRemove(Func):
    5564    arg_types = {"this": True, "expression": True}
    5565
    5566
    5567class ParameterizedAgg(AggFunc):
    5568    arg_types = {"this": True, "expressions": True, "params": True}
    5569
    5570
    5571class Abs(Func):
    5572    pass
    5573
    5574
    5575class ArgMax(AggFunc):
    5576    arg_types = {"this": True, "expression": True, "count": False}
    5577    _sql_names = ["ARG_MAX", "ARGMAX", "MAX_BY"]
    5578
    5579
    5580class ArgMin(AggFunc):
    5581    arg_types = {"this": True, "expression": True, "count": False}
    5582    _sql_names = ["ARG_MIN", "ARGMIN", "MIN_BY"]
    5583
    5584
    5585class ApproxTopK(AggFunc):
    5586    arg_types = {"this": True, "expression": False, "counters": False}
    5587
    5588
    5589class ApproxTopSum(AggFunc):
    5590    arg_types = {"this": True, "expression": True, "count": True}
    5591
    5592
    5593class ApproxQuantiles(AggFunc):
    5594    arg_types = {"this": True, "expression": False}
    5595
    5596
    5597class FarmFingerprint(Func):
    5598    arg_types = {"expressions": True}
    5599    is_var_len_args = True
    5600    _sql_names = ["FARM_FINGERPRINT", "FARMFINGERPRINT64"]
    5601
    5602
    5603class Flatten(Func):
    5604    pass
    5605
    5606
    5607class Float64(Func):
    5608    arg_types = {"this": True, "expression": False}
    5609
    5610
    5611# https://spark.apache.org/docs/latest/api/sql/index.html#transform
    5612class Transform(Func):
    5613    arg_types = {"this": True, "expression": True}
    5614
    5615
    5616class Translate(Func):
    5617    arg_types = {"this": True, "from": True, "to": True}
    5618
    5619
    5620class Grouping(AggFunc):
    5621    arg_types = {"expressions": True}
    5622    is_var_len_args = True
    5623
    5624
    5625class Anonymous(Func):
    5626    arg_types = {"this": True, "expressions": False}
    5627    is_var_len_args = True
    5628
    5629    @property
    5630    def name(self) -> str:
    5631        return self.this if isinstance(self.this, str) else self.this.name
    5632
    5633
    5634class AnonymousAggFunc(AggFunc):
    5635    arg_types = {"this": True, "expressions": False}
    5636    is_var_len_args = True
    5637
    5638
    5639# https://clickhouse.com/docs/en/sql-reference/aggregate-functions/combinators
    5640class CombinedAggFunc(AnonymousAggFunc):
    5641    arg_types = {"this": True, "expressions": False}
    5642
    5643
    5644class CombinedParameterizedAgg(ParameterizedAgg):
    5645    arg_types = {"this": True, "expressions": True, "params": True}
    5646
    5647
    5648# https://docs.snowflake.com/en/sql-reference/functions/hll
    5649# https://docs.aws.amazon.com/redshift/latest/dg/r_HLL_function.html
    5650class Hll(AggFunc):
    5651    arg_types = {"this": True, "expressions": False}
    5652    is_var_len_args = True
    5653
    5654
    5655class ApproxDistinct(AggFunc):
    5656    arg_types = {"this": True, "accuracy": False}
    5657    _sql_names = ["APPROX_DISTINCT", "APPROX_COUNT_DISTINCT"]
    5658
    5659
    5660class Apply(Func):
    5661    arg_types = {"this": True, "expression": True}
    5662
    5663
    5664class Array(Func):
    5665    arg_types = {"expressions": False, "bracket_notation": False}
    5666    is_var_len_args = True
    5667
    5668
    5669class Ascii(Func):
    5670    pass
    5671
    5672
    5673# https://docs.snowflake.com/en/sql-reference/functions/to_array
    5674class ToArray(Func):
    5675    pass
    5676
    5677
    5678# https://materialize.com/docs/sql/types/list/
    5679class List(Func):
    5680    arg_types = {"expressions": False}
    5681    is_var_len_args = True
    5682
    5683
    5684# String pad, kind True -> LPAD, False -> RPAD
    5685class Pad(Func):
    5686    arg_types = {"this": True, "expression": True, "fill_pattern": False, "is_left": True}
    5687
    5688
    5689# https://docs.snowflake.com/en/sql-reference/functions/to_char
    5690# https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_CHAR-number.html
    5691class ToChar(Func):
    5692    arg_types = {
    5693        "this": True,
    5694        "format": False,
    5695        "nlsparam": False,
    5696        "is_numeric": False,
    5697    }
    5698
    5699
    5700class ToCodePoints(Func):
    5701    pass
    5702
    5703
    5704# https://docs.snowflake.com/en/sql-reference/functions/to_decimal
    5705# https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_NUMBER.html
    5706class ToNumber(Func):
    5707    arg_types = {
    5708        "this": True,
    5709        "format": False,
    5710        "nlsparam": False,
    5711        "precision": False,
    5712        "scale": False,
    5713    }
    5714
    5715
    5716# https://docs.snowflake.com/en/sql-reference/functions/to_double
    5717class ToDouble(Func):
    5718    arg_types = {
    5719        "this": True,
    5720        "format": False,
    5721    }
    5722
    5723
    5724class CodePointsToBytes(Func):
    5725    pass
    5726
    5727
    5728class Columns(Func):
    5729    arg_types = {"this": True, "unpack": False}
    5730
    5731
    5732# https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-ver16#syntax
    5733class Convert(Func):
    5734    arg_types = {"this": True, "expression": True, "style": False}
    5735
    5736
    5737# https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/CONVERT.html
    5738class ConvertToCharset(Func):
    5739    arg_types = {"this": True, "dest": True, "source": False}
    5740
    5741
    5742class ConvertTimezone(Func):
    5743    arg_types = {
    5744        "source_tz": False,
    5745        "target_tz": True,
    5746        "timestamp": True,
    5747        "options": False,
    5748    }
    5749
    5750
    5751class CodePointsToString(Func):
    5752    pass
    5753
    5754
    5755class GenerateSeries(Func):
    5756    arg_types = {"start": True, "end": True, "step": False, "is_end_exclusive": False}
    5757
    5758
    5759# Postgres' GENERATE_SERIES function returns a row set, i.e. it implicitly explodes when it's
    5760# used in a projection, so this expression is a helper that facilitates transpilation to other
    5761# dialects. For example, we'd generate UNNEST(GENERATE_SERIES(...)) in DuckDB
    5762class ExplodingGenerateSeries(GenerateSeries):
    5763    pass
    5764
    5765
    5766class ArrayAgg(AggFunc):
    5767    arg_types = {"this": True, "nulls_excluded": False}
    5768
    5769
    5770class ArrayUniqueAgg(AggFunc):
    5771    pass
    5772
    5773
    5774class AIAgg(AggFunc):
    5775    arg_types = {"this": True, "expression": True}
    5776    _sql_names = ["AI_AGG"]
    5777
    5778
    5779class AISummarizeAgg(AggFunc):
    5780    _sql_names = ["AI_SUMMARIZE_AGG"]
    5781
    5782
    5783class AIClassify(Func):
    5784    arg_types = {"this": True, "categories": True, "config": False}
    5785    _sql_names = ["AI_CLASSIFY"]
    5786
    5787
    5788class ArrayAll(Func):
    5789    arg_types = {"this": True, "expression": True}
    5790
    5791
    5792# Represents Python's `any(f(x) for x in array)`, where `array` is `this` and `f` is `expression`
    5793class ArrayAny(Func):
    5794    arg_types = {"this": True, "expression": True}
    5795
    5796
    5797class ArrayConcat(Func):
    5798    _sql_names = ["ARRAY_CONCAT", "ARRAY_CAT"]
    5799    arg_types = {"this": True, "expressions": False}
    5800    is_var_len_args = True
    5801
    5802
    5803class ArrayConcatAgg(AggFunc):
    5804    pass
    5805
    5806
    5807class ArrayConstructCompact(Func):
    5808    arg_types = {"expressions": True}
    5809    is_var_len_args = True
    5810
    5811
    5812class ArrayContains(Binary, Func):
    5813    _sql_names = ["ARRAY_CONTAINS", "ARRAY_HAS"]
    5814
    5815
    5816class ArrayContainsAll(Binary, Func):
    5817    _sql_names = ["ARRAY_CONTAINS_ALL", "ARRAY_HAS_ALL"]
    5818
    5819
    5820class ArrayFilter(Func):
    5821    arg_types = {"this": True, "expression": True}
    5822    _sql_names = ["FILTER", "ARRAY_FILTER"]
    5823
    5824
    5825class ArrayFirst(Func):
    5826    pass
    5827
    5828
    5829class ArrayLast(Func):
    5830    pass
    5831
    5832
    5833class ArrayReverse(Func):
    5834    pass
    5835
    5836
    5837class ArraySlice(Func):
    5838    arg_types = {"this": True, "start": True, "end": False, "step": False}
    5839
    5840
    5841class ArrayToString(Func):
    5842    arg_types = {"this": True, "expression": True, "null": False}
    5843    _sql_names = ["ARRAY_TO_STRING", "ARRAY_JOIN"]
    5844
    5845
    5846class ArrayIntersect(Func):
    5847    arg_types = {"expressions": True}
    5848    is_var_len_args = True
    5849    _sql_names = ["ARRAY_INTERSECT", "ARRAY_INTERSECTION"]
    5850
    5851
    5852class StPoint(Func):
    5853    arg_types = {"this": True, "expression": True, "null": False}
    5854    _sql_names = ["ST_POINT", "ST_MAKEPOINT"]
    5855
    5856
    5857class StDistance(Func):
    5858    arg_types = {"this": True, "expression": True, "use_spheroid": False}
    5859
    5860
    5861# https://cloud.google.com/bigquery/docs/reference/standard-sql/timestamp_functions#string
    5862class String(Func):
    5863    arg_types = {"this": True, "zone": False}
    5864
    5865
    5866class StringToArray(Func):
    5867    arg_types = {"this": True, "expression": False, "null": False}
    5868    _sql_names = ["STRING_TO_ARRAY", "SPLIT_BY_STRING", "STRTOK_TO_ARRAY"]
    5869
    5870
    5871class ArrayOverlaps(Binary, Func):
    5872    pass
    5873
    5874
    5875class ArraySize(Func):
    5876    arg_types = {"this": True, "expression": False}
    5877    _sql_names = ["ARRAY_SIZE", "ARRAY_LENGTH"]
    5878
    5879
    5880class ArraySort(Func):
    5881    arg_types = {"this": True, "expression": False}
    5882
    5883
    5884class ArraySum(Func):
    5885    arg_types = {"this": True, "expression": False}
    5886
    5887
    5888class ArrayUnionAgg(AggFunc):
    5889    pass
    5890
    5891
    5892class Avg(AggFunc):
    5893    pass
    5894
    5895
    5896class AnyValue(AggFunc):
    5897    pass
    5898
    5899
    5900class Lag(AggFunc):
    5901    arg_types = {"this": True, "offset": False, "default": False}
    5902
    5903
    5904class Lead(AggFunc):
    5905    arg_types = {"this": True, "offset": False, "default": False}
    5906
    5907
    5908# some dialects have a distinction between first and first_value, usually first is an aggregate func
    5909# and first_value is a window func
    5910class First(AggFunc):
    5911    pass
    5912
    5913
    5914class Last(AggFunc):
    5915    pass
    5916
    5917
    5918class FirstValue(AggFunc):
    5919    pass
    5920
    5921
    5922class LastValue(AggFunc):
    5923    pass
    5924
    5925
    5926class NthValue(AggFunc):
    5927    arg_types = {"this": True, "offset": True}
    5928
    5929
    5930class Case(Func):
    5931    arg_types = {"this": False, "ifs": True, "default": False}
    5932
    5933    def when(self, condition: ExpOrStr, then: ExpOrStr, copy: bool = True, **opts) -> Case:
    5934        instance = maybe_copy(self, copy)
    5935        instance.append(
    5936            "ifs",
    5937            If(
    5938                this=maybe_parse(condition, copy=copy, **opts),
    5939                true=maybe_parse(then, copy=copy, **opts),
    5940            ),
    5941        )
    5942        return instance
    5943
    5944    def else_(self, condition: ExpOrStr, copy: bool = True, **opts) -> Case:
    5945        instance = maybe_copy(self, copy)
    5946        instance.set("default", maybe_parse(condition, copy=copy, **opts))
    5947        return instance
    5948
    5949
    5950class Cast(Func):
    5951    arg_types = {
    5952        "this": True,
    5953        "to": True,
    5954        "format": False,
    5955        "safe": False,
    5956        "action": False,
    5957        "default": False,
    5958    }
    5959
    5960    @property
    5961    def name(self) -> str:
    5962        return self.this.name
    5963
    5964    @property
    5965    def to(self) -> DataType:
    5966        return self.args["to"]
    5967
    5968    @property
    5969    def output_name(self) -> str:
    5970        return self.name
    5971
    5972    def is_type(self, *dtypes: DATA_TYPE) -> bool:
    5973        """
    5974        Checks whether this Cast's DataType matches one of the provided data types. Nested types
    5975        like arrays or structs will be compared using "structural equivalence" semantics, so e.g.
    5976        array<int> != array<float>.
    5977
    5978        Args:
    5979            dtypes: the data types to compare this Cast's DataType to.
    5980
    5981        Returns:
    5982            True, if and only if there is a type in `dtypes` which is equal to this Cast's DataType.
    5983        """
    5984        return self.to.is_type(*dtypes)
    5985
    5986
    5987class TryCast(Cast):
    5988    arg_types = {**Cast.arg_types, "requires_string": False}
    5989
    5990
    5991# https://clickhouse.com/docs/sql-reference/data-types/newjson#reading-json-paths-as-sub-columns
    5992class JSONCast(Cast):
    5993    pass
    5994
    5995
    5996class JustifyDays(Func):
    5997    pass
    5998
    5999
    6000class JustifyHours(Func):
    6001    pass
    6002
    6003
    6004class JustifyInterval(Func):
    6005    pass
    6006
    6007
    6008class Try(Func):
    6009    pass
    6010
    6011
    6012class CastToStrType(Func):
    6013    arg_types = {"this": True, "to": True}
    6014
    6015
    6016# https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/SQL-Functions-Expressions-and-Predicates/String-Operators-and-Functions/TRANSLATE/TRANSLATE-Function-Syntax
    6017class TranslateCharacters(Expression):
    6018    arg_types = {"this": True, "expression": True, "with_error": False}
    6019
    6020
    6021class Collate(Binary, Func):
    6022    pass
    6023
    6024
    6025class Ceil(Func):
    6026    arg_types = {"this": True, "decimals": False, "to": False}
    6027    _sql_names = ["CEIL", "CEILING"]
    6028
    6029
    6030class Coalesce(Func):
    6031    arg_types = {"this": True, "expressions": False, "is_nvl": False, "is_null": False}
    6032    is_var_len_args = True
    6033    _sql_names = ["COALESCE", "IFNULL", "NVL"]
    6034
    6035
    6036class Chr(Func):
    6037    arg_types = {"expressions": True, "charset": False}
    6038    is_var_len_args = True
    6039    _sql_names = ["CHR", "CHAR"]
    6040
    6041
    6042class Concat(Func):
    6043    arg_types = {"expressions": True, "safe": False, "coalesce": False}
    6044    is_var_len_args = True
    6045
    6046
    6047class ConcatWs(Concat):
    6048    _sql_names = ["CONCAT_WS"]
    6049
    6050
    6051# https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#contains_substr
    6052class Contains(Func):
    6053    arg_types = {"this": True, "expression": True, "json_scope": False}
    6054
    6055
    6056# https://docs.oracle.com/cd/B13789_01/server.101/b10759/operators004.htm#i1035022
    6057class ConnectByRoot(Func):
    6058    pass
    6059
    6060
    6061class Count(AggFunc):
    6062    arg_types = {"this": False, "expressions": False, "big_int": False}
    6063    is_var_len_args = True
    6064
    6065
    6066class CountIf(AggFunc):
    6067    _sql_names = ["COUNT_IF", "COUNTIF"]
    6068
    6069
    6070# cube root
    6071class Cbrt(Func):
    6072    pass
    6073
    6074
    6075class CurrentDate(Func):
    6076    arg_types = {"this": False}
    6077
    6078
    6079class CurrentDatetime(Func):
    6080    arg_types = {"this": False}
    6081
    6082
    6083class CurrentTime(Func):
    6084    arg_types = {"this": False}
    6085
    6086
    6087class CurrentTimestamp(Func):
    6088    arg_types = {"this": False, "sysdate": False}
    6089
    6090
    6091class CurrentTimestampLTZ(Func):
    6092    arg_types = {}
    6093
    6094
    6095class CurrentSchema(Func):
    6096    arg_types = {"this": False}
    6097
    6098
    6099class CurrentUser(Func):
    6100    arg_types = {"this": False}
    6101
    6102
    6103class UtcDate(Func):
    6104    arg_types = {}
    6105
    6106
    6107class UtcTime(Func):
    6108    arg_types = {"this": False}
    6109
    6110
    6111class UtcTimestamp(Func):
    6112    arg_types = {"this": False}
    6113
    6114
    6115class DateAdd(Func, IntervalOp):
    6116    arg_types = {"this": True, "expression": True, "unit": False}
    6117
    6118
    6119class DateBin(Func, IntervalOp):
    6120    arg_types = {"this": True, "expression": True, "unit": False, "zone": False, "origin": False}
    6121
    6122
    6123class DateSub(Func, IntervalOp):
    6124    arg_types = {"this": True, "expression": True, "unit": False}
    6125
    6126
    6127class DateDiff(Func, TimeUnit):
    6128    _sql_names = ["DATEDIFF", "DATE_DIFF"]
    6129    arg_types = {"this": True, "expression": True, "unit": False, "zone": False}
    6130
    6131
    6132class DateTrunc(Func):
    6133    arg_types = {"unit": True, "this": True, "zone": False}
    6134
    6135    def __init__(self, **args):
    6136        # Across most dialects it's safe to unabbreviate the unit (e.g. 'Q' -> 'QUARTER') except Oracle
    6137        # https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/ROUND-and-TRUNC-Date-Functions.html
    6138        unabbreviate = args.pop("unabbreviate", True)
    6139
    6140        unit = args.get("unit")
    6141        if isinstance(unit, TimeUnit.VAR_LIKE):
    6142            unit_name = unit.name.upper()
    6143            if unabbreviate and unit_name in TimeUnit.UNABBREVIATED_UNIT_NAME:
    6144                unit_name = TimeUnit.UNABBREVIATED_UNIT_NAME[unit_name]
    6145
    6146            args["unit"] = Literal.string(unit_name)
    6147
    6148        super().__init__(**args)
    6149
    6150    @property
    6151    def unit(self) -> Expression:
    6152        return self.args["unit"]
    6153
    6154
    6155# https://cloud.google.com/bigquery/docs/reference/standard-sql/datetime_functions#datetime
    6156# expression can either be time_expr or time_zone
    6157class Datetime(Func):
    6158    arg_types = {"this": True, "expression": False}
    6159
    6160
    6161class DatetimeAdd(Func, IntervalOp):
    6162    arg_types = {"this": True, "expression": True, "unit": False}
    6163
    6164
    6165class DatetimeSub(Func, IntervalOp):
    6166    arg_types = {"this": True, "expression": True, "unit": False}
    6167
    6168
    6169class DatetimeDiff(Func, TimeUnit):
    6170    arg_types = {"this": True, "expression": True, "unit": False}
    6171
    6172
    6173class DatetimeTrunc(Func, TimeUnit):
    6174    arg_types = {"this": True, "unit": True, "zone": False}
    6175
    6176
    6177class DateFromUnixDate(Func):
    6178    pass
    6179
    6180
    6181class DayOfWeek(Func):
    6182    _sql_names = ["DAY_OF_WEEK", "DAYOFWEEK"]
    6183
    6184
    6185# https://duckdb.org/docs/sql/functions/datepart.html#part-specifiers-only-usable-as-date-part-specifiers
    6186# ISO day of week function in duckdb is ISODOW
    6187class DayOfWeekIso(Func):
    6188    _sql_names = ["DAYOFWEEK_ISO", "ISODOW"]
    6189
    6190
    6191class DayOfMonth(Func):
    6192    _sql_names = ["DAY_OF_MONTH", "DAYOFMONTH"]
    6193
    6194
    6195class DayOfYear(Func):
    6196    _sql_names = ["DAY_OF_YEAR", "DAYOFYEAR"]
    6197
    6198
    6199class ToDays(Func):
    6200    pass
    6201
    6202
    6203class WeekOfYear(Func):
    6204    _sql_names = ["WEEK_OF_YEAR", "WEEKOFYEAR"]
    6205
    6206
    6207class MonthsBetween(Func):
    6208    arg_types = {"this": True, "expression": True, "roundoff": False}
    6209
    6210
    6211class MakeInterval(Func):
    6212    arg_types = {
    6213        "year": False,
    6214        "month": False,
    6215        "day": False,
    6216        "hour": False,
    6217        "minute": False,
    6218        "second": False,
    6219    }
    6220
    6221
    6222class LastDay(Func, TimeUnit):
    6223    _sql_names = ["LAST_DAY", "LAST_DAY_OF_MONTH"]
    6224    arg_types = {"this": True, "unit": False}
    6225
    6226
    6227class LaxBool(Func):
    6228    pass
    6229
    6230
    6231class LaxFloat64(Func):
    6232    pass
    6233
    6234
    6235class LaxInt64(Func):
    6236    pass
    6237
    6238
    6239class LaxString(Func):
    6240    pass
    6241
    6242
    6243class Extract(Func):
    6244    arg_types = {"this": True, "expression": True}
    6245
    6246
    6247class Exists(Func, SubqueryPredicate):
    6248    arg_types = {"this": True, "expression": False}
    6249
    6250
    6251class Timestamp(Func):
    6252    arg_types = {"this": False, "zone": False, "with_tz": False}
    6253
    6254
    6255class TimestampAdd(Func, TimeUnit):
    6256    arg_types = {"this": True, "expression": True, "unit": False}
    6257
    6258
    6259class TimestampSub(Func, TimeUnit):
    6260    arg_types = {"this": True, "expression": True, "unit": False}
    6261
    6262
    6263class TimestampDiff(Func, TimeUnit):
    6264    _sql_names = ["TIMESTAMPDIFF", "TIMESTAMP_DIFF"]
    6265    arg_types = {"this": True, "expression": True, "unit": False}
    6266
    6267
    6268class TimestampTrunc(Func, TimeUnit):
    6269    arg_types = {"this": True, "unit": True, "zone": False}
    6270
    6271
    6272class TimeAdd(Func, TimeUnit):
    6273    arg_types = {"this": True, "expression": True, "unit": False}
    6274
    6275
    6276class TimeSub(Func, TimeUnit):
    6277    arg_types = {"this": True, "expression": True, "unit": False}
    6278
    6279
    6280class TimeDiff(Func, TimeUnit):
    6281    arg_types = {"this": True, "expression": True, "unit": False}
    6282
    6283
    6284class TimeTrunc(Func, TimeUnit):
    6285    arg_types = {"this": True, "unit": True, "zone": False}
    6286
    6287
    6288class DateFromParts(Func):
    6289    _sql_names = ["DATE_FROM_PARTS", "DATEFROMPARTS"]
    6290    arg_types = {"year": True, "month": True, "day": True}
    6291
    6292
    6293class TimeFromParts(Func):
    6294    _sql_names = ["TIME_FROM_PARTS", "TIMEFROMPARTS"]
    6295    arg_types = {
    6296        "hour": True,
    6297        "min": True,
    6298        "sec": True,
    6299        "nano": False,
    6300        "fractions": False,
    6301        "precision": False,
    6302    }
    6303
    6304
    6305class DateStrToDate(Func):
    6306    pass
    6307
    6308
    6309class DateToDateStr(Func):
    6310    pass
    6311
    6312
    6313class DateToDi(Func):
    6314    pass
    6315
    6316
    6317# https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date
    6318class Date(Func):
    6319    arg_types = {"this": False, "zone": False, "expressions": False}
    6320    is_var_len_args = True
    6321
    6322
    6323class Day(Func):
    6324    pass
    6325
    6326
    6327class Decode(Func):
    6328    arg_types = {"this": True, "charset": True, "replace": False}
    6329
    6330
    6331class DecodeCase(Func):
    6332    arg_types = {"expressions": True}
    6333    is_var_len_args = True
    6334
    6335
    6336class DenseRank(AggFunc):
    6337    arg_types = {"expressions": False}
    6338    is_var_len_args = True
    6339
    6340
    6341class DiToDate(Func):
    6342    pass
    6343
    6344
    6345class Encode(Func):
    6346    arg_types = {"this": True, "charset": True}
    6347
    6348
    6349class Exp(Func):
    6350    pass
    6351
    6352
    6353# https://docs.snowflake.com/en/sql-reference/functions/flatten
    6354class Explode(Func, UDTF):
    6355    arg_types = {"this": True, "expressions": False}
    6356    is_var_len_args = True
    6357
    6358
    6359# https://spark.apache.org/docs/latest/api/sql/#inline
    6360class Inline(Func):
    6361    pass
    6362
    6363
    6364class ExplodeOuter(Explode):
    6365    pass
    6366
    6367
    6368class Posexplode(Explode):
    6369    pass
    6370
    6371
    6372class PosexplodeOuter(Posexplode, ExplodeOuter):
    6373    pass
    6374
    6375
    6376class PositionalColumn(Expression):
    6377    pass
    6378
    6379
    6380class Unnest(Func, UDTF):
    6381    arg_types = {
    6382        "expressions": True,
    6383        "alias": False,
    6384        "offset": False,
    6385        "explode_array": False,
    6386    }
    6387
    6388    @property
    6389    def selects(self) -> t.List[Expression]:
    6390        columns = super().selects
    6391        offset = self.args.get("offset")
    6392        if offset:
    6393            columns = columns + [to_identifier("offset") if offset is True else offset]
    6394        return columns
    6395
    6396
    6397class Floor(Func):
    6398    arg_types = {"this": True, "decimals": False, "to": False}
    6399
    6400
    6401class FromBase32(Func):
    6402    pass
    6403
    6404
    6405class FromBase64(Func):
    6406    pass
    6407
    6408
    6409class ToBase32(Func):
    6410    pass
    6411
    6412
    6413class ToBase64(Func):
    6414    pass
    6415
    6416
    6417# https://docs.snowflake.com/en/sql-reference/functions/base64_decode_binary
    6418class Base64DecodeBinary(Func):
    6419    arg_types = {"this": True, "alphabet": False}
    6420
    6421
    6422class Base64DecodeString(Func):
    6423    arg_types = {"this": True, "alphabet": False}
    6424
    6425
    6426class Base64Encode(Func):
    6427    arg_types = {"this": True, "max_line_length": False, "alphabet": False}
    6428
    6429
    6430# https://trino.io/docs/current/functions/datetime.html#from_iso8601_timestamp
    6431class FromISO8601Timestamp(Func):
    6432    _sql_names = ["FROM_ISO8601_TIMESTAMP"]
    6433
    6434
    6435class GapFill(Func):
    6436    arg_types = {
    6437        "this": True,
    6438        "ts_column": True,
    6439        "bucket_width": True,
    6440        "partitioning_columns": False,
    6441        "value_columns": False,
    6442        "origin": False,
    6443        "ignore_nulls": False,
    6444    }
    6445
    6446
    6447# https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#generate_date_array
    6448class GenerateDateArray(Func):
    6449    arg_types = {"start": True, "end": True, "step": False}
    6450
    6451
    6452# https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#generate_timestamp_array
    6453class GenerateTimestampArray(Func):
    6454    arg_types = {"start": True, "end": True, "step": True}
    6455
    6456
    6457# https://docs.snowflake.com/en/sql-reference/functions/get
    6458class GetExtract(Func):
    6459    arg_types = {"this": True, "expression": True}
    6460
    6461
    6462class Greatest(Func):
    6463    arg_types = {"this": True, "expressions": False}
    6464    is_var_len_args = True
    6465
    6466
    6467# Trino's `ON OVERFLOW TRUNCATE [filler_string] {WITH | WITHOUT} COUNT`
    6468# https://trino.io/docs/current/functions/aggregate.html#listagg
    6469class OverflowTruncateBehavior(Expression):
    6470    arg_types = {"this": False, "with_count": True}
    6471
    6472
    6473class GroupConcat(AggFunc):
    6474    arg_types = {"this": True, "separator": False, "on_overflow": False}
    6475
    6476
    6477class Hex(Func):
    6478    pass
    6479
    6480
    6481# https://docs.snowflake.com/en/sql-reference/functions/hex_decode_string
    6482class HexDecodeString(Func):
    6483    pass
    6484
    6485
    6486class HexEncode(Func):
    6487    arg_types = {"this": True, "case": False}
    6488
    6489
    6490# T-SQL: https://learn.microsoft.com/en-us/sql/t-sql/functions/compress-transact-sql?view=sql-server-ver17
    6491# Snowflake: https://docs.snowflake.com/en/sql-reference/functions/compress
    6492class Compress(Func):
    6493    arg_types = {"this": True, "method": False}
    6494
    6495
    6496class LowerHex(Hex):
    6497    pass
    6498
    6499
    6500class And(Connector, Func):
    6501    pass
    6502
    6503
    6504class Or(Connector, Func):
    6505    pass
    6506
    6507
    6508class Xor(Connector, Func):
    6509    arg_types = {"this": False, "expression": False, "expressions": False}
    6510
    6511
    6512class If(Func):
    6513    arg_types = {"this": True, "true": True, "false": False}
    6514    _sql_names = ["IF", "IIF"]
    6515
    6516
    6517class Nullif(Func):
    6518    arg_types = {"this": True, "expression": True}
    6519
    6520
    6521class Initcap(Func):
    6522    arg_types = {"this": True, "expression": False}
    6523
    6524
    6525class IsAscii(Func):
    6526    pass
    6527
    6528
    6529class IsNan(Func):
    6530    _sql_names = ["IS_NAN", "ISNAN"]
    6531
    6532
    6533# https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#int64_for_json
    6534class Int64(Func):
    6535    pass
    6536
    6537
    6538class IsInf(Func):
    6539    _sql_names = ["IS_INF", "ISINF"]
    6540
    6541
    6542# https://www.postgresql.org/docs/current/functions-json.html
    6543class JSON(Expression):
    6544    arg_types = {"this": False, "with": False, "unique": False}
    6545
    6546
    6547class JSONPath(Expression):
    6548    arg_types = {"expressions": True, "escape": False}
    6549
    6550    @property
    6551    def output_name(self) -> str:
    6552        last_segment = self.expressions[-1].this
    6553        return last_segment if isinstance(last_segment, str) else ""
    6554
    6555
    6556class JSONPathPart(Expression):
    6557    arg_types = {}
    6558
    6559
    6560class JSONPathFilter(JSONPathPart):
    6561    arg_types = {"this": True}
    6562
    6563
    6564class JSONPathKey(JSONPathPart):
    6565    arg_types = {"this": True}
    6566
    6567
    6568class JSONPathRecursive(JSONPathPart):
    6569    arg_types = {"this": False}
    6570
    6571
    6572class JSONPathRoot(JSONPathPart):
    6573    pass
    6574
    6575
    6576class JSONPathScript(JSONPathPart):
    6577    arg_types = {"this": True}
    6578
    6579
    6580class JSONPathSlice(JSONPathPart):
    6581    arg_types = {"start": False, "end": False, "step": False}
    6582
    6583
    6584class JSONPathSelector(JSONPathPart):
    6585    arg_types = {"this": True}
    6586
    6587
    6588class JSONPathSubscript(JSONPathPart):
    6589    arg_types = {"this": True}
    6590
    6591
    6592class JSONPathUnion(JSONPathPart):
    6593    arg_types = {"expressions": True}
    6594
    6595
    6596class JSONPathWildcard(JSONPathPart):
    6597    pass
    6598
    6599
    6600class FormatJson(Expression):
    6601    pass
    6602
    6603
    6604class Format(Func):
    6605    arg_types = {"this": True, "expressions": True}
    6606    is_var_len_args = True
    6607
    6608
    6609class JSONKeyValue(Expression):
    6610    arg_types = {"this": True, "expression": True}
    6611
    6612
    6613# https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#json_keys
    6614class JSONKeysAtDepth(Func):
    6615    arg_types = {"this": True, "expression": False, "mode": False}
    6616
    6617
    6618class JSONObject(Func):
    6619    arg_types = {
    6620        "expressions": False,
    6621        "null_handling": False,
    6622        "unique_keys": False,
    6623        "return_type": False,
    6624        "encoding": False,
    6625    }
    6626
    6627
    6628class JSONObjectAgg(AggFunc):
    6629    arg_types = {
    6630        "expressions": False,
    6631        "null_handling": False,
    6632        "unique_keys": False,
    6633        "return_type": False,
    6634        "encoding": False,
    6635    }
    6636
    6637
    6638# https://www.postgresql.org/docs/9.5/functions-aggregate.html
    6639class JSONBObjectAgg(AggFunc):
    6640    arg_types = {"this": True, "expression": True}
    6641
    6642
    6643# https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/JSON_ARRAY.html
    6644class JSONArray(Func):
    6645    arg_types = {
    6646        "expressions": False,
    6647        "null_handling": False,
    6648        "return_type": False,
    6649        "strict": False,
    6650    }
    6651
    6652
    6653# https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/JSON_ARRAYAGG.html
    6654class JSONArrayAgg(Func):
    6655    arg_types = {
    6656        "this": True,
    6657        "order": False,
    6658        "null_handling": False,
    6659        "return_type": False,
    6660        "strict": False,
    6661    }
    6662
    6663
    6664class JSONExists(Func):
    6665    arg_types = {"this": True, "path": True, "passing": False, "on_condition": False}
    6666
    6667
    6668# https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/JSON_TABLE.html
    6669# Note: parsing of JSON column definitions is currently incomplete.
    6670class JSONColumnDef(Expression):
    6671    arg_types = {"this": False, "kind": False, "path": False, "nested_schema": False}
    6672
    6673
    6674class JSONSchema(Expression):
    6675    arg_types = {"expressions": True}
    6676
    6677
    6678class JSONSet(Func):
    6679    arg_types = {"this": True, "expressions": True}
    6680    is_var_len_args = True
    6681    _sql_names = ["JSON_SET"]
    6682
    6683
    6684# https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#json_strip_nulls
    6685class JSONStripNulls(Func):
    6686    arg_types = {
    6687        "this": True,
    6688        "expression": False,
    6689        "include_arrays": False,
    6690        "remove_empty": False,
    6691    }
    6692    _sql_names = ["JSON_STRIP_NULLS"]
    6693
    6694
    6695# https://dev.mysql.com/doc/refman/8.4/en/json-search-functions.html#function_json-value
    6696class JSONValue(Expression):
    6697    arg_types = {
    6698        "this": True,
    6699        "path": True,
    6700        "returning": False,
    6701        "on_condition": False,
    6702    }
    6703
    6704
    6705class JSONValueArray(Func):
    6706    arg_types = {"this": True, "expression": False}
    6707
    6708
    6709class JSONRemove(Func):
    6710    arg_types = {"this": True, "expressions": True}
    6711    is_var_len_args = True
    6712    _sql_names = ["JSON_REMOVE"]
    6713
    6714
    6715# https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/JSON_TABLE.html
    6716class JSONTable(Func):
    6717    arg_types = {
    6718        "this": True,
    6719        "schema": True,
    6720        "path": False,
    6721        "error_handling": False,
    6722        "empty_handling": False,
    6723    }
    6724
    6725
    6726# https://cloud.google.com/bigquery/docs/reference/standard-sql/json_functions#json_type
    6727# https://doris.apache.org/docs/sql-manual/sql-functions/scalar-functions/json-functions/json-type#description
    6728class JSONType(Func):
    6729    arg_types = {"this": True, "expression": False}
    6730    _sql_names = ["JSON_TYPE"]
    6731
    6732
    6733# https://docs.snowflake.com/en/sql-reference/functions/object_insert
    6734class ObjectInsert(Func):
    6735    arg_types = {
    6736        "this": True,
    6737        "key": True,
    6738        "value": True,
    6739        "update_flag": False,
    6740    }
    6741
    6742
    6743class OpenJSONColumnDef(Expression):
    6744    arg_types = {"this": True, "kind": True, "path": False, "as_json": False}
    6745
    6746
    6747class OpenJSON(Func):
    6748    arg_types = {"this": True, "path": False, "expressions": False}
    6749
    6750
    6751class JSONBContains(Binary, Func):
    6752    _sql_names = ["JSONB_CONTAINS"]
    6753
    6754
    6755# https://www.postgresql.org/docs/9.5/functions-json.html
    6756class JSONBContainsAnyTopKeys(Binary, Func):
    6757    pass
    6758
    6759
    6760# https://www.postgresql.org/docs/9.5/functions-json.html
    6761class JSONBContainsAllTopKeys(Binary, Func):
    6762    pass
    6763
    6764
    6765class JSONBExists(Func):
    6766    arg_types = {"this": True, "path": True}
    6767    _sql_names = ["JSONB_EXISTS"]
    6768
    6769
    6770# https://www.postgresql.org/docs/9.5/functions-json.html
    6771class JSONBDeleteAtPath(Binary, Func):
    6772    pass
    6773
    6774
    6775class JSONExtract(Binary, Func):
    6776    arg_types = {
    6777        "this": True,
    6778        "expression": True,
    6779        "only_json_types": False,
    6780        "expressions": False,
    6781        "variant_extract": False,
    6782        "json_query": False,
    6783        "option": False,
    6784        "quote": False,
    6785        "on_condition": False,
    6786        "requires_json": False,
    6787    }
    6788    _sql_names = ["JSON_EXTRACT"]
    6789    is_var_len_args = True
    6790
    6791    @property
    6792    def output_name(self) -> str:
    6793        return self.expression.output_name if not self.expressions else ""
    6794
    6795
    6796# https://trino.io/docs/current/functions/json.html#json-query
    6797class JSONExtractQuote(Expression):
    6798    arg_types = {
    6799        "option": True,
    6800        "scalar": False,
    6801    }
    6802
    6803
    6804class JSONExtractArray(Func):
    6805    arg_types = {"this": True, "expression": False}
    6806    _sql_names = ["JSON_EXTRACT_ARRAY"]
    6807
    6808
    6809class JSONExtractScalar(Binary, Func):
    6810    arg_types = {
    6811        "this": True,
    6812        "expression": True,
    6813        "only_json_types": False,
    6814        "expressions": False,
    6815        "json_type": False,
    6816    }
    6817    _sql_names = ["JSON_EXTRACT_SCALAR"]
    6818    is_var_len_args = True
    6819
    6820    @property
    6821    def output_name(self) -> str:
    6822        return self.expression.output_name
    6823
    6824
    6825class JSONBExtract(Binary, Func):
    6826    _sql_names = ["JSONB_EXTRACT"]
    6827
    6828
    6829class JSONBExtractScalar(Binary, Func):
    6830    arg_types = {"this": True, "expression": True, "json_type": False}
    6831    _sql_names = ["JSONB_EXTRACT_SCALAR"]
    6832
    6833
    6834class JSONFormat(Func):
    6835    arg_types = {"this": False, "options": False, "is_json": False, "to_json": False}
    6836    _sql_names = ["JSON_FORMAT"]
    6837
    6838
    6839class JSONArrayAppend(Func):
    6840    arg_types = {"this": True, "expressions": True}
    6841    is_var_len_args = True
    6842    _sql_names = ["JSON_ARRAY_APPEND"]
    6843
    6844
    6845# https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#operator_member-of
    6846class JSONArrayContains(Binary, Predicate, Func):
    6847    arg_types = {"this": True, "expression": True, "json_type": False}
    6848    _sql_names = ["JSON_ARRAY_CONTAINS"]
    6849
    6850
    6851class JSONArrayInsert(Func):
    6852    arg_types = {"this": True, "expressions": True}
    6853    is_var_len_args = True
    6854    _sql_names = ["JSON_ARRAY_INSERT"]
    6855
    6856
    6857class ParseBignumeric(Func):
    6858    pass
    6859
    6860
    6861class ParseNumeric(Func):
    6862    pass
    6863
    6864
    6865class ParseJSON(Func):
    6866    # BigQuery, Snowflake have PARSE_JSON, Presto has JSON_PARSE
    6867    # Snowflake also has TRY_PARSE_JSON, which is represented using `safe`
    6868    _sql_names = ["PARSE_JSON", "JSON_PARSE"]
    6869    arg_types = {"this": True, "expression": False, "safe": False}
    6870
    6871
    6872class ParseTime(Func):
    6873    arg_types = {"this": True, "format": True}
    6874
    6875
    6876class ParseDatetime(Func):
    6877    arg_types = {"this": True, "format": False, "zone": False}
    6878
    6879
    6880class Least(Func):
    6881    arg_types = {"this": True, "expressions": False}
    6882    is_var_len_args = True
    6883
    6884
    6885class Left(Func):
    6886    arg_types = {"this": True, "expression": True}
    6887
    6888
    6889class Right(Func):
    6890    arg_types = {"this": True, "expression": True}
    6891
    6892
    6893class Reverse(Func):
    6894    pass
    6895
    6896
    6897class Length(Func):
    6898    arg_types = {"this": True, "binary": False, "encoding": False}
    6899    _sql_names = ["LENGTH", "LEN", "CHAR_LENGTH", "CHARACTER_LENGTH"]
    6900
    6901
    6902class BitLength(Func):
    6903    pass
    6904
    6905
    6906class Levenshtein(Func):
    6907    arg_types = {
    6908        "this": True,
    6909        "expression": False,
    6910        "ins_cost": False,
    6911        "del_cost": False,
    6912        "sub_cost": False,
    6913        "max_dist": False,
    6914    }
    6915
    6916
    6917class Ln(Func):
    6918    pass
    6919
    6920
    6921class Log(Func):
    6922    arg_types = {"this": True, "expression": False}
    6923
    6924
    6925class LogicalOr(AggFunc):
    6926    _sql_names = ["LOGICAL_OR", "BOOL_OR", "BOOLOR_AGG"]
    6927
    6928
    6929class LogicalAnd(AggFunc):
    6930    _sql_names = ["LOGICAL_AND", "BOOL_AND", "BOOLAND_AGG"]
    6931
    6932
    6933class Lower(Func):
    6934    _sql_names = ["LOWER", "LCASE"]
    6935
    6936
    6937class Map(Func):
    6938    arg_types = {"keys": False, "values": False}
    6939
    6940    @property
    6941    def keys(self) -> t.List[Expression]:
    6942        keys = self.args.get("keys")
    6943        return keys.expressions if keys else []
    6944
    6945    @property
    6946    def values(self) -> t.List[Expression]:
    6947        values = self.args.get("values")
    6948        return values.expressions if values else []
    6949
    6950
    6951# Represents the MAP {...} syntax in DuckDB - basically convert a struct to a MAP
    6952class ToMap(Func):
    6953    pass
    6954
    6955
    6956class MapFromEntries(Func):
    6957    pass
    6958
    6959
    6960# https://learn.microsoft.com/en-us/sql/t-sql/language-elements/scope-resolution-operator-transact-sql?view=sql-server-ver16
    6961class ScopeResolution(Expression):
    6962    arg_types = {"this": False, "expression": True}
    6963
    6964
    6965class Stream(Expression):
    6966    pass
    6967
    6968
    6969class StarMap(Func):
    6970    pass
    6971
    6972
    6973class VarMap(Func):
    6974    arg_types = {"keys": True, "values": True}
    6975    is_var_len_args = True
    6976
    6977    @property
    6978    def keys(self) -> t.List[Expression]:
    6979        return self.args["keys"].expressions
    6980
    6981    @property
    6982    def values(self) -> t.List[Expression]:
    6983        return self.args["values"].expressions
    6984
    6985
    6986# https://dev.mysql.com/doc/refman/8.0/en/fulltext-search.html
    6987class MatchAgainst(Func):
    6988    arg_types = {"this": True, "expressions": True, "modifier": False}
    6989
    6990
    6991class Max(AggFunc):
    6992    arg_types = {"this": True, "expressions": False}
    6993    is_var_len_args = True
    6994
    6995
    6996class MD5(Func):
    6997    _sql_names = ["MD5"]
    6998
    6999
    7000# Represents the variant of the MD5 function that returns a binary value
    7001class MD5Digest(Func):
    7002    _sql_names = ["MD5_DIGEST"]
    7003
    7004
    7005# https://docs.snowflake.com/en/sql-reference/functions/md5_number_lower64
    7006class MD5NumberLower64(Func):
    7007    pass
    7008
    7009
    7010# https://docs.snowflake.com/en/sql-reference/functions/md5_number_upper64
    7011class MD5NumberUpper64(Func):
    7012    pass
    7013
    7014
    7015class Median(AggFunc):
    7016    pass
    7017
    7018
    7019class Min(AggFunc):
    7020    arg_types = {"this": True, "expressions": False}
    7021    is_var_len_args = True
    7022
    7023
    7024class Month(Func):
    7025    pass
    7026
    7027
    7028class AddMonths(Func):
    7029    arg_types = {"this": True, "expression": True}
    7030
    7031
    7032class Nvl2(Func):
    7033    arg_types = {"this": True, "true": True, "false": False}
    7034
    7035
    7036class Ntile(AggFunc):
    7037    arg_types = {"this": False}
    7038
    7039
    7040class Normalize(Func):
    7041    arg_types = {"this": True, "form": False, "is_casefold": False}
    7042
    7043
    7044class Overlay(Func):
    7045    arg_types = {"this": True, "expression": True, "from": True, "for": False}
    7046
    7047
    7048# https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-predict#mlpredict_function
    7049class Predict(Func):
    7050    arg_types = {"this": True, "expression": True, "params_struct": False}
    7051
    7052
    7053# https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-translate#mltranslate_function
    7054class MLTranslate(Func):
    7055    arg_types = {"this": True, "expression": True, "params_struct": True}
    7056
    7057
    7058# https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-feature-time
    7059class FeaturesAtTime(Func):
    7060    arg_types = {"this": True, "time": False, "num_rows": False, "ignore_feature_nulls": False}
    7061
    7062
    7063# https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-generate-embedding
    7064class GenerateEmbedding(Func):
    7065    arg_types = {"this": True, "expression": True, "params_struct": False, "is_text": False}
    7066
    7067
    7068class MLForecast(Func):
    7069    arg_types = {"this": True, "expression": False, "params_struct": False}
    7070
    7071
    7072# Represents Snowflake's <model>!<attribute> syntax. For example: SELECT model!PREDICT(INPUT_DATA => {*})
    7073# See: https://docs.snowflake.com/en/guides-overview-ml-functions
    7074class ModelAttribute(Expression):
    7075    arg_types = {"this": True, "expression": True}
    7076
    7077
    7078# https://cloud.google.com/bigquery/docs/reference/standard-sql/search_functions#vector_search
    7079class VectorSearch(Func):
    7080    arg_types = {
    7081        "this": True,
    7082        "column_to_search": True,
    7083        "query_table": True,
    7084        "query_column_to_search": False,
    7085        "top_k": False,
    7086        "distance_type": False,
    7087        "options": False,
    7088    }
    7089
    7090
    7091class Pow(Binary, Func):
    7092    _sql_names = ["POWER", "POW"]
    7093
    7094
    7095class PercentileCont(AggFunc):
    7096    arg_types = {"this": True, "expression": False}
    7097
    7098
    7099class PercentileDisc(AggFunc):
    7100    arg_types = {"this": True, "expression": False}
    7101
    7102
    7103class PercentRank(AggFunc):
    7104    arg_types = {"expressions": False}
    7105    is_var_len_args = True
    7106
    7107
    7108class Quantile(AggFunc):
    7109    arg_types = {"this": True, "quantile": True}
    7110
    7111
    7112class ApproxQuantile(Quantile):
    7113    arg_types = {
    7114        "this": True,
    7115        "quantile": True,
    7116        "accuracy": False,
    7117        "weight": False,
    7118        "error_tolerance": False,
    7119    }
    7120
    7121
    7122class Quarter(Func):
    7123    pass
    7124
    7125
    7126# https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/SQL-Functions-Expressions-and-Predicates/Arithmetic-Trigonometric-Hyperbolic-Operators/Functions/RANDOM/RANDOM-Function-Syntax
    7127# teradata lower and upper bounds
    7128class Rand(Func):
    7129    _sql_names = ["RAND", "RANDOM"]
    7130    arg_types = {"this": False, "lower": False, "upper": False}
    7131
    7132
    7133class Randn(Func):
    7134    arg_types = {"this": False}
    7135
    7136
    7137class RangeN(Func):
    7138    arg_types = {"this": True, "expressions": True, "each": False}
    7139
    7140
    7141class RangeBucket(Func):
    7142    arg_types = {"this": True, "expression": True}
    7143
    7144
    7145class Rank(AggFunc):
    7146    arg_types = {"expressions": False}
    7147    is_var_len_args = True
    7148
    7149
    7150class ReadCSV(Func):
    7151    _sql_names = ["READ_CSV"]
    7152    is_var_len_args = True
    7153    arg_types = {"this": True, "expressions": False}
    7154
    7155
    7156class Reduce(Func):
    7157    arg_types = {"this": True, "initial": True, "merge": True, "finish": False}
    7158
    7159
    7160class RegexpExtract(Func):
    7161    arg_types = {
    7162        "this": True,
    7163        "expression": True,
    7164        "position": False,
    7165        "occurrence": False,
    7166        "parameters": False,
    7167        "group": False,
    7168    }
    7169
    7170
    7171class RegexpExtractAll(Func):
    7172    arg_types = {
    7173        "this": True,
    7174        "expression": True,
    7175        "position": False,
    7176        "occurrence": False,
    7177        "parameters": False,
    7178        "group": False,
    7179    }
    7180
    7181
    7182class RegexpReplace(Func):
    7183    arg_types = {
    7184        "this": True,
    7185        "expression": True,
    7186        "replacement": False,
    7187        "position": False,
    7188        "occurrence": False,
    7189        "modifiers": False,
    7190    }
    7191
    7192
    7193class RegexpLike(Binary, Func):
    7194    arg_types = {"this": True, "expression": True, "flag": False}
    7195
    7196
    7197class RegexpILike(Binary, Func):
    7198    arg_types = {"this": True, "expression": True, "flag": False}
    7199
    7200
    7201class RegexpInstr(Func):
    7202    arg_types = {
    7203        "this": True,
    7204        "expression": True,
    7205        "position": False,
    7206        "occurrence": False,
    7207        "option": False,
    7208        "parameters": False,
    7209        "group": False,
    7210    }
    7211
    7212
    7213# https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.split.html
    7214# limit is the number of times a pattern is applied
    7215class RegexpSplit(Func):
    7216    arg_types = {"this": True, "expression": True, "limit": False}
    7217
    7218
    7219class Repeat(Func):
    7220    arg_types = {"this": True, "times": True}
    7221
    7222
    7223# Some dialects like Snowflake support two argument replace
    7224class Replace(Func):
    7225    arg_types = {"this": True, "expression": True, "replacement": False}
    7226
    7227
    7228# https://learn.microsoft.com/en-us/sql/t-sql/functions/round-transact-sql?view=sql-server-ver16
    7229# tsql third argument function == trunctaion if not 0
    7230class Round(Func):
    7231    arg_types = {"this": True, "decimals": False, "truncate": False}
    7232
    7233
    7234class RowNumber(Func):
    7235    arg_types = {"this": False}
    7236
    7237
    7238class SafeAdd(Func):
    7239    arg_types = {"this": True, "expression": True}
    7240
    7241
    7242class SafeDivide(Func):
    7243    arg_types = {"this": True, "expression": True}
    7244
    7245
    7246class SafeMultiply(Func):
    7247    arg_types = {"this": True, "expression": True}
    7248
    7249
    7250class SafeNegate(Func):
    7251    pass
    7252
    7253
    7254class SafeSubtract(Func):
    7255    arg_types = {"this": True, "expression": True}
    7256
    7257
    7258class SafeConvertBytesToString(Func):
    7259    pass
    7260
    7261
    7262class SHA(Func):
    7263    _sql_names = ["SHA", "SHA1"]
    7264
    7265
    7266class SHA2(Func):
    7267    _sql_names = ["SHA2"]
    7268    arg_types = {"this": True, "length": False}
    7269
    7270
    7271# Represents the variant of the SHA1 function that returns a binary value
    7272class SHA1Digest(Func):
    7273    pass
    7274
    7275
    7276# Represents the variant of the SHA2 function that returns a binary value
    7277class SHA2Digest(Func):
    7278    arg_types = {"this": True, "length": False}
    7279
    7280
    7281class Sign(Func):
    7282    _sql_names = ["SIGN", "SIGNUM"]
    7283
    7284
    7285class SortArray(Func):
    7286    arg_types = {"this": True, "asc": False, "nulls_first": False}
    7287
    7288
    7289class Soundex(Func):
    7290    pass
    7291
    7292
    7293class Split(Func):
    7294    arg_types = {"this": True, "expression": True, "limit": False}
    7295
    7296
    7297# https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.functions.split_part.html
    7298class SplitPart(Func):
    7299    arg_types = {"this": True, "delimiter": True, "part_index": True}
    7300
    7301
    7302# Start may be omitted in the case of postgres
    7303# https://www.postgresql.org/docs/9.1/functions-string.html @ Table 9-6
    7304class Substring(Func):
    7305    _sql_names = ["SUBSTRING", "SUBSTR"]
    7306    arg_types = {"this": True, "start": False, "length": False}
    7307
    7308
    7309class SubstringIndex(Func):
    7310    """
    7311    SUBSTRING_INDEX(str, delim, count)
    7312
    7313    *count* > 0  → left slice before the *count*-th delimiter
    7314    *count* < 0  → right slice after the |count|-th delimiter
    7315    """
    7316
    7317    arg_types = {"this": True, "delimiter": True, "count": True}
    7318
    7319
    7320class StandardHash(Func):
    7321    arg_types = {"this": True, "expression": False}
    7322
    7323
    7324class StartsWith(Func):
    7325    _sql_names = ["STARTS_WITH", "STARTSWITH"]
    7326    arg_types = {"this": True, "expression": True}
    7327
    7328
    7329class EndsWith(Func):
    7330    _sql_names = ["ENDS_WITH", "ENDSWITH"]
    7331    arg_types = {"this": True, "expression": True}
    7332
    7333
    7334class StrPosition(Func):
    7335    arg_types = {
    7336        "this": True,
    7337        "substr": True,
    7338        "position": False,
    7339        "occurrence": False,
    7340    }
    7341
    7342
    7343class StrToDate(Func):
    7344    arg_types = {"this": True, "format": False, "safe": False}
    7345
    7346
    7347class StrToTime(Func):
    7348    arg_types = {"this": True, "format": True, "zone": False, "safe": False}
    7349
    7350
    7351# Spark allows unix_timestamp()
    7352# https://spark.apache.org/docs/3.1.3/api/python/reference/api/pyspark.sql.functions.unix_timestamp.html
    7353class StrToUnix(Func):
    7354    arg_types = {"this": False, "format": False}
    7355
    7356
    7357# https://prestodb.io/docs/current/functions/string.html
    7358# https://spark.apache.org/docs/latest/api/sql/index.html#str_to_map
    7359class StrToMap(Func):
    7360    arg_types = {
    7361        "this": True,
    7362        "pair_delim": False,
    7363        "key_value_delim": False,
    7364        "duplicate_resolution_callback": False,
    7365    }
    7366
    7367
    7368class NumberToStr(Func):
    7369    arg_types = {"this": True, "format": True, "culture": False}
    7370
    7371
    7372class FromBase(Func):
    7373    arg_types = {"this": True, "expression": True}
    7374
    7375
    7376class Space(Func):
    7377    """
    7378    SPACE(n) → string consisting of n blank characters
    7379    """
    7380
    7381    pass
    7382
    7383
    7384class Struct(Func):
    7385    arg_types = {"expressions": False}
    7386    is_var_len_args = True
    7387
    7388
    7389class StructExtract(Func):
    7390    arg_types = {"this": True, "expression": True}
    7391
    7392
    7393# https://learn.microsoft.com/en-us/sql/t-sql/functions/stuff-transact-sql?view=sql-server-ver16
    7394# https://docs.snowflake.com/en/sql-reference/functions/insert
    7395class Stuff(Func):
    7396    _sql_names = ["STUFF", "INSERT"]
    7397    arg_types = {"this": True, "start": True, "length": True, "expression": True}
    7398
    7399
    7400class Sum(AggFunc):
    7401    pass
    7402
    7403
    7404class Sqrt(Func):
    7405    pass
    7406
    7407
    7408class Stddev(AggFunc):
    7409    _sql_names = ["STDDEV", "STDEV"]
    7410
    7411
    7412class StddevPop(AggFunc):
    7413    pass
    7414
    7415
    7416class StddevSamp(AggFunc):
    7417    pass
    7418
    7419
    7420# https://cloud.google.com/bigquery/docs/reference/standard-sql/time_functions#time
    7421class Time(Func):
    7422    arg_types = {"this": False, "zone": False}
    7423
    7424
    7425class TimeToStr(Func):
    7426    arg_types = {"this": True, "format": True, "culture": False, "zone": False}
    7427
    7428
    7429class TimeToTimeStr(Func):
    7430    pass
    7431
    7432
    7433class TimeToUnix(Func):
    7434    pass
    7435
    7436
    7437class TimeStrToDate(Func):
    7438    pass
    7439
    7440
    7441class TimeStrToTime(Func):
    7442    arg_types = {"this": True, "zone": False}
    7443
    7444
    7445class TimeStrToUnix(Func):
    7446    pass
    7447
    7448
    7449class Trim(Func):
    7450    arg_types = {
    7451        "this": True,
    7452        "expression": False,
    7453        "position": False,
    7454        "collation": False,
    7455    }
    7456
    7457
    7458class TsOrDsAdd(Func, TimeUnit):
    7459    # return_type is used to correctly cast the arguments of this expression when transpiling it
    7460    arg_types = {"this": True, "expression": True, "unit": False, "return_type": False}
    7461
    7462    @property
    7463    def return_type(self) -> DataType:
    7464        return DataType.build(self.args.get("return_type") or DataType.Type.DATE)
    7465
    7466
    7467class TsOrDsDiff(Func, TimeUnit):
    7468    arg_types = {"this": True, "expression": True, "unit": False}
    7469
    7470
    7471class TsOrDsToDateStr(Func):
    7472    pass
    7473
    7474
    7475class TsOrDsToDate(Func):
    7476    arg_types = {"this": True, "format": False, "safe": False}
    7477
    7478
    7479class TsOrDsToDatetime(Func):
    7480    pass
    7481
    7482
    7483class TsOrDsToTime(Func):
    7484    arg_types = {"this": True, "format": False, "safe": False}
    7485
    7486
    7487class TsOrDsToTimestamp(Func):
    7488    pass
    7489
    7490
    7491class TsOrDiToDi(Func):
    7492    pass
    7493
    7494
    7495class Unhex(Func):
    7496    arg_types = {"this": True, "expression": False}
    7497
    7498
    7499class Unicode(Func):
    7500    pass
    7501
    7502
    7503# https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#unix_date
    7504class UnixDate(Func):
    7505    pass
    7506
    7507
    7508class UnixToStr(Func):
    7509    arg_types = {"this": True, "format": False}
    7510
    7511
    7512# https://prestodb.io/docs/current/functions/datetime.html
    7513# presto has weird zone/hours/minutes
    7514class UnixToTime(Func):
    7515    arg_types = {
    7516        "this": True,
    7517        "scale": False,
    7518        "zone": False,
    7519        "hours": False,
    7520        "minutes": False,
    7521        "format": False,
    7522    }
    7523
    7524    SECONDS = Literal.number(0)
    7525    DECIS = Literal.number(1)
    7526    CENTIS = Literal.number(2)
    7527    MILLIS = Literal.number(3)
    7528    DECIMILLIS = Literal.number(4)
    7529    CENTIMILLIS = Literal.number(5)
    7530    MICROS = Literal.number(6)
    7531    DECIMICROS = Literal.number(7)
    7532    CENTIMICROS = Literal.number(8)
    7533    NANOS = Literal.number(9)
    7534
    7535
    7536class UnixToTimeStr(Func):
    7537    pass
    7538
    7539
    7540class UnixSeconds(Func):
    7541    pass
    7542
    7543
    7544class UnixMicros(Func):
    7545    pass
    7546
    7547
    7548class UnixMillis(Func):
    7549    pass
    7550
    7551
    7552class Uuid(Func):
    7553    _sql_names = ["UUID", "GEN_RANDOM_UUID", "GENERATE_UUID", "UUID_STRING"]
    7554
    7555    arg_types = {"this": False, "name": False}
    7556
    7557
    7558class TimestampFromParts(Func):
    7559    _sql_names = ["TIMESTAMP_FROM_PARTS", "TIMESTAMPFROMPARTS"]
    7560    arg_types = {
    7561        "year": True,
    7562        "month": True,
    7563        "day": True,
    7564        "hour": True,
    7565        "min": True,
    7566        "sec": True,
    7567        "nano": False,
    7568        "zone": False,
    7569        "milli": False,
    7570    }
    7571
    7572
    7573class Upper(Func):
    7574    _sql_names = ["UPPER", "UCASE"]
    7575
    7576
    7577class Corr(Binary, AggFunc):
    7578    pass
    7579
    7580
    7581# https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/CUME_DIST.html
    7582class CumeDist(AggFunc):
    7583    arg_types = {"expressions": False}
    7584    is_var_len_args = True
    7585
    7586
    7587class Variance(AggFunc):
    7588    _sql_names = ["VARIANCE", "VARIANCE_SAMP", "VAR_SAMP"]
    7589
    7590
    7591class VariancePop(AggFunc):
    7592    _sql_names = ["VARIANCE_POP", "VAR_POP"]
    7593
    7594
    7595class CovarSamp(Binary, AggFunc):
    7596    pass
    7597
    7598
    7599class CovarPop(Binary, AggFunc):
    7600    pass
    7601
    7602
    7603class Week(Func):
    7604    arg_types = {"this": True, "mode": False}
    7605
    7606
    7607class WeekStart(Expression):
    7608    pass
    7609
    7610
    7611class XMLElement(Func):
    7612    _sql_names = ["XMLELEMENT"]
    7613    arg_types = {"this": True, "expressions": False}
    7614
    7615
    7616class XMLTable(Func):
    7617    arg_types = {
    7618        "this": True,
    7619        "namespaces": False,
    7620        "passing": False,
    7621        "columns": False,
    7622        "by_ref": False,
    7623    }
    7624
    7625
    7626class XMLNamespace(Expression):
    7627    pass
    7628
    7629
    7630# https://learn.microsoft.com/en-us/sql/t-sql/queries/select-for-clause-transact-sql?view=sql-server-ver17#syntax
    7631class XMLKeyValueOption(Expression):
    7632    arg_types = {"this": True, "expression": False}
    7633
    7634
    7635class Year(Func):
    7636    pass
    7637
    7638
    7639class Use(Expression):
    7640    arg_types = {"this": False, "expressions": False, "kind": False}
    7641
    7642
    7643class Merge(DML):
    7644    arg_types = {
    7645        "this": True,
    7646        "using": True,
    7647        "on": True,
    7648        "whens": True,
    7649        "with": False,
    7650        "returning": False,
    7651    }
    7652
    7653
    7654class When(Expression):
    7655    arg_types = {"matched": True, "source": False, "condition": False, "then": True}
    7656
    7657
    7658class Whens(Expression):
    7659    """Wraps around one or more WHEN [NOT] MATCHED [...] clauses."""
    7660
    7661    arg_types = {"expressions": True}
    7662
    7663
    7664# https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqljnextvaluefor.html
    7665# https://learn.microsoft.com/en-us/sql/t-sql/functions/next-value-for-transact-sql?view=sql-server-ver16
    7666class NextValueFor(Func):
    7667    arg_types = {"this": True, "order": False}
    7668
    7669
    7670# Refers to a trailing semi-colon. This is only used to preserve trailing comments
    7671# select 1; -- my comment
    7672class Semicolon(Expression):
    7673    arg_types = {}
    7674
    7675
    7676# BigQuery allows SELECT t FROM t and treats the projection as a struct value. This expression
    7677# type is intended to be constructed by qualify so that we can properly annotate its type later
    7678class TableColumn(Expression):
    7679    pass
    7680
    7681
    7682def _norm_arg(arg):
    7683    return arg.lower() if type(arg) is str else arg
    7684
    7685
    7686ALL_FUNCTIONS = subclasses(__name__, Func, (AggFunc, Anonymous, Func))
    7687FUNCTION_BY_NAME = {name: func for func in ALL_FUNCTIONS for name in func.sql_names()}
    7688
    7689JSON_PATH_PARTS = subclasses(__name__, JSONPathPart, (JSONPathPart,))
    7690
    7691PERCENTILES = (PercentileCont, PercentileDisc)
    7692
    7693
    7694# Helpers
    7695@t.overload
    7696def maybe_parse(
    7697    sql_or_expression: ExpOrStr,
    7698    *,
    7699    into: t.Type[E],
    7700    dialect: DialectType = None,
    7701    prefix: t.Optional[str] = None,
    7702    copy: bool = False,
    7703    **opts,
    7704) -> E: ...
    7705
    7706
    7707@t.overload
    7708def maybe_parse(
    7709    sql_or_expression: str | E,
    7710    *,
    7711    into: t.Optional[IntoType] = None,
    7712    dialect: DialectType = None,
    7713    prefix: t.Optional[str] = None,
    7714    copy: bool = False,
    7715    **opts,
    7716) -> E: ...
    7717
    7718
    7719def maybe_parse(
    7720    sql_or_expression: ExpOrStr,
    7721    *,
    7722    into: t.Optional[IntoType] = None,
    7723    dialect: DialectType = None,
    7724    prefix: t.Optional[str] = None,
    7725    copy: bool = False,
    7726    **opts,
    7727) -> Expression:
    7728    """Gracefully handle a possible string or expression.
    7729
    7730    Example:
    7731        >>> maybe_parse("1")
    7732        Literal(this=1, is_string=False)
    7733        >>> maybe_parse(to_identifier("x"))
    7734        Identifier(this=x, quoted=False)
    7735
    7736    Args:
    7737        sql_or_expression: the SQL code string or an expression
    7738        into: the SQLGlot Expression to parse into
    7739        dialect: the dialect used to parse the input expressions (in the case that an
    7740            input expression is a SQL string).
    7741        prefix: a string to prefix the sql with before it gets parsed
    7742            (automatically includes a space)
    7743        copy: whether to copy the expression.
    7744        **opts: other options to use to parse the input expressions (again, in the case
    7745            that an input expression is a SQL string).
    7746
    7747    Returns:
    7748        Expression: the parsed or given expression.
    7749    """
    7750    if isinstance(sql_or_expression, Expression):
    7751        if copy:
    7752            return sql_or_expression.copy()
    7753        return sql_or_expression
    7754
    7755    if sql_or_expression is None:
    7756        raise ParseError("SQL cannot be None")
    7757
    7758    import sqlglot
    7759
    7760    sql = str(sql_or_expression)
    7761    if prefix:
    7762        sql = f"{prefix} {sql}"
    7763
    7764    return sqlglot.parse_one(sql, read=dialect, into=into, **opts)
    7765
    7766
    7767@t.overload
    7768def maybe_copy(instance: None, copy: bool = True) -> None: ...
    7769
    7770
    7771@t.overload
    7772def maybe_copy(instance: E, copy: bool = True) -> E: ...
    7773
    7774
    7775def maybe_copy(instance, copy=True):
    7776    return instance.copy() if copy and instance else instance
    7777
    7778
    7779def _to_s(node: t.Any, verbose: bool = False, level: int = 0, repr_str: bool = False) -> str:
    7780    """Generate a textual representation of an Expression tree"""
    7781    indent = "\n" + ("  " * (level + 1))
    7782    delim = f",{indent}"
    7783
    7784    if isinstance(node, Expression):
    7785        args = {k: v for k, v in node.args.items() if (v is not None and v != []) or verbose}
    7786
    7787        if (node.type or verbose) and not isinstance(node, DataType):
    7788            args["_type"] = node.type
    7789        if node.comments or verbose:
    7790            args["_comments"] = node.comments
    7791
    7792        if verbose:
    7793            args["_id"] = id(node)
    7794
    7795        # Inline leaves for a more compact representation
    7796        if node.is_leaf():
    7797            indent = ""
    7798            delim = ", "
    7799
    7800        repr_str = node.is_string or (isinstance(node, Identifier) and node.quoted)
    7801        items = delim.join(
    7802            [f"{k}={_to_s(v, verbose, level + 1, repr_str=repr_str)}" for k, v in args.items()]
    7803        )
    7804        return f"{node.__class__.__name__}({indent}{items})"
    7805
    7806    if isinstance(node, list):
    7807        items = delim.join(_to_s(i, verbose, level + 1) for i in node)
    7808        items = f"{indent}{items}" if items else ""
    7809        return f"[{items}]"
    7810
    7811    # We use the representation of the string to avoid stripping out important whitespace
    7812    if repr_str and isinstance(node, str):
    7813        node = repr(node)
    7814
    7815    # Indent multiline strings to match the current level
    7816    return indent.join(textwrap.dedent(str(node).strip("\n")).splitlines())
    7817
    7818
    7819def _is_wrong_expression(expression, into):
    7820    return isinstance(expression, Expression) and not isinstance(expression, into)
    7821
    7822
    7823def _apply_builder(
    7824    expression,
    7825    instance,
    7826    arg,
    7827    copy=True,
    7828    prefix=None,
    7829    into=None,
    7830    dialect=None,
    7831    into_arg="this",
    7832    **opts,
    7833):
    7834    if _is_wrong_expression(expression, into):
    7835        expression = into(**{into_arg: expression})
    7836    instance = maybe_copy(instance, copy)
    7837    expression = maybe_parse(
    7838        sql_or_expression=expression,
    7839        prefix=prefix,
    7840        into=into,
    7841        dialect=dialect,
    7842        **opts,
    7843    )
    7844    instance.set(arg, expression)
    7845    return instance
    7846
    7847
    7848def _apply_child_list_builder(
    7849    *expressions,
    7850    instance,
    7851    arg,
    7852    append=True,
    7853    copy=True,
    7854    prefix=None,
    7855    into=None,
    7856    dialect=None,
    7857    properties=None,
    7858    **opts,
    7859):
    7860    instance = maybe_copy(instance, copy)
    7861    parsed = []
    7862    properties = {} if properties is None else properties
    7863
    7864    for expression in expressions:
    7865        if expression is not None:
    7866            if _is_wrong_expression(expression, into):
    7867                expression = into(expressions=[expression])
    7868
    7869            expression = maybe_parse(
    7870                expression,
    7871                into=into,
    7872                dialect=dialect,
    7873                prefix=prefix,
    7874                **opts,
    7875            )
    7876            for k, v in expression.args.items():
    7877                if k == "expressions":
    7878                    parsed.extend(v)
    7879                else:
    7880                    properties[k] = v
    7881
    7882    existing = instance.args.get(arg)
    7883    if append and existing:
    7884        parsed = existing.expressions + parsed
    7885
    7886    child = into(expressions=parsed)
    7887    for k, v in properties.items():
    7888        child.set(k, v)
    7889    instance.set(arg, child)
    7890
    7891    return instance
    7892
    7893
    7894def _apply_list_builder(
    7895    *expressions,
    7896    instance,
    7897    arg,
    7898    append=True,
    7899    copy=True,
    7900    prefix=None,
    7901    into=None,
    7902    dialect=None,
    7903    **opts,
    7904):
    7905    inst = maybe_copy(instance, copy)
    7906
    7907    expressions = [
    7908        maybe_parse(
    7909            sql_or_expression=expression,
    7910            into=into,
    7911            prefix=prefix,
    7912            dialect=dialect,
    7913            **opts,
    7914        )
    7915        for expression in expressions
    7916        if expression is not None
    7917    ]
    7918
    7919    existing_expressions = inst.args.get(arg)
    7920    if append and existing_expressions:
    7921        expressions = existing_expressions + expressions
    7922
    7923    inst.set(arg, expressions)
    7924    return inst
    7925
    7926
    7927def _apply_conjunction_builder(
    7928    *expressions,
    7929    instance,
    7930    arg,
    7931    into=None,
    7932    append=True,
    7933    copy=True,
    7934    dialect=None,
    7935    **opts,
    7936):
    7937    expressions = [exp for exp in expressions if exp is not None and exp != ""]
    7938    if not expressions:
    7939        return instance
    7940
    7941    inst = maybe_copy(instance, copy)
    7942
    7943    existing = inst.args.get(arg)
    7944    if append and existing is not None:
    7945        expressions = [existing.this if into else existing] + list(expressions)
    7946
    7947    node = and_(*expressions, dialect=dialect, copy=copy, **opts)
    7948
    7949    inst.set(arg, into(this=node) if into else node)
    7950    return inst
    7951
    7952
    7953def _apply_cte_builder(
    7954    instance: E,
    7955    alias: ExpOrStr,
    7956    as_: ExpOrStr,
    7957    recursive: t.Optional[bool] = None,
    7958    materialized: t.Optional[bool] = None,
    7959    append: bool = True,
    7960    dialect: DialectType = None,
    7961    copy: bool = True,
    7962    scalar: bool = False,
    7963    **opts,
    7964) -> E:
    7965    alias_expression = maybe_parse(alias, dialect=dialect, into=TableAlias, **opts)
    7966    as_expression = maybe_parse(as_, dialect=dialect, copy=copy, **opts)
    7967    if scalar and not isinstance(as_expression, Subquery):
    7968        # scalar CTE must be wrapped in a subquery
    7969        as_expression = Subquery(this=as_expression)
    7970    cte = CTE(this=as_expression, alias=alias_expression, materialized=materialized, scalar=scalar)
    7971    return _apply_child_list_builder(
    7972        cte,
    7973        instance=instance,
    7974        arg="with",
    7975        append=append,
    7976        copy=copy,
    7977        into=With,
    7978        properties={"recursive": recursive or False},
    7979    )
    7980
    7981
    7982def _combine(
    7983    expressions: t.Sequence[t.Optional[ExpOrStr]],
    7984    operator: t.Type[Connector],
    7985    dialect: DialectType = None,
    7986    copy: bool = True,
    7987    wrap: bool = True,
    7988    **opts,
    7989) -> Expression:
    7990    conditions = [
    7991        condition(expression, dialect=dialect, copy=copy, **opts)
    7992        for expression in expressions
    7993        if expression is not None
    7994    ]
    7995
    7996    this, *rest = conditions
    7997    if rest and wrap:
    7998        this = _wrap(this, Connector)
    7999    for expression in rest:
    8000        this = operator(this=this, expression=_wrap(expression, Connector) if wrap else expression)
    8001
    8002    return this
    8003
    8004
    8005@t.overload
    8006def _wrap(expression: None, kind: t.Type[Expression]) -> None: ...
    8007
    8008
    8009@t.overload
    8010def _wrap(expression: E, kind: t.Type[Expression]) -> E | Paren: ...
    8011
    8012
    8013def _wrap(expression: t.Optional[E], kind: t.Type[Expression]) -> t.Optional[E] | Paren:
    8014    return Paren(this=expression) if isinstance(expression, kind) else expression
    8015
    8016
    8017def _apply_set_operation(
    8018    *expressions: ExpOrStr,
    8019    set_operation: t.Type[S],
    8020    distinct: bool = True,
    8021    dialect: DialectType = None,
    8022    copy: bool = True,
    8023    **opts,
    8024) -> S:
    8025    return reduce(
    8026        lambda x, y: set_operation(this=x, expression=y, distinct=distinct, **opts),
    8027        (maybe_parse(e, dialect=dialect, copy=copy, **opts) for e in expressions),
    8028    )
    8029
    8030
    8031def union(
    8032    *expressions: ExpOrStr,
    8033    distinct: bool = True,
    8034    dialect: DialectType = None,
    8035    copy: bool = True,
    8036    **opts,
    8037) -> Union:
    8038    """
    8039    Initializes a syntax tree for the `UNION` operation.
    8040
    8041    Example:
    8042        >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()
    8043        'SELECT * FROM foo UNION SELECT * FROM bla'
    8044
    8045    Args:
    8046        expressions: the SQL code strings, corresponding to the `UNION`'s operands.
    8047            If `Expression` instances are passed, they will be used as-is.
    8048        distinct: set the DISTINCT flag if and only if this is true.
    8049        dialect: the dialect used to parse the input expression.
    8050        copy: whether to copy the expression.
    8051        opts: other options to use to parse the input expressions.
    8052
    8053    Returns:
    8054        The new Union instance.
    8055    """
    8056    assert len(expressions) >= 2, "At least two expressions are required by `union`."
    8057    return _apply_set_operation(
    8058        *expressions, set_operation=Union, distinct=distinct, dialect=dialect, copy=copy, **opts
    8059    )
    8060
    8061
    8062def intersect(
    8063    *expressions: ExpOrStr,
    8064    distinct: bool = True,
    8065    dialect: DialectType = None,
    8066    copy: bool = True,
    8067    **opts,
    8068) -> Intersect:
    8069    """
    8070    Initializes a syntax tree for the `INTERSECT` operation.
    8071
    8072    Example:
    8073        >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()
    8074        'SELECT * FROM foo INTERSECT SELECT * FROM bla'
    8075
    8076    Args:
    8077        expressions: the SQL code strings, corresponding to the `INTERSECT`'s operands.
    8078            If `Expression` instances are passed, they will be used as-is.
    8079        distinct: set the DISTINCT flag if and only if this is true.
    8080        dialect: the dialect used to parse the input expression.
    8081        copy: whether to copy the expression.
    8082        opts: other options to use to parse the input expressions.
    8083
    8084    Returns:
    8085        The new Intersect instance.
    8086    """
    8087    assert len(expressions) >= 2, "At least two expressions are required by `intersect`."
    8088    return _apply_set_operation(
    8089        *expressions, set_operation=Intersect, distinct=distinct, dialect=dialect, copy=copy, **opts
    8090    )
    8091
    8092
    8093def except_(
    8094    *expressions: ExpOrStr,
    8095    distinct: bool = True,
    8096    dialect: DialectType = None,
    8097    copy: bool = True,
    8098    **opts,
    8099) -> Except:
    8100    """
    8101    Initializes a syntax tree for the `EXCEPT` operation.
    8102
    8103    Example:
    8104        >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()
    8105        'SELECT * FROM foo EXCEPT SELECT * FROM bla'
    8106
    8107    Args:
    8108        expressions: the SQL code strings, corresponding to the `EXCEPT`'s operands.
    8109            If `Expression` instances are passed, they will be used as-is.
    8110        distinct: set the DISTINCT flag if and only if this is true.
    8111        dialect: the dialect used to parse the input expression.
    8112        copy: whether to copy the expression.
    8113        opts: other options to use to parse the input expressions.
    8114
    8115    Returns:
    8116        The new Except instance.
    8117    """
    8118    assert len(expressions) >= 2, "At least two expressions are required by `except_`."
    8119    return _apply_set_operation(
    8120        *expressions, set_operation=Except, distinct=distinct, dialect=dialect, copy=copy, **opts
    8121    )
    8122
    8123
    8124def select(*expressions: ExpOrStr, dialect: DialectType = None, **opts) -> Select:
    8125    """
    8126    Initializes a syntax tree from one or multiple SELECT expressions.
    8127
    8128    Example:
    8129        >>> select("col1", "col2").from_("tbl").sql()
    8130        'SELECT col1, col2 FROM tbl'
    8131
    8132    Args:
    8133        *expressions: the SQL code string to parse as the expressions of a
    8134            SELECT statement. If an Expression instance is passed, this is used as-is.
    8135        dialect: the dialect used to parse the input expressions (in the case that an
    8136            input expression is a SQL string).
    8137        **opts: other options to use to parse the input expressions (again, in the case
    8138            that an input expression is a SQL string).
    8139
    8140    Returns:
    8141        Select: the syntax tree for the SELECT statement.
    8142    """
    8143    return Select().select(*expressions, dialect=dialect, **opts)
    8144
    8145
    8146def from_(expression: ExpOrStr, dialect: DialectType = None, **opts) -> Select:
    8147    """
    8148    Initializes a syntax tree from a FROM expression.
    8149
    8150    Example:
    8151        >>> from_("tbl").select("col1", "col2").sql()
    8152        'SELECT col1, col2 FROM tbl'
    8153
    8154    Args:
    8155        *expression: the SQL code string to parse as the FROM expressions of a
    8156            SELECT statement. If an Expression instance is passed, this is used as-is.
    8157        dialect: the dialect used to parse the input expression (in the case that the
    8158            input expression is a SQL string).
    8159        **opts: other options to use to parse the input expressions (again, in the case
    8160            that the input expression is a SQL string).
    8161
    8162    Returns:
    8163        Select: the syntax tree for the SELECT statement.
    8164    """
    8165    return Select().from_(expression, dialect=dialect, **opts)
    8166
    8167
    8168def update(
    8169    table: str | Table,
    8170    properties: t.Optional[dict] = None,
    8171    where: t.Optional[ExpOrStr] = None,
    8172    from_: t.Optional[ExpOrStr] = None,
    8173    with_: t.Optional[t.Dict[str, ExpOrStr]] = None,
    8174    dialect: DialectType = None,
    8175    **opts,
    8176) -> Update:
    8177    """
    8178    Creates an update statement.
    8179
    8180    Example:
    8181        >>> update("my_table", {"x": 1, "y": "2", "z": None}, from_="baz_cte", where="baz_cte.id > 1 and my_table.id = baz_cte.id", with_={"baz_cte": "SELECT id FROM foo"}).sql()
    8182        "WITH baz_cte AS (SELECT id FROM foo) UPDATE my_table SET x = 1, y = '2', z = NULL FROM baz_cte WHERE baz_cte.id > 1 AND my_table.id = baz_cte.id"
    8183
    8184    Args:
    8185        properties: dictionary of properties to SET which are
    8186            auto converted to sql objects eg None -> NULL
    8187        where: sql conditional parsed into a WHERE statement
    8188        from_: sql statement parsed into a FROM statement
    8189        with_: dictionary of CTE aliases / select statements to include in a WITH clause.
    8190        dialect: the dialect used to parse the input expressions.
    8191        **opts: other options to use to parse the input expressions.
    8192
    8193    Returns:
    8194        Update: the syntax tree for the UPDATE statement.
    8195    """
    8196    update_expr = Update(this=maybe_parse(table, into=Table, dialect=dialect))
    8197    if properties:
    8198        update_expr.set(
    8199            "expressions",
    8200            [
    8201                EQ(this=maybe_parse(k, dialect=dialect, **opts), expression=convert(v))
    8202                for k, v in properties.items()
    8203            ],
    8204        )
    8205    if from_:
    8206        update_expr.set(
    8207            "from",
    8208            maybe_parse(from_, into=From, dialect=dialect, prefix="FROM", **opts),
    8209        )
    8210    if isinstance(where, Condition):
    8211        where = Where(this=where)
    8212    if where:
    8213        update_expr.set(
    8214            "where",
    8215            maybe_parse(where, into=Where, dialect=dialect, prefix="WHERE", **opts),
    8216        )
    8217    if with_:
    8218        cte_list = [
    8219            alias_(CTE(this=maybe_parse(qry, dialect=dialect, **opts)), alias, table=True)
    8220            for alias, qry in with_.items()
    8221        ]
    8222        update_expr.set(
    8223            "with",
    8224            With(expressions=cte_list),
    8225        )
    8226    return update_expr
    8227
    8228
    8229def delete(
    8230    table: ExpOrStr,
    8231    where: t.Optional[ExpOrStr] = None,
    8232    returning: t.Optional[ExpOrStr] = None,
    8233    dialect: DialectType = None,
    8234    **opts,
    8235) -> Delete:
    8236    """
    8237    Builds a delete statement.
    8238
    8239    Example:
    8240        >>> delete("my_table", where="id > 1").sql()
    8241        'DELETE FROM my_table WHERE id > 1'
    8242
    8243    Args:
    8244        where: sql conditional parsed into a WHERE statement
    8245        returning: sql conditional parsed into a RETURNING statement
    8246        dialect: the dialect used to parse the input expressions.
    8247        **opts: other options to use to parse the input expressions.
    8248
    8249    Returns:
    8250        Delete: the syntax tree for the DELETE statement.
    8251    """
    8252    delete_expr = Delete().delete(table, dialect=dialect, copy=False, **opts)
    8253    if where:
    8254        delete_expr = delete_expr.where(where, dialect=dialect, copy=False, **opts)
    8255    if returning:
    8256        delete_expr = delete_expr.returning(returning, dialect=dialect, copy=False, **opts)
    8257    return delete_expr
    8258
    8259
    8260def insert(
    8261    expression: ExpOrStr,
    8262    into: ExpOrStr,
    8263    columns: t.Optional[t.Sequence[str | Identifier]] = None,
    8264    overwrite: t.Optional[bool] = None,
    8265    returning: t.Optional[ExpOrStr] = None,
    8266    dialect: DialectType = None,
    8267    copy: bool = True,
    8268    **opts,
    8269) -> Insert:
    8270    """
    8271    Builds an INSERT statement.
    8272
    8273    Example:
    8274        >>> insert("VALUES (1, 2, 3)", "tbl").sql()
    8275        'INSERT INTO tbl VALUES (1, 2, 3)'
    8276
    8277    Args:
    8278        expression: the sql string or expression of the INSERT statement
    8279        into: the tbl to insert data to.
    8280        columns: optionally the table's column names.
    8281        overwrite: whether to INSERT OVERWRITE or not.
    8282        returning: sql conditional parsed into a RETURNING statement
    8283        dialect: the dialect used to parse the input expressions.
    8284        copy: whether to copy the expression.
    8285        **opts: other options to use to parse the input expressions.
    8286
    8287    Returns:
    8288        Insert: the syntax tree for the INSERT statement.
    8289    """
    8290    expr = maybe_parse(expression, dialect=dialect, copy=copy, **opts)
    8291    this: Table | Schema = maybe_parse(into, into=Table, dialect=dialect, copy=copy, **opts)
    8292
    8293    if columns:
    8294        this = Schema(this=this, expressions=[to_identifier(c, copy=copy) for c in columns])
    8295
    8296    insert = Insert(this=this, expression=expr, overwrite=overwrite)
    8297
    8298    if returning:
    8299        insert = insert.returning(returning, dialect=dialect, copy=False, **opts)
    8300
    8301    return insert
    8302
    8303
    8304def merge(
    8305    *when_exprs: ExpOrStr,
    8306    into: ExpOrStr,
    8307    using: ExpOrStr,
    8308    on: ExpOrStr,
    8309    returning: t.Optional[ExpOrStr] = None,
    8310    dialect: DialectType = None,
    8311    copy: bool = True,
    8312    **opts,
    8313) -> Merge:
    8314    """
    8315    Builds a MERGE statement.
    8316
    8317    Example:
    8318        >>> merge("WHEN MATCHED THEN UPDATE SET col1 = source_table.col1",
    8319        ...       "WHEN NOT MATCHED THEN INSERT (col1) VALUES (source_table.col1)",
    8320        ...       into="my_table",
    8321        ...       using="source_table",
    8322        ...       on="my_table.id = source_table.id").sql()
    8323        'MERGE INTO my_table USING source_table ON my_table.id = source_table.id WHEN MATCHED THEN UPDATE SET col1 = source_table.col1 WHEN NOT MATCHED THEN INSERT (col1) VALUES (source_table.col1)'
    8324
    8325    Args:
    8326        *when_exprs: The WHEN clauses specifying actions for matched and unmatched rows.
    8327        into: The target table to merge data into.
    8328        using: The source table to merge data from.
    8329        on: The join condition for the merge.
    8330        returning: The columns to return from the merge.
    8331        dialect: The dialect used to parse the input expressions.
    8332        copy: Whether to copy the expression.
    8333        **opts: Other options to use to parse the input expressions.
    8334
    8335    Returns:
    8336        Merge: The syntax tree for the MERGE statement.
    8337    """
    8338    expressions: t.List[Expression] = []
    8339    for when_expr in when_exprs:
    8340        expression = maybe_parse(when_expr, dialect=dialect, copy=copy, into=Whens, **opts)
    8341        expressions.extend([expression] if isinstance(expression, When) else expression.expressions)
    8342
    8343    merge = Merge(
    8344        this=maybe_parse(into, dialect=dialect, copy=copy, **opts),
    8345        using=maybe_parse(using, dialect=dialect, copy=copy, **opts),
    8346        on=maybe_parse(on, dialect=dialect, copy=copy, **opts),
    8347        whens=Whens(expressions=expressions),
    8348    )
    8349    if returning:
    8350        merge = merge.returning(returning, dialect=dialect, copy=False, **opts)
    8351
    8352    if isinstance(using_clause := merge.args.get("using"), Alias):
    8353        using_clause.replace(alias_(using_clause.this, using_clause.args["alias"], table=True))
    8354
    8355    return merge
    8356
    8357
    8358def condition(
    8359    expression: ExpOrStr, dialect: DialectType = None, copy: bool = True, **opts
    8360) -> Condition:
    8361    """
    8362    Initialize a logical condition expression.
    8363
    8364    Example:
    8365        >>> condition("x=1").sql()
    8366        'x = 1'
    8367
    8368        This is helpful for composing larger logical syntax trees:
    8369        >>> where = condition("x=1")
    8370        >>> where = where.and_("y=1")
    8371        >>> Select().from_("tbl").select("*").where(where).sql()
    8372        'SELECT * FROM tbl WHERE x = 1 AND y = 1'
    8373
    8374    Args:
    8375        *expression: the SQL code string to parse.
    8376            If an Expression instance is passed, this is used as-is.
    8377        dialect: the dialect used to parse the input expression (in the case that the
    8378            input expression is a SQL string).
    8379        copy: Whether to copy `expression` (only applies to expressions).
    8380        **opts: other options to use to parse the input expressions (again, in the case
    8381            that the input expression is a SQL string).
    8382
    8383    Returns:
    8384        The new Condition instance
    8385    """
    8386    return maybe_parse(
    8387        expression,
    8388        into=Condition,
    8389        dialect=dialect,
    8390        copy=copy,
    8391        **opts,
    8392    )
    8393
    8394
    8395def and_(
    8396    *expressions: t.Optional[ExpOrStr],
    8397    dialect: DialectType = None,
    8398    copy: bool = True,
    8399    wrap: bool = True,
    8400    **opts,
    8401) -> Condition:
    8402    """
    8403    Combine multiple conditions with an AND logical operator.
    8404
    8405    Example:
    8406        >>> and_("x=1", and_("y=1", "z=1")).sql()
    8407        'x = 1 AND (y = 1 AND z = 1)'
    8408
    8409    Args:
    8410        *expressions: the SQL code strings to parse.
    8411            If an Expression instance is passed, this is used as-is.
    8412        dialect: the dialect used to parse the input expression.
    8413        copy: whether to copy `expressions` (only applies to Expressions).
    8414        wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
    8415            precedence issues, but can be turned off when the produced AST is too deep and
    8416            causes recursion-related issues.
    8417        **opts: other options to use to parse the input expressions.
    8418
    8419    Returns:
    8420        The new condition
    8421    """
    8422    return t.cast(Condition, _combine(expressions, And, dialect, copy=copy, wrap=wrap, **opts))
    8423
    8424
    8425def or_(
    8426    *expressions: t.Optional[ExpOrStr],
    8427    dialect: DialectType = None,
    8428    copy: bool = True,
    8429    wrap: bool = True,
    8430    **opts,
    8431) -> Condition:
    8432    """
    8433    Combine multiple conditions with an OR logical operator.
    8434
    8435    Example:
    8436        >>> or_("x=1", or_("y=1", "z=1")).sql()
    8437        'x = 1 OR (y = 1 OR z = 1)'
    8438
    8439    Args:
    8440        *expressions: the SQL code strings to parse.
    8441            If an Expression instance is passed, this is used as-is.
    8442        dialect: the dialect used to parse the input expression.
    8443        copy: whether to copy `expressions` (only applies to Expressions).
    8444        wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
    8445            precedence issues, but can be turned off when the produced AST is too deep and
    8446            causes recursion-related issues.
    8447        **opts: other options to use to parse the input expressions.
    8448
    8449    Returns:
    8450        The new condition
    8451    """
    8452    return t.cast(Condition, _combine(expressions, Or, dialect, copy=copy, wrap=wrap, **opts))
    8453
    8454
    8455def xor(
    8456    *expressions: t.Optional[ExpOrStr],
    8457    dialect: DialectType = None,
    8458    copy: bool = True,
    8459    wrap: bool = True,
    8460    **opts,
    8461) -> Condition:
    8462    """
    8463    Combine multiple conditions with an XOR logical operator.
    8464
    8465    Example:
    8466        >>> xor("x=1", xor("y=1", "z=1")).sql()
    8467        'x = 1 XOR (y = 1 XOR z = 1)'
    8468
    8469    Args:
    8470        *expressions: the SQL code strings to parse.
    8471            If an Expression instance is passed, this is used as-is.
    8472        dialect: the dialect used to parse the input expression.
    8473        copy: whether to copy `expressions` (only applies to Expressions).
    8474        wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
    8475            precedence issues, but can be turned off when the produced AST is too deep and
    8476            causes recursion-related issues.
    8477        **opts: other options to use to parse the input expressions.
    8478
    8479    Returns:
    8480        The new condition
    8481    """
    8482    return t.cast(Condition, _combine(expressions, Xor, dialect, copy=copy, wrap=wrap, **opts))
    8483
    8484
    8485def not_(expression: ExpOrStr, dialect: DialectType = None, copy: bool = True, **opts) -> Not:
    8486    """
    8487    Wrap a condition with a NOT operator.
    8488
    8489    Example:
    8490        >>> not_("this_suit='black'").sql()
    8491        "NOT this_suit = 'black'"
    8492
    8493    Args:
    8494        expression: the SQL code string to parse.
    8495            If an Expression instance is passed, this is used as-is.
    8496        dialect: the dialect used to parse the input expression.
    8497        copy: whether to copy the expression or not.
    8498        **opts: other options to use to parse the input expressions.
    8499
    8500    Returns:
    8501        The new condition.
    8502    """
    8503    this = condition(
    8504        expression,
    8505        dialect=dialect,
    8506        copy=copy,
    8507        **opts,
    8508    )
    8509    return Not(this=_wrap(this, Connector))
    8510
    8511
    8512def paren(expression: ExpOrStr, copy: bool = True) -> Paren:
    8513    """
    8514    Wrap an expression in parentheses.
    8515
    8516    Example:
    8517        >>> paren("5 + 3").sql()
    8518        '(5 + 3)'
    8519
    8520    Args:
    8521        expression: the SQL code string to parse.
    8522            If an Expression instance is passed, this is used as-is.
    8523        copy: whether to copy the expression or not.
    8524
    8525    Returns:
    8526        The wrapped expression.
    8527    """
    8528    return Paren(this=maybe_parse(expression, copy=copy))
    8529
    8530
    8531SAFE_IDENTIFIER_RE: t.Pattern[str] = re.compile(r"^[_a-zA-Z][\w]*$")
    8532
    8533
    8534@t.overload
    8535def to_identifier(name: None, quoted: t.Optional[bool] = None, copy: bool = True) -> None: ...
    8536
    8537
    8538@t.overload
    8539def to_identifier(
    8540    name: str | Identifier, quoted: t.Optional[bool] = None, copy: bool = True
    8541) -> Identifier: ...
    8542
    8543
    8544def to_identifier(name, quoted=None, copy=True):
    8545    """Builds an identifier.
    8546
    8547    Args:
    8548        name: The name to turn into an identifier.
    8549        quoted: Whether to force quote the identifier.
    8550        copy: Whether to copy name if it's an Identifier.
    8551
    8552    Returns:
    8553        The identifier ast node.
    8554    """
    8555
    8556    if name is None:
    8557        return None
    8558
    8559    if isinstance(name, Identifier):
    8560        identifier = maybe_copy(name, copy)
    8561    elif isinstance(name, str):
    8562        identifier = Identifier(
    8563            this=name,
    8564            quoted=not SAFE_IDENTIFIER_RE.match(name) if quoted is None else quoted,
    8565        )
    8566    else:
    8567        raise ValueError(f"Name needs to be a string or an Identifier, got: {name.__class__}")
    8568    return identifier
    8569
    8570
    8571def parse_identifier(name: str | Identifier, dialect: DialectType = None) -> Identifier:
    8572    """
    8573    Parses a given string into an identifier.
    8574
    8575    Args:
    8576        name: The name to parse into an identifier.
    8577        dialect: The dialect to parse against.
    8578
    8579    Returns:
    8580        The identifier ast node.
    8581    """
    8582    try:
    8583        expression = maybe_parse(name, dialect=dialect, into=Identifier)
    8584    except (ParseError, TokenError):
    8585        expression = to_identifier(name)
    8586
    8587    return expression
    8588
    8589
    8590INTERVAL_STRING_RE = re.compile(r"\s*(-?[0-9]+(?:\.[0-9]+)?)\s*([a-zA-Z]+)\s*")
    8591
    8592# Matches day-time interval strings that contain
    8593# - A number of days (possibly negative or with decimals)
    8594# - At least one space
    8595# - Portions of a time-like signature, potentially negative
    8596#   - Standard format                   [-]h+:m+:s+[.f+]
    8597#   - Just minutes/seconds/frac seconds [-]m+:s+.f+
    8598#   - Just hours, minutes, maybe colon  [-]h+:m+[:]
    8599#   - Just hours, maybe colon           [-]h+[:]
    8600#   - Just colon                        :
    8601INTERVAL_DAY_TIME_RE = re.compile(
    8602    r"\s*-?\s*\d+(?:\.\d+)?\s+(?:-?(?:\d+:)?\d+:\d+(?:\.\d+)?|-?(?:\d+:){1,2}|:)\s*"
    8603)
    8604
    8605
    8606def to_interval(interval: str | Literal) -> Interval:
    8607    """Builds an interval expression from a string like '1 day' or '5 months'."""
    8608    if isinstance(interval, Literal):
    8609        if not interval.is_string:
    8610            raise ValueError("Invalid interval string.")
    8611
    8612        interval = interval.this
    8613
    8614    interval = maybe_parse(f"INTERVAL {interval}")
    8615    assert isinstance(interval, Interval)
    8616    return interval
    8617
    8618
    8619def to_table(
    8620    sql_path: str | Table, dialect: DialectType = None, copy: bool = True, **kwargs
    8621) -> Table:
    8622    """
    8623    Create a table expression from a `[catalog].[schema].[table]` sql path. Catalog and schema are optional.
    8624    If a table is passed in then that table is returned.
    8625
    8626    Args:
    8627        sql_path: a `[catalog].[schema].[table]` string.
    8628        dialect: the source dialect according to which the table name will be parsed.
    8629        copy: Whether to copy a table if it is passed in.
    8630        kwargs: the kwargs to instantiate the resulting `Table` expression with.
    8631
    8632    Returns:
    8633        A table expression.
    8634    """
    8635    if isinstance(sql_path, Table):
    8636        return maybe_copy(sql_path, copy=copy)
    8637
    8638    try:
    8639        table = maybe_parse(sql_path, into=Table, dialect=dialect)
    8640    except ParseError:
    8641        catalog, db, this = split_num_words(sql_path, ".", 3)
    8642
    8643        if not this:
    8644            raise
    8645
    8646        table = table_(this, db=db, catalog=catalog)
    8647
    8648    for k, v in kwargs.items():
    8649        table.set(k, v)
    8650
    8651    return table
    8652
    8653
    8654def to_column(
    8655    sql_path: str | Column,
    8656    quoted: t.Optional[bool] = None,
    8657    dialect: DialectType = None,
    8658    copy: bool = True,
    8659    **kwargs,
    8660) -> Column:
    8661    """
    8662    Create a column from a `[table].[column]` sql path. Table is optional.
    8663    If a column is passed in then that column is returned.
    8664
    8665    Args:
    8666        sql_path: a `[table].[column]` string.
    8667        quoted: Whether or not to force quote identifiers.
    8668        dialect: the source dialect according to which the column name will be parsed.
    8669        copy: Whether to copy a column if it is passed in.
    8670        kwargs: the kwargs to instantiate the resulting `Column` expression with.
    8671
    8672    Returns:
    8673        A column expression.
    8674    """
    8675    if isinstance(sql_path, Column):
    8676        return maybe_copy(sql_path, copy=copy)
    8677
    8678    try:
    8679        col = maybe_parse(sql_path, into=Column, dialect=dialect)
    8680    except ParseError:
    8681        return column(*reversed(sql_path.split(".")), quoted=quoted, **kwargs)
    8682
    8683    for k, v in kwargs.items():
    8684        col.set(k, v)
    8685
    8686    if quoted:
    8687        for i in col.find_all(Identifier):
    8688            i.set("quoted", True)
    8689
    8690    return col
    8691
    8692
    8693def alias_(
    8694    expression: ExpOrStr,
    8695    alias: t.Optional[str | Identifier],
    8696    table: bool | t.Sequence[str | Identifier] = False,
    8697    quoted: t.Optional[bool] = None,
    8698    dialect: DialectType = None,
    8699    copy: bool = True,
    8700    **opts,
    8701):
    8702    """Create an Alias expression.
    8703
    8704    Example:
    8705        >>> alias_('foo', 'bar').sql()
    8706        'foo AS bar'
    8707
    8708        >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()
    8709        '(SELECT 1, 2) AS bar(a, b)'
    8710
    8711    Args:
    8712        expression: the SQL code strings to parse.
    8713            If an Expression instance is passed, this is used as-is.
    8714        alias: the alias name to use. If the name has
    8715            special characters it is quoted.
    8716        table: Whether to create a table alias, can also be a list of columns.
    8717        quoted: whether to quote the alias
    8718        dialect: the dialect used to parse the input expression.
    8719        copy: Whether to copy the expression.
    8720        **opts: other options to use to parse the input expressions.
    8721
    8722    Returns:
    8723        Alias: the aliased expression
    8724    """
    8725    exp = maybe_parse(expression, dialect=dialect, copy=copy, **opts)
    8726    alias = to_identifier(alias, quoted=quoted)
    8727
    8728    if table:
    8729        table_alias = TableAlias(this=alias)
    8730        exp.set("alias", table_alias)
    8731
    8732        if not isinstance(table, bool):
    8733            for column in table:
    8734                table_alias.append("columns", to_identifier(column, quoted=quoted))
    8735
    8736        return exp
    8737
    8738    # We don't set the "alias" arg for Window expressions, because that would add an IDENTIFIER node in
    8739    # the AST, representing a "named_window" [1] construct (eg. bigquery). What we want is an ALIAS node
    8740    # for the complete Window expression.
    8741    #
    8742    # [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls
    8743
    8744    if "alias" in exp.arg_types and not isinstance(exp, Window):
    8745        exp.set("alias", alias)
    8746        return exp
    8747    return Alias(this=exp, alias=alias)
    8748
    8749
    8750def subquery(
    8751    expression: ExpOrStr,
    8752    alias: t.Optional[Identifier | str] = None,
    8753    dialect: DialectType = None,
    8754    **opts,
    8755) -> Select:
    8756    """
    8757    Build a subquery expression that's selected from.
    8758
    8759    Example:
    8760        >>> subquery('select x from tbl', 'bar').select('x').sql()
    8761        'SELECT x FROM (SELECT x FROM tbl) AS bar'
    8762
    8763    Args:
    8764        expression: the SQL code strings to parse.
    8765            If an Expression instance is passed, this is used as-is.
    8766        alias: the alias name to use.
    8767        dialect: the dialect used to parse the input expression.
    8768        **opts: other options to use to parse the input expressions.
    8769
    8770    Returns:
    8771        A new Select instance with the subquery expression included.
    8772    """
    8773
    8774    expression = maybe_parse(expression, dialect=dialect, **opts).subquery(alias, **opts)
    8775    return Select().from_(expression, dialect=dialect, **opts)
    8776
    8777
    8778@t.overload
    8779def column(
    8780    col: str | Identifier,
    8781    table: t.Optional[str | Identifier] = None,
    8782    db: t.Optional[str | Identifier] = None,
    8783    catalog: t.Optional[str | Identifier] = None,
    8784    *,
    8785    fields: t.Collection[t.Union[str, Identifier]],
    8786    quoted: t.Optional[bool] = None,
    8787    copy: bool = True,
    8788) -> Dot:
    8789    pass
    8790
    8791
    8792@t.overload
    8793def column(
    8794    col: str | Identifier | Star,
    8795    table: t.Optional[str | Identifier] = None,
    8796    db: t.Optional[str | Identifier] = None,
    8797    catalog: t.Optional[str | Identifier] = None,
    8798    *,
    8799    fields: Lit[None] = None,
    8800    quoted: t.Optional[bool] = None,
    8801    copy: bool = True,
    8802) -> Column:
    8803    pass
    8804
    8805
    8806def column(
    8807    col,
    8808    table=None,
    8809    db=None,
    8810    catalog=None,
    8811    *,
    8812    fields=None,
    8813    quoted=None,
    8814    copy=True,
    8815):
    8816    """
    8817    Build a Column.
    8818
    8819    Args:
    8820        col: Column name.
    8821        table: Table name.
    8822        db: Database name.
    8823        catalog: Catalog name.
    8824        fields: Additional fields using dots.
    8825        quoted: Whether to force quotes on the column's identifiers.
    8826        copy: Whether to copy identifiers if passed in.
    8827
    8828    Returns:
    8829        The new Column instance.
    8830    """
    8831    if not isinstance(col, Star):
    8832        col = to_identifier(col, quoted=quoted, copy=copy)
    8833
    8834    this = Column(
    8835        this=col,
    8836        table=to_identifier(table, quoted=quoted, copy=copy),
    8837        db=to_identifier(db, quoted=quoted, copy=copy),
    8838        catalog=to_identifier(catalog, quoted=quoted, copy=copy),
    8839    )
    8840
    8841    if fields:
    8842        this = Dot.build(
    8843            (this, *(to_identifier(field, quoted=quoted, copy=copy) for field in fields))
    8844        )
    8845    return this
    8846
    8847
    8848def cast(
    8849    expression: ExpOrStr, to: DATA_TYPE, copy: bool = True, dialect: DialectType = None, **opts
    8850) -> Cast:
    8851    """Cast an expression to a data type.
    8852
    8853    Example:
    8854        >>> cast('x + 1', 'int').sql()
    8855        'CAST(x + 1 AS INT)'
    8856
    8857    Args:
    8858        expression: The expression to cast.
    8859        to: The datatype to cast to.
    8860        copy: Whether to copy the supplied expressions.
    8861        dialect: The target dialect. This is used to prevent a re-cast in the following scenario:
    8862            - The expression to be cast is already a exp.Cast expression
    8863            - The existing cast is to a type that is logically equivalent to new type
    8864
    8865            For example, if :expression='CAST(x as DATETIME)' and :to=Type.TIMESTAMP,
    8866            but in the target dialect DATETIME is mapped to TIMESTAMP, then we will NOT return `CAST(x (as DATETIME) as TIMESTAMP)`
    8867            and instead just return the original expression `CAST(x as DATETIME)`.
    8868
    8869            This is to prevent it being output as a double cast `CAST(x (as TIMESTAMP) as TIMESTAMP)` once the DATETIME -> TIMESTAMP
    8870            mapping is applied in the target dialect generator.
    8871
    8872    Returns:
    8873        The new Cast instance.
    8874    """
    8875    expr = maybe_parse(expression, copy=copy, dialect=dialect, **opts)
    8876    data_type = DataType.build(to, copy=copy, dialect=dialect, **opts)
    8877
    8878    # dont re-cast if the expression is already a cast to the correct type
    8879    if isinstance(expr, Cast):
    8880        from sqlglot.dialects.dialect import Dialect
    8881
    8882        target_dialect = Dialect.get_or_raise(dialect)
    8883        type_mapping = target_dialect.generator_class.TYPE_MAPPING
    8884
    8885        existing_cast_type: DataType.Type = expr.to.this
    8886        new_cast_type: DataType.Type = data_type.this
    8887        types_are_equivalent = type_mapping.get(
    8888            existing_cast_type, existing_cast_type.value
    8889        ) == type_mapping.get(new_cast_type, new_cast_type.value)
    8890
    8891        if expr.is_type(data_type) or types_are_equivalent:
    8892            return expr
    8893
    8894    expr = Cast(this=expr, to=data_type)
    8895    expr.type = data_type
    8896
    8897    return expr
    8898
    8899
    8900def table_(
    8901    table: Identifier | str,
    8902    db: t.Optional[Identifier | str] = None,
    8903    catalog: t.Optional[Identifier | str] = None,
    8904    quoted: t.Optional[bool] = None,
    8905    alias: t.Optional[Identifier | str] = None,
    8906) -> Table:
    8907    """Build a Table.
    8908
    8909    Args:
    8910        table: Table name.
    8911        db: Database name.
    8912        catalog: Catalog name.
    8913        quote: Whether to force quotes on the table's identifiers.
    8914        alias: Table's alias.
    8915
    8916    Returns:
    8917        The new Table instance.
    8918    """
    8919    return Table(
    8920        this=to_identifier(table, quoted=quoted) if table else None,
    8921        db=to_identifier(db, quoted=quoted) if db else None,
    8922        catalog=to_identifier(catalog, quoted=quoted) if catalog else None,
    8923        alias=TableAlias(this=to_identifier(alias)) if alias else None,
    8924    )
    8925
    8926
    8927def values(
    8928    values: t.Iterable[t.Tuple[t.Any, ...]],
    8929    alias: t.Optional[str] = None,
    8930    columns: t.Optional[t.Iterable[str] | t.Dict[str, DataType]] = None,
    8931) -> Values:
    8932    """Build VALUES statement.
    8933
    8934    Example:
    8935        >>> values([(1, '2')]).sql()
    8936        "VALUES (1, '2')"
    8937
    8938    Args:
    8939        values: values statements that will be converted to SQL
    8940        alias: optional alias
    8941        columns: Optional list of ordered column names or ordered dictionary of column names to types.
    8942         If either are provided then an alias is also required.
    8943
    8944    Returns:
    8945        Values: the Values expression object
    8946    """
    8947    if columns and not alias:
    8948        raise ValueError("Alias is required when providing columns")
    8949
    8950    return Values(
    8951        expressions=[convert(tup) for tup in values],
    8952        alias=(
    8953            TableAlias(this=to_identifier(alias), columns=[to_identifier(x) for x in columns])
    8954            if columns
    8955            else (TableAlias(this=to_identifier(alias)) if alias else None)
    8956        ),
    8957    )
    8958
    8959
    8960def var(name: t.Optional[ExpOrStr]) -> Var:
    8961    """Build a SQL variable.
    8962
    8963    Example:
    8964        >>> repr(var('x'))
    8965        'Var(this=x)'
    8966
    8967        >>> repr(var(column('x', table='y')))
    8968        'Var(this=x)'
    8969
    8970    Args:
    8971        name: The name of the var or an expression who's name will become the var.
    8972
    8973    Returns:
    8974        The new variable node.
    8975    """
    8976    if not name:
    8977        raise ValueError("Cannot convert empty name into var.")
    8978
    8979    if isinstance(name, Expression):
    8980        name = name.name
    8981    return Var(this=name)
    8982
    8983
    8984def rename_table(
    8985    old_name: str | Table,
    8986    new_name: str | Table,
    8987    dialect: DialectType = None,
    8988) -> Alter:
    8989    """Build ALTER TABLE... RENAME... expression
    8990
    8991    Args:
    8992        old_name: The old name of the table
    8993        new_name: The new name of the table
    8994        dialect: The dialect to parse the table.
    8995
    8996    Returns:
    8997        Alter table expression
    8998    """
    8999    old_table = to_table(old_name, dialect=dialect)
    9000    new_table = to_table(new_name, dialect=dialect)
    9001    return Alter(
    9002        this=old_table,
    9003        kind="TABLE",
    9004        actions=[
    9005            AlterRename(this=new_table),
    9006        ],
    9007    )
    9008
    9009
    9010def rename_column(
    9011    table_name: str | Table,
    9012    old_column_name: str | Column,
    9013    new_column_name: str | Column,
    9014    exists: t.Optional[bool] = None,
    9015    dialect: DialectType = None,
    9016) -> Alter:
    9017    """Build ALTER TABLE... RENAME COLUMN... expression
    9018
    9019    Args:
    9020        table_name: Name of the table
    9021        old_column: The old name of the column
    9022        new_column: The new name of the column
    9023        exists: Whether to add the `IF EXISTS` clause
    9024        dialect: The dialect to parse the table/column.
    9025
    9026    Returns:
    9027        Alter table expression
    9028    """
    9029    table = to_table(table_name, dialect=dialect)
    9030    old_column = to_column(old_column_name, dialect=dialect)
    9031    new_column = to_column(new_column_name, dialect=dialect)
    9032    return Alter(
    9033        this=table,
    9034        kind="TABLE",
    9035        actions=[
    9036            RenameColumn(this=old_column, to=new_column, exists=exists),
    9037        ],
    9038    )
    9039
    9040
    9041def convert(value: t.Any, copy: bool = False) -> Expression:
    9042    """Convert a python value into an expression object.
    9043
    9044    Raises an error if a conversion is not possible.
    9045
    9046    Args:
    9047        value: A python object.
    9048        copy: Whether to copy `value` (only applies to Expressions and collections).
    9049
    9050    Returns:
    9051        The equivalent expression object.
    9052    """
    9053    if isinstance(value, Expression):
    9054        return maybe_copy(value, copy)
    9055    if isinstance(value, str):
    9056        return Literal.string(value)
    9057    if isinstance(value, bool):
    9058        return Boolean(this=value)
    9059    if value is None or (isinstance(value, float) and math.isnan(value)):
    9060        return null()
    9061    if isinstance(value, numbers.Number):
    9062        return Literal.number(value)
    9063    if isinstance(value, bytes):
    9064        return HexString(this=value.hex())
    9065    if isinstance(value, datetime.datetime):
    9066        datetime_literal = Literal.string(value.isoformat(sep=" "))
    9067
    9068        tz = None
    9069        if value.tzinfo:
    9070            # this works for zoneinfo.ZoneInfo, pytz.timezone and datetime.datetime.utc to return IANA timezone names like "America/Los_Angeles"
    9071            # instead of abbreviations like "PDT". This is for consistency with other timezone handling functions in SQLGlot
    9072            tz = Literal.string(str(value.tzinfo))
    9073
    9074        return TimeStrToTime(this=datetime_literal, zone=tz)
    9075    if isinstance(value, datetime.date):
    9076        date_literal = Literal.string(value.strftime("%Y-%m-%d"))
    9077        return DateStrToDate(this=date_literal)
    9078    if isinstance(value, datetime.time):
    9079        time_literal = Literal.string(value.isoformat())
    9080        return TsOrDsToTime(this=time_literal)
    9081    if isinstance(value, tuple):
    9082        if hasattr(value, "_fields"):
    9083            return Struct(
    9084                expressions=[
    9085                    PropertyEQ(
    9086                        this=to_identifier(k), expression=convert(getattr(value, k), copy=copy)
    9087                    )
    9088                    for k in value._fields
    9089                ]
    9090            )
    9091        return Tuple(expressions=[convert(v, copy=copy) for v in value])
    9092    if isinstance(value, list):
    9093        return Array(expressions=[convert(v, copy=copy) for v in value])
    9094    if isinstance(value, dict):
    9095        return Map(
    9096            keys=Array(expressions=[convert(k, copy=copy) for k in value]),
    9097            values=Array(expressions=[convert(v, copy=copy) for v in value.values()]),
    9098        )
    9099    if hasattr(value, "__dict__"):
    9100        return Struct(
    9101            expressions=[
    9102                PropertyEQ(this=to_identifier(k), expression=convert(v, copy=copy))
    9103                for k, v in value.__dict__.items()
    9104            ]
    9105        )
    9106    raise ValueError(f"Cannot convert {value}")
    9107
    9108
    9109def replace_children(expression: Expression, fun: t.Callable, *args, **kwargs) -> None:
    9110    """
    9111    Replace children of an expression with the result of a lambda fun(child) -> exp.
    9112    """
    9113    for k, v in tuple(expression.args.items()):
    9114        is_list_arg = type(v) is list
    9115
    9116        child_nodes = v if is_list_arg else [v]
    9117        new_child_nodes = []
    9118
    9119        for cn in child_nodes:
    9120            if isinstance(cn, Expression):
    9121                for child_node in ensure_collection(fun(cn, *args, **kwargs)):
    9122                    new_child_nodes.append(child_node)
    9123            else:
    9124                new_child_nodes.append(cn)
    9125
    9126        expression.set(k, new_child_nodes if is_list_arg else seq_get(new_child_nodes, 0))
    9127
    9128
    9129def replace_tree(
    9130    expression: Expression,
    9131    fun: t.Callable,
    9132    prune: t.Optional[t.Callable[[Expression], bool]] = None,
    9133) -> Expression:
    9134    """
    9135    Replace an entire tree with the result of function calls on each node.
    9136
    9137    This will be traversed in reverse dfs, so leaves first.
    9138    If new nodes are created as a result of function calls, they will also be traversed.
    9139    """
    9140    stack = list(expression.dfs(prune=prune))
    9141
    9142    while stack:
    9143        node = stack.pop()
    9144        new_node = fun(node)
    9145
    9146        if new_node is not node:
    9147            node.replace(new_node)
    9148
    9149            if isinstance(new_node, Expression):
    9150                stack.append(new_node)
    9151
    9152    return new_node
    9153
    9154
    9155def column_table_names(expression: Expression, exclude: str = "") -> t.Set[str]:
    9156    """
    9157    Return all table names referenced through columns in an expression.
    9158
    9159    Example:
    9160        >>> import sqlglot
    9161        >>> sorted(column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e")))
    9162        ['a', 'c']
    9163
    9164    Args:
    9165        expression: expression to find table names.
    9166        exclude: a table name to exclude
    9167
    9168    Returns:
    9169        A list of unique names.
    9170    """
    9171    return {
    9172        table
    9173        for table in (column.table for column in expression.find_all(Column))
    9174        if table and table != exclude
    9175    }
    9176
    9177
    9178def table_name(table: Table | str, dialect: DialectType = None, identify: bool = False) -> str:
    9179    """Get the full name of a table as a string.
    9180
    9181    Args:
    9182        table: Table expression node or string.
    9183        dialect: The dialect to generate the table name for.
    9184        identify: Determines when an identifier should be quoted. Possible values are:
    9185            False (default): Never quote, except in cases where it's mandatory by the dialect.
    9186            True: Always quote.
    9187
    9188    Examples:
    9189        >>> from sqlglot import exp, parse_one
    9190        >>> table_name(parse_one("select * from a.b.c").find(exp.Table))
    9191        'a.b.c'
    9192
    9193    Returns:
    9194        The table name.
    9195    """
    9196
    9197    table = maybe_parse(table, into=Table, dialect=dialect)
    9198
    9199    if not table:
    9200        raise ValueError(f"Cannot parse {table}")
    9201
    9202    return ".".join(
    9203        (
    9204            part.sql(dialect=dialect, identify=True, copy=False, comments=False)
    9205            if identify or not SAFE_IDENTIFIER_RE.match(part.name)
    9206            else part.name
    9207        )
    9208        for part in table.parts
    9209    )
    9210
    9211
    9212def normalize_table_name(table: str | Table, dialect: DialectType = None, copy: bool = True) -> str:
    9213    """Returns a case normalized table name without quotes.
    9214
    9215    Args:
    9216        table: the table to normalize
    9217        dialect: the dialect to use for normalization rules
    9218        copy: whether to copy the expression.
    9219
    9220    Examples:
    9221        >>> normalize_table_name("`A-B`.c", dialect="bigquery")
    9222        'A-B.c'
    9223    """
    9224    from sqlglot.optimizer.normalize_identifiers import normalize_identifiers
    9225
    9226    return ".".join(
    9227        p.name
    9228        for p in normalize_identifiers(
    9229            to_table(table, dialect=dialect, copy=copy), dialect=dialect
    9230        ).parts
    9231    )
    9232
    9233
    9234def replace_tables(
    9235    expression: E, mapping: t.Dict[str, str], dialect: DialectType = None, copy: bool = True
    9236) -> E:
    9237    """Replace all tables in expression according to the mapping.
    9238
    9239    Args:
    9240        expression: expression node to be transformed and replaced.
    9241        mapping: mapping of table names.
    9242        dialect: the dialect of the mapping table
    9243        copy: whether to copy the expression.
    9244
    9245    Examples:
    9246        >>> from sqlglot import exp, parse_one
    9247        >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()
    9248        'SELECT * FROM c /* a.b */'
    9249
    9250    Returns:
    9251        The mapped expression.
    9252    """
    9253
    9254    mapping = {normalize_table_name(k, dialect=dialect): v for k, v in mapping.items()}
    9255
    9256    def _replace_tables(node: Expression) -> Expression:
    9257        if isinstance(node, Table) and node.meta.get("replace") is not False:
    9258            original = normalize_table_name(node, dialect=dialect)
    9259            new_name = mapping.get(original)
    9260
    9261            if new_name:
    9262                table = to_table(
    9263                    new_name,
    9264                    **{k: v for k, v in node.args.items() if k not in TABLE_PARTS},
    9265                    dialect=dialect,
    9266                )
    9267                table.add_comments([original])
    9268                return table
    9269        return node
    9270
    9271    return expression.transform(_replace_tables, copy=copy)  # type: ignore
    9272
    9273
    9274def replace_placeholders(expression: Expression, *args, **kwargs) -> Expression:
    9275    """Replace placeholders in an expression.
    9276
    9277    Args:
    9278        expression: expression node to be transformed and replaced.
    9279        args: positional names that will substitute unnamed placeholders in the given order.
    9280        kwargs: keyword arguments that will substitute named placeholders.
    9281
    9282    Examples:
    9283        >>> from sqlglot import exp, parse_one
    9284        >>> replace_placeholders(
    9285        ...     parse_one("select * from :tbl where ? = ?"),
    9286        ...     exp.to_identifier("str_col"), "b", tbl=exp.to_identifier("foo")
    9287        ... ).sql()
    9288        "SELECT * FROM foo WHERE str_col = 'b'"
    9289
    9290    Returns:
    9291        The mapped expression.
    9292    """
    9293
    9294    def _replace_placeholders(node: Expression, args, **kwargs) -> Expression:
    9295        if isinstance(node, Placeholder):
    9296            if node.this:
    9297                new_name = kwargs.get(node.this)
    9298                if new_name is not None:
    9299                    return convert(new_name)
    9300            else:
    9301                try:
    9302                    return convert(next(args))
    9303                except StopIteration:
    9304                    pass
    9305        return node
    9306
    9307    return expression.transform(_replace_placeholders, iter(args), **kwargs)
    9308
    9309
    9310def expand(
    9311    expression: Expression,
    9312    sources: t.Dict[str, Query | t.Callable[[], Query]],
    9313    dialect: DialectType = None,
    9314    copy: bool = True,
    9315) -> Expression:
    9316    """Transforms an expression by expanding all referenced sources into subqueries.
    9317
    9318    Examples:
    9319        >>> from sqlglot import parse_one
    9320        >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y")}).sql()
    9321        'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'
    9322
    9323        >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y"), "y": parse_one("select * from z")}).sql()
    9324        'SELECT * FROM (SELECT * FROM (SELECT * FROM z) AS y /* source: y */) AS z /* source: x */'
    9325
    9326    Args:
    9327        expression: The expression to expand.
    9328        sources: A dict of name to query or a callable that provides a query on demand.
    9329        dialect: The dialect of the sources dict or the callable.
    9330        copy: Whether to copy the expression during transformation. Defaults to True.
    9331
    9332    Returns:
    9333        The transformed expression.
    9334    """
    9335    normalized_sources = {normalize_table_name(k, dialect=dialect): v for k, v in sources.items()}
    9336
    9337    def _expand(node: Expression):
    9338        if isinstance(node, Table):
    9339            name = normalize_table_name(node, dialect=dialect)
    9340            source = normalized_sources.get(name)
    9341
    9342            if source:
    9343                # Create a subquery with the same alias (or table name if no alias)
    9344                parsed_source = source() if callable(source) else source
    9345                subquery = parsed_source.subquery(node.alias or name)
    9346                subquery.comments = [f"source: {name}"]
    9347
    9348                # Continue expanding within the subquery
    9349                return subquery.transform(_expand, copy=False)
    9350
    9351        return node
    9352
    9353    return expression.transform(_expand, copy=copy)
    9354
    9355
    9356def func(name: str, *args, copy: bool = True, dialect: DialectType = None, **kwargs) -> Func:
    9357    """
    9358    Returns a Func expression.
    9359
    9360    Examples:
    9361        >>> func("abs", 5).sql()
    9362        'ABS(5)'
    9363
    9364        >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()
    9365        'CAST(5 AS DOUBLE)'
    9366
    9367    Args:
    9368        name: the name of the function to build.
    9369        args: the args used to instantiate the function of interest.
    9370        copy: whether to copy the argument expressions.
    9371        dialect: the source dialect.
    9372        kwargs: the kwargs used to instantiate the function of interest.
    9373
    9374    Note:
    9375        The arguments `args` and `kwargs` are mutually exclusive.
    9376
    9377    Returns:
    9378        An instance of the function of interest, or an anonymous function, if `name` doesn't
    9379        correspond to an existing `sqlglot.expressions.Func` class.
    9380    """
    9381    if args and kwargs:
    9382        raise ValueError("Can't use both args and kwargs to instantiate a function.")
    9383
    9384    from sqlglot.dialects.dialect import Dialect
    9385
    9386    dialect = Dialect.get_or_raise(dialect)
    9387
    9388    converted: t.List[Expression] = [maybe_parse(arg, dialect=dialect, copy=copy) for arg in args]
    9389    kwargs = {key: maybe_parse(value, dialect=dialect, copy=copy) for key, value in kwargs.items()}
    9390
    9391    constructor = dialect.parser_class.FUNCTIONS.get(name.upper())
    9392    if constructor:
    9393        if converted:
    9394            if "dialect" in constructor.__code__.co_varnames:
    9395                function = constructor(converted, dialect=dialect)
    9396            else:
    9397                function = constructor(converted)
    9398        elif constructor.__name__ == "from_arg_list":
    9399            function = constructor.__self__(**kwargs)  # type: ignore
    9400        else:
    9401            constructor = FUNCTION_BY_NAME.get(name.upper())
    9402            if constructor:
    9403                function = constructor(**kwargs)
    9404            else:
    9405                raise ValueError(
    9406                    f"Unable to convert '{name}' into a Func. Either manually construct "
    9407                    "the Func expression of interest or parse the function call."
    9408                )
    9409    else:
    9410        kwargs = kwargs or {"expressions": converted}
    9411        function = Anonymous(this=name, **kwargs)
    9412
    9413    for error_message in function.error_messages(converted):
    9414        raise ValueError(error_message)
    9415
    9416    return function
    9417
    9418
    9419def case(
    9420    expression: t.Optional[ExpOrStr] = None,
    9421    **opts,
    9422) -> Case:
    9423    """
    9424    Initialize a CASE statement.
    9425
    9426    Example:
    9427        case().when("a = 1", "foo").else_("bar")
    9428
    9429    Args:
    9430        expression: Optionally, the input expression (not all dialects support this)
    9431        **opts: Extra keyword arguments for parsing `expression`
    9432    """
    9433    if expression is not None:
    9434        this = maybe_parse(expression, **opts)
    9435    else:
    9436        this = None
    9437    return Case(this=this, ifs=[])
    9438
    9439
    9440def array(
    9441    *expressions: ExpOrStr, copy: bool = True, dialect: DialectType = None, **kwargs
    9442) -> Array:
    9443    """
    9444    Returns an array.
    9445
    9446    Examples:
    9447        >>> array(1, 'x').sql()
    9448        'ARRAY(1, x)'
    9449
    9450    Args:
    9451        expressions: the expressions to add to the array.
    9452        copy: whether to copy the argument expressions.
    9453        dialect: the source dialect.
    9454        kwargs: the kwargs used to instantiate the function of interest.
    9455
    9456    Returns:
    9457        An array expression.
    9458    """
    9459    return Array(
    9460        expressions=[
    9461            maybe_parse(expression, copy=copy, dialect=dialect, **kwargs)
    9462            for expression in expressions
    9463        ]
    9464    )
    9465
    9466
    9467def tuple_(
    9468    *expressions: ExpOrStr, copy: bool = True, dialect: DialectType = None, **kwargs
    9469) -> Tuple:
    9470    """
    9471    Returns an tuple.
    9472
    9473    Examples:
    9474        >>> tuple_(1, 'x').sql()
    9475        '(1, x)'
    9476
    9477    Args:
    9478        expressions: the expressions to add to the tuple.
    9479        copy: whether to copy the argument expressions.
    9480        dialect: the source dialect.
    9481        kwargs: the kwargs used to instantiate the function of interest.
    9482
    9483    Returns:
    9484        A tuple expression.
    9485    """
    9486    return Tuple(
    9487        expressions=[
    9488            maybe_parse(expression, copy=copy, dialect=dialect, **kwargs)
    9489            for expression in expressions
    9490        ]
    9491    )
    9492
    9493
    9494def true() -> Boolean:
    9495    """
    9496    Returns a true Boolean expression.
    9497    """
    9498    return Boolean(this=True)
    9499
    9500
    9501def false() -> Boolean:
    9502    """
    9503    Returns a false Boolean expression.
    9504    """
    9505    return Boolean(this=False)
    9506
    9507
    9508def null() -> Null:
    9509    """
    9510    Returns a Null expression.
    9511    """
    9512    return Null()
    9513
    9514
    9515NONNULL_CONSTANTS = (
    9516    Literal,
    9517    Boolean,
    9518)
    9519
    9520CONSTANTS = (
    9521    Literal,
    9522    Boolean,
    9523    Null,
    9524)

SQLGLOT_META = 'sqlglot.meta'
SQLGLOT_ANONYMOUS = 'sqlglot.anonymous'
TABLE_PARTS = ('this', 'db', 'catalog')
COLUMN_PARTS = ('this', 'table', 'db', 'catalog')
POSITION_META_KEYS = ('line', 'col', 'start', 'end')
class Expression: View Source

      72class Expression(metaclass=_Expression):
      73    """
      74    The base class for all expressions in a syntax tree. Each Expression encapsulates any necessary
      75    context, such as its child expressions, their names (arg keys), and whether a given child expression
      76    is optional or not.
      77
      78    Attributes:
      79        key: a unique key for each class in the Expression hierarchy. This is useful for hashing
      80            and representing expressions as strings.
      81        arg_types: determines the arguments (child nodes) supported by an expression. It maps
      82            arg keys to booleans that indicate whether the corresponding args are optional.
      83        parent: a reference to the parent expression (or None, in case of root expressions).
      84        arg_key: the arg key an expression is associated with, i.e. the name its parent expression
      85            uses to refer to it.
      86        index: the index of an expression if it is inside of a list argument in its parent.
      87        comments: a list of comments that are associated with a given expression. This is used in
      88            order to preserve comments when transpiling SQL code.
      89        type: the `sqlglot.expressions.DataType` type of an expression. This is inferred by the
      90            optimizer, in order to enable some transformations that require type information.
      91        meta: a dictionary that can be used to store useful metadata for a given expression.
      92
      93    Example:
      94        >>> class Foo(Expression):
      95        ...     arg_types = {"this": True, "expression": False}
      96
      97        The above definition informs us that Foo is an Expression that requires an argument called
      98        "this" and may also optionally receive an argument called "expression".
      99
     100    Args:
     101        args: a mapping used for retrieving the arguments of an expression, given their arg keys.
     102    """
     103
     104    key = "expression"
     105    arg_types = {"this": True}
     106    __slots__ = ("args", "parent", "arg_key", "index", "comments", "_type", "_meta", "_hash")
     107
     108    def __init__(self, **args: t.Any):
     109        self.args: t.Dict[str, t.Any] = args
     110        self.parent: t.Optional[Expression] = None
     111        self.arg_key: t.Optional[str] = None
     112        self.index: t.Optional[int] = None
     113        self.comments: t.Optional[t.List[str]] = None
     114        self._type: t.Optional[DataType] = None
     115        self._meta: t.Optional[t.Dict[str, t.Any]] = None
     116        self._hash: t.Optional[int] = None
     117
     118        for arg_key, value in self.args.items():
     119            self._set_parent(arg_key, value)
     120
     121    def __eq__(self, other) -> bool:
     122        return type(self) is type(other) and hash(self) == hash(other)
     123
     124    @property
     125    def hashable_args(self) -> t.Any:
     126        return frozenset(
     127            (k, tuple(_norm_arg(a) for a in v) if type(v) is list else _norm_arg(v))
     128            for k, v in self.args.items()
     129            if not (v is None or v is False or (type(v) is list and not v))
     130        )
     131
     132    def __hash__(self) -> int:
     133        if self._hash is not None:
     134            return self._hash
     135
     136        return hash((self.__class__, self.hashable_args))
     137
     138    def __reduce__(self) -> t.Tuple[t.Callable, t.Tuple[t.List[t.Dict[str, t.Any]]]]:
     139        from sqlglot.serde import dump, load
     140
     141        return (load, (dump(self),))
     142
     143    @property
     144    def this(self) -> t.Any:
     145        """
     146        Retrieves the argument with key "this".
     147        """
     148        return self.args.get("this")
     149
     150    @property
     151    def expression(self) -> t.Any:
     152        """
     153        Retrieves the argument with key "expression".
     154        """
     155        return self.args.get("expression")
     156
     157    @property
     158    def expressions(self) -> t.List[t.Any]:
     159        """
     160        Retrieves the argument with key "expressions".
     161        """
     162        return self.args.get("expressions") or []
     163
     164    def text(self, key) -> str:
     165        """
     166        Returns a textual representation of the argument corresponding to "key". This can only be used
     167        for args that are strings or leaf Expression instances, such as identifiers and literals.
     168        """
     169        field = self.args.get(key)
     170        if isinstance(field, str):
     171            return field
     172        if isinstance(field, (Identifier, Literal, Var)):
     173            return field.this
     174        if isinstance(field, (Star, Null)):
     175            return field.name
     176        return ""
     177
     178    @property
     179    def is_string(self) -> bool:
     180        """
     181        Checks whether a Literal expression is a string.
     182        """
     183        return isinstance(self, Literal) and self.args["is_string"]
     184
     185    @property
     186    def is_number(self) -> bool:
     187        """
     188        Checks whether a Literal expression is a number.
     189        """
     190        return (isinstance(self, Literal) and not self.args["is_string"]) or (
     191            isinstance(self, Neg) and self.this.is_number
     192        )
     193
     194    def to_py(self) -> t.Any:
     195        """
     196        Returns a Python object equivalent of the SQL node.
     197        """
     198        raise ValueError(f"{self} cannot be converted to a Python object.")
     199
     200    @property
     201    def is_int(self) -> bool:
     202        """
     203        Checks whether an expression is an integer.
     204        """
     205        return self.is_number and isinstance(self.to_py(), int)
     206
     207    @property
     208    def is_star(self) -> bool:
     209        """Checks whether an expression is a star."""
     210        return isinstance(self, Star) or (isinstance(self, Column) and isinstance(self.this, Star))
     211
     212    @property
     213    def alias(self) -> str:
     214        """
     215        Returns the alias of the expression, or an empty string if it's not aliased.
     216        """
     217        if isinstance(self.args.get("alias"), TableAlias):
     218            return self.args["alias"].name
     219        return self.text("alias")
     220
     221    @property
     222    def alias_column_names(self) -> t.List[str]:
     223        table_alias = self.args.get("alias")
     224        if not table_alias:
     225            return []
     226        return [c.name for c in table_alias.args.get("columns") or []]
     227
     228    @property
     229    def name(self) -> str:
     230        return self.text("this")
     231
     232    @property
     233    def alias_or_name(self) -> str:
     234        return self.alias or self.name
     235
     236    @property
     237    def output_name(self) -> str:
     238        """
     239        Name of the output column if this expression is a selection.
     240
     241        If the Expression has no output name, an empty string is returned.
     242
     243        Example:
     244            >>> from sqlglot import parse_one
     245            >>> parse_one("SELECT a").expressions[0].output_name
     246            'a'
     247            >>> parse_one("SELECT b AS c").expressions[0].output_name
     248            'c'
     249            >>> parse_one("SELECT 1 + 2").expressions[0].output_name
     250            ''
     251        """
     252        return ""
     253
     254    @property
     255    def type(self) -> t.Optional[DataType]:
     256        return self._type
     257
     258    @type.setter
     259    def type(self, dtype: t.Optional[DataType | DataType.Type | str]) -> None:
     260        if dtype and not isinstance(dtype, DataType):
     261            dtype = DataType.build(dtype)
     262        self._type = dtype  # type: ignore
     263
     264    def is_type(self, *dtypes) -> bool:
     265        return self.type is not None and self.type.is_type(*dtypes)
     266
     267    def is_leaf(self) -> bool:
     268        return not any(isinstance(v, (Expression, list)) and v for v in self.args.values())
     269
     270    @property
     271    def meta(self) -> t.Dict[str, t.Any]:
     272        if self._meta is None:
     273            self._meta = {}
     274        return self._meta
     275
     276    def __deepcopy__(self, memo):
     277        root = self.__class__()
     278        stack = [(self, root)]
     279
     280        while stack:
     281            node, copy = stack.pop()
     282
     283            if node.comments is not None:
     284                copy.comments = deepcopy(node.comments)
     285            if node._type is not None:
     286                copy._type = deepcopy(node._type)
     287            if node._meta is not None:
     288                copy._meta = deepcopy(node._meta)
     289            if node._hash is not None:
     290                copy._hash = node._hash
     291
     292            for k, vs in node.args.items():
     293                if hasattr(vs, "parent"):
     294                    stack.append((vs, vs.__class__()))
     295                    copy.set(k, stack[-1][-1])
     296                elif type(vs) is list:
     297                    copy.args[k] = []
     298
     299                    for v in vs:
     300                        if hasattr(v, "parent"):
     301                            stack.append((v, v.__class__()))
     302                            copy.append(k, stack[-1][-1])
     303                        else:
     304                            copy.append(k, v)
     305                else:
     306                    copy.args[k] = vs
     307
     308        return root
     309
     310    def copy(self) -> Self:
     311        """
     312        Returns a deep copy of the expression.
     313        """
     314        return deepcopy(self)
     315
     316    def add_comments(self, comments: t.Optional[t.List[str]] = None, prepend: bool = False) -> None:
     317        if self.comments is None:
     318            self.comments = []
     319
     320        if comments:
     321            for comment in comments:
     322                _, *meta = comment.split(SQLGLOT_META)
     323                if meta:
     324                    for kv in "".join(meta).split(","):
     325                        k, *v = kv.split("=")
     326                        value = v[0].strip() if v else True
     327                        self.meta[k.strip()] = to_bool(value)
     328
     329                if not prepend:
     330                    self.comments.append(comment)
     331
     332            if prepend:
     333                self.comments = comments + self.comments
     334
     335    def pop_comments(self) -> t.List[str]:
     336        comments = self.comments or []
     337        self.comments = None
     338        return comments
     339
     340    def append(self, arg_key: str, value: t.Any) -> None:
     341        """
     342        Appends value to arg_key if it's a list or sets it as a new list.
     343
     344        Args:
     345            arg_key (str): name of the list expression arg
     346            value (Any): value to append to the list
     347        """
     348        if type(self.args.get(arg_key)) is not list:
     349            self.args[arg_key] = []
     350        self._set_parent(arg_key, value)
     351        values = self.args[arg_key]
     352        if hasattr(value, "parent"):
     353            value.index = len(values)
     354        values.append(value)
     355
     356    def set(
     357        self,
     358        arg_key: str,
     359        value: t.Any,
     360        index: t.Optional[int] = None,
     361        overwrite: bool = True,
     362    ) -> None:
     363        """
     364        Sets arg_key to value.
     365
     366        Args:
     367            arg_key: name of the expression arg.
     368            value: value to set the arg to.
     369            index: if the arg is a list, this specifies what position to add the value in it.
     370            overwrite: assuming an index is given, this determines whether to overwrite the
     371                list entry instead of only inserting a new value (i.e., like list.insert).
     372        """
     373        if index is not None:
     374            expressions = self.args.get(arg_key) or []
     375
     376            if seq_get(expressions, index) is None:
     377                return
     378            if value is None:
     379                expressions.pop(index)
     380                for v in expressions[index:]:
     381                    v.index = v.index - 1
     382                return
     383
     384            if isinstance(value, list):
     385                expressions.pop(index)
     386                expressions[index:index] = value
     387            elif overwrite:
     388                expressions[index] = value
     389            else:
     390                expressions.insert(index, value)
     391
     392            value = expressions
     393        elif value is None:
     394            self.args.pop(arg_key, None)
     395            return
     396
     397        self.args[arg_key] = value
     398        self._set_parent(arg_key, value, index)
     399
     400    def _set_parent(self, arg_key: str, value: t.Any, index: t.Optional[int] = None) -> None:
     401        if hasattr(value, "parent"):
     402            value.parent = self
     403            value.arg_key = arg_key
     404            value.index = index
     405        elif type(value) is list:
     406            for index, v in enumerate(value):
     407                if hasattr(v, "parent"):
     408                    v.parent = self
     409                    v.arg_key = arg_key
     410                    v.index = index
     411
     412    @property
     413    def depth(self) -> int:
     414        """
     415        Returns the depth of this tree.
     416        """
     417        if self.parent:
     418            return self.parent.depth + 1
     419        return 0
     420
     421    def iter_expressions(self, reverse: bool = False) -> t.Iterator[Expression]:
     422        """Yields the key and expression for all arguments, exploding list args."""
     423        for vs in reversed(self.args.values()) if reverse else self.args.values():  # type: ignore
     424            if type(vs) is list:
     425                for v in reversed(vs) if reverse else vs:  # type: ignore
     426                    if hasattr(v, "parent"):
     427                        yield v
     428            else:
     429                if hasattr(vs, "parent"):
     430                    yield vs
     431
     432    def find(self, *expression_types: t.Type[E], bfs: bool = True) -> t.Optional[E]:
     433        """
     434        Returns the first node in this tree which matches at least one of
     435        the specified types.
     436
     437        Args:
     438            expression_types: the expression type(s) to match.
     439            bfs: whether to search the AST using the BFS algorithm (DFS is used if false).
     440
     441        Returns:
     442            The node which matches the criteria or None if no such node was found.
     443        """
     444        return next(self.find_all(*expression_types, bfs=bfs), None)
     445
     446    def find_all(self, *expression_types: t.Type[E], bfs: bool = True) -> t.Iterator[E]:
     447        """
     448        Returns a generator object which visits all nodes in this tree and only
     449        yields those that match at least one of the specified expression types.
     450
     451        Args:
     452            expression_types: the expression type(s) to match.
     453            bfs: whether to search the AST using the BFS algorithm (DFS is used if false).
     454
     455        Returns:
     456            The generator object.
     457        """
     458        for expression in self.walk(bfs=bfs):
     459            if isinstance(expression, expression_types):
     460                yield expression
     461
     462    def find_ancestor(self, *expression_types: t.Type[E]) -> t.Optional[E]:
     463        """
     464        Returns a nearest parent matching expression_types.
     465
     466        Args:
     467            expression_types: the expression type(s) to match.
     468
     469        Returns:
     470            The parent node.
     471        """
     472        ancestor = self.parent
     473        while ancestor and not isinstance(ancestor, expression_types):
     474            ancestor = ancestor.parent
     475        return ancestor  # type: ignore
     476
     477    @property
     478    def parent_select(self) -> t.Optional[Select]:
     479        """
     480        Returns the parent select statement.
     481        """
     482        return self.find_ancestor(Select)
     483
     484    @property
     485    def same_parent(self) -> bool:
     486        """Returns if the parent is the same class as itself."""
     487        return type(self.parent) is self.__class__
     488
     489    def root(self) -> Expression:
     490        """
     491        Returns the root expression of this tree.
     492        """
     493        expression = self
     494        while expression.parent:
     495            expression = expression.parent
     496        return expression
     497
     498    def walk(
     499        self, bfs: bool = True, prune: t.Optional[t.Callable[[Expression], bool]] = None
     500    ) -> t.Iterator[Expression]:
     501        """
     502        Returns a generator object which visits all nodes in this tree.
     503
     504        Args:
     505            bfs: if set to True the BFS traversal order will be applied,
     506                otherwise the DFS traversal will be used instead.
     507            prune: callable that returns True if the generator should stop traversing
     508                this branch of the tree.
     509
     510        Returns:
     511            the generator object.
     512        """
     513        if bfs:
     514            yield from self.bfs(prune=prune)
     515        else:
     516            yield from self.dfs(prune=prune)
     517
     518    def dfs(
     519        self, prune: t.Optional[t.Callable[[Expression], bool]] = None
     520    ) -> t.Iterator[Expression]:
     521        """
     522        Returns a generator object which visits all nodes in this tree in
     523        the DFS (Depth-first) order.
     524
     525        Returns:
     526            The generator object.
     527        """
     528        stack = [self]
     529
     530        while stack:
     531            node = stack.pop()
     532
     533            yield node
     534
     535            if prune and prune(node):
     536                continue
     537
     538            for v in node.iter_expressions(reverse=True):
     539                stack.append(v)
     540
     541    def bfs(
     542        self, prune: t.Optional[t.Callable[[Expression], bool]] = None
     543    ) -> t.Iterator[Expression]:
     544        """
     545        Returns a generator object which visits all nodes in this tree in
     546        the BFS (Breadth-first) order.
     547
     548        Returns:
     549            The generator object.
     550        """
     551        queue = deque([self])
     552
     553        while queue:
     554            node = queue.popleft()
     555
     556            yield node
     557
     558            if prune and prune(node):
     559                continue
     560
     561            for v in node.iter_expressions():
     562                queue.append(v)
     563
     564    def unnest(self):
     565        """
     566        Returns the first non parenthesis child or self.
     567        """
     568        expression = self
     569        while type(expression) is Paren:
     570            expression = expression.this
     571        return expression
     572
     573    def unalias(self):
     574        """
     575        Returns the inner expression if this is an Alias.
     576        """
     577        if isinstance(self, Alias):
     578            return self.this
     579        return self
     580
     581    def unnest_operands(self):
     582        """
     583        Returns unnested operands as a tuple.
     584        """
     585        return tuple(arg.unnest() for arg in self.iter_expressions())
     586
     587    def flatten(self, unnest=True):
     588        """
     589        Returns a generator which yields child nodes whose parents are the same class.
     590
     591        A AND B AND C -> [A, B, C]
     592        """
     593        for node in self.dfs(prune=lambda n: n.parent and type(n) is not self.__class__):
     594            if type(node) is not self.__class__:
     595                yield node.unnest() if unnest and not isinstance(node, Subquery) else node
     596
     597    def __str__(self) -> str:
     598        return self.sql()
     599
     600    def __repr__(self) -> str:
     601        return _to_s(self)
     602
     603    def to_s(self) -> str:
     604        """
     605        Same as __repr__, but includes additional information which can be useful
     606        for debugging, like empty or missing args and the AST nodes' object IDs.
     607        """
     608        return _to_s(self, verbose=True)
     609
     610    def sql(self, dialect: DialectType = None, **opts) -> str:
     611        """
     612        Returns SQL string representation of this tree.
     613
     614        Args:
     615            dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").
     616            opts: other `sqlglot.generator.Generator` options.
     617
     618        Returns:
     619            The SQL string.
     620        """
     621        from sqlglot.dialects import Dialect
     622
     623        return Dialect.get_or_raise(dialect).generate(self, **opts)
     624
     625    def transform(self, fun: t.Callable, *args: t.Any, copy: bool = True, **kwargs) -> Expression:
     626        """
     627        Visits all tree nodes (excluding already transformed ones)
     628        and applies the given transformation function to each node.
     629
     630        Args:
     631            fun: a function which takes a node as an argument and returns a
     632                new transformed node or the same node without modifications. If the function
     633                returns None, then the corresponding node will be removed from the syntax tree.
     634            copy: if set to True a new tree instance is constructed, otherwise the tree is
     635                modified in place.
     636
     637        Returns:
     638            The transformed tree.
     639        """
     640        root = None
     641        new_node = None
     642
     643        for node in (self.copy() if copy else self).dfs(prune=lambda n: n is not new_node):
     644            parent, arg_key, index = node.parent, node.arg_key, node.index
     645            new_node = fun(node, *args, **kwargs)
     646
     647            if not root:
     648                root = new_node
     649            elif parent and arg_key and new_node is not node:
     650                parent.set(arg_key, new_node, index)
     651
     652        assert root
     653        return root.assert_is(Expression)
     654
     655    @t.overload
     656    def replace(self, expression: E) -> E: ...
     657
     658    @t.overload
     659    def replace(self, expression: None) -> None: ...
     660
     661    def replace(self, expression):
     662        """
     663        Swap out this expression with a new expression.
     664
     665        For example::
     666
     667            >>> tree = Select().select("x").from_("tbl")
     668            >>> tree.find(Column).replace(column("y"))
     669            Column(
     670              this=Identifier(this=y, quoted=False))
     671            >>> tree.sql()
     672            'SELECT y FROM tbl'
     673
     674        Args:
     675            expression: new node
     676
     677        Returns:
     678            The new expression or expressions.
     679        """
     680        parent = self.parent
     681
     682        if not parent or parent is expression:
     683            return expression
     684
     685        key = self.arg_key
     686        value = parent.args.get(key)
     687
     688        if type(expression) is list and isinstance(value, Expression):
     689            # We are trying to replace an Expression with a list, so it's assumed that
     690            # the intention was to really replace the parent of this expression.
     691            value.parent.replace(expression)
     692        else:
     693            parent.set(key, expression, self.index)
     694
     695        if expression is not self:
     696            self.parent = None
     697            self.arg_key = None
     698            self.index = None
     699
     700        return expression
     701
     702    def pop(self: E) -> E:
     703        """
     704        Remove this expression from its AST.
     705
     706        Returns:
     707            The popped expression.
     708        """
     709        self.replace(None)
     710        return self
     711
     712    def assert_is(self, type_: t.Type[E]) -> E:
     713        """
     714        Assert that this `Expression` is an instance of `type_`.
     715
     716        If it is NOT an instance of `type_`, this raises an assertion error.
     717        Otherwise, this returns this expression.
     718
     719        Examples:
     720            This is useful for type security in chained expressions:
     721
     722            >>> import sqlglot
     723            >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()
     724            'SELECT x, z FROM y'
     725        """
     726        if not isinstance(self, type_):
     727            raise AssertionError(f"{self} is not {type_}.")
     728        return self
     729
     730    def error_messages(self, args: t.Optional[t.Sequence] = None) -> t.List[str]:
     731        """
     732        Checks if this expression is valid (e.g. all mandatory args are set).
     733
     734        Args:
     735            args: a sequence of values that were used to instantiate a Func expression. This is used
     736                to check that the provided arguments don't exceed the function argument limit.
     737
     738        Returns:
     739            A list of error messages for all possible errors that were found.
     740        """
     741        errors: t.List[str] = []
     742
     743        for k in self.args:
     744            if k not in self.arg_types:
     745                errors.append(f"Unexpected keyword: '{k}' for {self.__class__}")
     746        for k, mandatory in self.arg_types.items():
     747            v = self.args.get(k)
     748            if mandatory and (v is None or (isinstance(v, list) and not v)):
     749                errors.append(f"Required keyword: '{k}' missing for {self.__class__}")
     750
     751        if (
     752            args
     753            and isinstance(self, Func)
     754            and len(args) > len(self.arg_types)
     755            and not self.is_var_len_args
     756        ):
     757            errors.append(
     758                f"The number of provided arguments ({len(args)}) is greater than "
     759                f"the maximum number of supported arguments ({len(self.arg_types)})"
     760            )
     761
     762        return errors
     763
     764    def dump(self):
     765        """
     766        Dump this Expression to a JSON-serializable dict.
     767        """
     768        from sqlglot.serde import dump
     769
     770        return dump(self)
     771
     772    @classmethod
     773    def load(cls, obj):
     774        """
     775        Load a dict (as returned by `Expression.dump`) into an Expression instance.
     776        """
     777        from sqlglot.serde import load
     778
     779        return load(obj)
     780
     781    def and_(
     782        self,
     783        *expressions: t.Optional[ExpOrStr],
     784        dialect: DialectType = None,
     785        copy: bool = True,
     786        wrap: bool = True,
     787        **opts,
     788    ) -> Condition:
     789        """
     790        AND this condition with one or multiple expressions.
     791
     792        Example:
     793            >>> condition("x=1").and_("y=1").sql()
     794            'x = 1 AND y = 1'
     795
     796        Args:
     797            *expressions: the SQL code strings to parse.
     798                If an `Expression` instance is passed, it will be used as-is.
     799            dialect: the dialect used to parse the input expression.
     800            copy: whether to copy the involved expressions (only applies to Expressions).
     801            wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
     802                precedence issues, but can be turned off when the produced AST is too deep and
     803                causes recursion-related issues.
     804            opts: other options to use to parse the input expressions.
     805
     806        Returns:
     807            The new And condition.
     808        """
     809        return and_(self, *expressions, dialect=dialect, copy=copy, wrap=wrap, **opts)
     810
     811    def or_(
     812        self,
     813        *expressions: t.Optional[ExpOrStr],
     814        dialect: DialectType = None,
     815        copy: bool = True,
     816        wrap: bool = True,
     817        **opts,
     818    ) -> Condition:
     819        """
     820        OR this condition with one or multiple expressions.
     821
     822        Example:
     823            >>> condition("x=1").or_("y=1").sql()
     824            'x = 1 OR y = 1'
     825
     826        Args:
     827            *expressions: the SQL code strings to parse.
     828                If an `Expression` instance is passed, it will be used as-is.
     829            dialect: the dialect used to parse the input expression.
     830            copy: whether to copy the involved expressions (only applies to Expressions).
     831            wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
     832                precedence issues, but can be turned off when the produced AST is too deep and
     833                causes recursion-related issues.
     834            opts: other options to use to parse the input expressions.
     835
     836        Returns:
     837            The new Or condition.
     838        """
     839        return or_(self, *expressions, dialect=dialect, copy=copy, wrap=wrap, **opts)
     840
     841    def not_(self, copy: bool = True):
     842        """
     843        Wrap this condition with NOT.
     844
     845        Example:
     846            >>> condition("x=1").not_().sql()
     847            'NOT x = 1'
     848
     849        Args:
     850            copy: whether to copy this object.
     851
     852        Returns:
     853            The new Not instance.
     854        """
     855        return not_(self, copy=copy)
     856
     857    def update_positions(
     858        self: E, other: t.Optional[Token | Expression] = None, **kwargs: t.Any
     859    ) -> E:
     860        """
     861        Update this expression with positions from a token or other expression.
     862
     863        Args:
     864            other: a token or expression to update this expression with.
     865
     866        Returns:
     867            The updated expression.
     868        """
     869        if isinstance(other, Expression):
     870            self.meta.update({k: v for k, v in other.meta.items() if k in POSITION_META_KEYS})
     871        elif other is not None:
     872            self.meta.update(
     873                {
     874                    "line": other.line,
     875                    "col": other.col,
     876                    "start": other.start,
     877                    "end": other.end,
     878                }
     879            )
     880        self.meta.update({k: v for k, v in kwargs.items() if k in POSITION_META_KEYS})
     881        return self
     882
     883    def as_(
     884        self,
     885        alias: str | Identifier,
     886        quoted: t.Optional[bool] = None,
     887        dialect: DialectType = None,
     888        copy: bool = True,
     889        **opts,
     890    ) -> Alias:
     891        return alias_(self, alias, quoted=quoted, dialect=dialect, copy=copy, **opts)
     892
     893    def _binop(self, klass: t.Type[E], other: t.Any, reverse: bool = False) -> E:
     894        this = self.copy()
     895        other = convert(other, copy=True)
     896        if not isinstance(this, klass) and not isinstance(other, klass):
     897            this = _wrap(this, Binary)
     898            other = _wrap(other, Binary)
     899        if reverse:
     900            return klass(this=other, expression=this)
     901        return klass(this=this, expression=other)
     902
     903    def __getitem__(self, other: ExpOrStr | t.Tuple[ExpOrStr]) -> Bracket:
     904        return Bracket(
     905            this=self.copy(), expressions=[convert(e, copy=True) for e in ensure_list(other)]
     906        )
     907
     908    def __iter__(self) -> t.Iterator:
     909        if "expressions" in self.arg_types:
     910            return iter(self.args.get("expressions") or [])
     911        # We define this because __getitem__ converts Expression into an iterable, which is
     912        # problematic because one can hit infinite loops if they do "for x in some_expr: ..."
     913        # See: https://peps.python.org/pep-0234/
     914        raise TypeError(f"'{self.__class__.__name__}' object is not iterable")
     915
     916    def isin(
     917        self,
     918        *expressions: t.Any,
     919        query: t.Optional[ExpOrStr] = None,
     920        unnest: t.Optional[ExpOrStr] | t.Collection[ExpOrStr] = None,
     921        copy: bool = True,
     922        **opts,
     923    ) -> In:
     924        subquery = maybe_parse(query, copy=copy, **opts) if query else None
     925        if subquery and not isinstance(subquery, Subquery):
     926            subquery = subquery.subquery(copy=False)
     927
     928        return In(
     929            this=maybe_copy(self, copy),
     930            expressions=[convert(e, copy=copy) for e in expressions],
     931            query=subquery,
     932            unnest=(
     933                Unnest(
     934                    expressions=[
     935                        maybe_parse(t.cast(ExpOrStr, e), copy=copy, **opts)
     936                        for e in ensure_list(unnest)
     937                    ]
     938                )
     939                if unnest
     940                else None
     941            ),
     942        )
     943
     944    def between(
     945        self,
     946        low: t.Any,
     947        high: t.Any,
     948        copy: bool = True,
     949        symmetric: t.Optional[bool] = None,
     950        **opts,
     951    ) -> Between:
     952        between = Between(
     953            this=maybe_copy(self, copy),
     954            low=convert(low, copy=copy, **opts),
     955            high=convert(high, copy=copy, **opts),
     956        )
     957        if symmetric is not None:
     958            between.set("symmetric", symmetric)
     959
     960        return between
     961
     962    def is_(self, other: ExpOrStr) -> Is:
     963        return self._binop(Is, other)
     964
     965    def like(self, other: ExpOrStr) -> Like:
     966        return self._binop(Like, other)
     967
     968    def ilike(self, other: ExpOrStr) -> ILike:
     969        return self._binop(ILike, other)
     970
     971    def eq(self, other: t.Any) -> EQ:
     972        return self._binop(EQ, other)
     973
     974    def neq(self, other: t.Any) -> NEQ:
     975        return self._binop(NEQ, other)
     976
     977    def rlike(self, other: ExpOrStr) -> RegexpLike:
     978        return self._binop(RegexpLike, other)
     979
     980    def div(self, other: ExpOrStr, typed: bool = False, safe: bool = False) -> Div:
     981        div = self._binop(Div, other)
     982        div.args["typed"] = typed
     983        div.args["safe"] = safe
     984        return div
     985
     986    def asc(self, nulls_first: bool = True) -> Ordered:
     987        return Ordered(this=self.copy(), nulls_first=nulls_first)
     988
     989    def desc(self, nulls_first: bool = False) -> Ordered:
     990        return Ordered(this=self.copy(), desc=True, nulls_first=nulls_first)
     991
     992    def __lt__(self, other: t.Any) -> LT:
     993        return self._binop(LT, other)
     994
     995    def __le__(self, other: t.Any) -> LTE:
     996        return self._binop(LTE, other)
     997
     998    def __gt__(self, other: t.Any) -> GT:
     999        return self._binop(GT, other)
    1000
    1001    def __ge__(self, other: t.Any) -> GTE:
    1002        return self._binop(GTE, other)
    1003
    1004    def __add__(self, other: t.Any) -> Add:
    1005        return self._binop(Add, other)
    1006
    1007    def __radd__(self, other: t.Any) -> Add:
    1008        return self._binop(Add, other, reverse=True)
    1009
    1010    def __sub__(self, other: t.Any) -> Sub:
    1011        return self._binop(Sub, other)
    1012
    1013    def __rsub__(self, other: t.Any) -> Sub:
    1014        return self._binop(Sub, other, reverse=True)
    1015
    1016    def __mul__(self, other: t.Any) -> Mul:
    1017        return self._binop(Mul, other)
    1018
    1019    def __rmul__(self, other: t.Any) -> Mul:
    1020        return self._binop(Mul, other, reverse=True)
    1021
    1022    def __truediv__(self, other: t.Any) -> Div:
    1023        return self._binop(Div, other)
    1024
    1025    def __rtruediv__(self, other: t.Any) -> Div:
    1026        return self._binop(Div, other, reverse=True)
    1027
    1028    def __floordiv__(self, other: t.Any) -> IntDiv:
    1029        return self._binop(IntDiv, other)
    1030
    1031    def __rfloordiv__(self, other: t.Any) -> IntDiv:
    1032        return self._binop(IntDiv, other, reverse=True)
    1033
    1034    def __mod__(self, other: t.Any) -> Mod:
    1035        return self._binop(Mod, other)
    1036
    1037    def __rmod__(self, other: t.Any) -> Mod:
    1038        return self._binop(Mod, other, reverse=True)
    1039
    1040    def __pow__(self, other: t.Any) -> Pow:
    1041        return self._binop(Pow, other)
    1042
    1043    def __rpow__(self, other: t.Any) -> Pow:
    1044        return self._binop(Pow, other, reverse=True)
    1045
    1046    def __and__(self, other: t.Any) -> And:
    1047        return self._binop(And, other)
    1048
    1049    def __rand__(self, other: t.Any) -> And:
    1050        return self._binop(And, other, reverse=True)
    1051
    1052    def __or__(self, other: t.Any) -> Or:
    1053        return self._binop(Or, other)
    1054
    1055    def __ror__(self, other: t.Any) -> Or:
    1056        return self._binop(Or, other, reverse=True)
    1057
    1058    def __neg__(self) -> Neg:
    1059        return Neg(this=_wrap(self.copy(), Binary))
    1060
    1061    def __invert__(self) -> Not:
    1062        return not_(self.copy())

The base class for all expressions in a syntax tree. Each Expression encapsulates any necessary context, such as its child expressions, their names (arg keys), and whether a given child expression is optional or not.

###### Attributes:

- key: a unique key for each class in the Expression hierarchy. This is useful for hashing and representing expressions as strings.
- arg_types: determines the arguments (child nodes) supported by an expression. It maps arg keys to booleans that indicate whether the corresponding args are optional.
- parent: a reference to the parent expression (or None, in case of root expressions).
- arg_key: the arg key an expression is associated with, i.e. the name its parent expression uses to refer to it.
- index: the index of an expression if it is inside of a list argument in its parent.
- comments: a list of comments that are associated with a given expression. This is used in order to preserve comments when transpiling SQL code.
- type: the `sqlglot.expressions.DataType` type of an expression. This is inferred by the optimizer, in order to enable some transformations that require type information.
- meta: a dictionary that can be used to store useful metadata for a given expression.

###### Example:

>     >>> class Foo(Expression):
>     ...     arg_types = {"this": True, "expression": False}

> The above definition informs us that Foo is an Expression that requires an argument called "this" and may also optionally receive an argument called "expression".

###### Arguments:

- args: a mapping used for retrieving the arguments of an expression, given their arg keys.

Expression(**args: Any) View Source

    108    def __init__(self, **args: t.Any):
    109        self.args: t.Dict[str, t.Any] = args
    110        self.parent: t.Optional[Expression] = None
    111        self.arg_key: t.Optional[str] = None
    112        self.index: t.Optional[int] = None
    113        self.comments: t.Optional[t.List[str]] = None
    114        self._type: t.Optional[DataType] = None
    115        self._meta: t.Optional[t.Dict[str, t.Any]] = None
    116        self._hash: t.Optional[int] = None
    117
    118        for arg_key, value in self.args.items():
    119            self._set_parent(arg_key, value)

key = 'expression'
arg_types = {'this': True}
args: Dict[str, Any]
parent: Optional[Expression]
arg_key: Optional[str]
index: Optional[int]
comments: Optional[List[str]]
hashable_args: Any View Source

    124    @property
    125    def hashable_args(self) -> t.Any:
    126        return frozenset(
    127            (k, tuple(_norm_arg(a) for a in v) if type(v) is list else _norm_arg(v))
    128            for k, v in self.args.items()
    129            if not (v is None or v is False or (type(v) is list and not v))
    130        )

this: Any View Source

    143    @property
    144    def this(self) -> t.Any:
    145        """
    146        Retrieves the argument with key "this".
    147        """
    148        return self.args.get("this")

Retrieves the argument with key "this".

expression: Any View Source

    150    @property
    151    def expression(self) -> t.Any:
    152        """
    153        Retrieves the argument with key "expression".
    154        """
    155        return self.args.get("expression")

Retrieves the argument with key "expression".

expressions: List[Any] View Source

    157    @property
    158    def expressions(self) -> t.List[t.Any]:
    159        """
    160        Retrieves the argument with key "expressions".
    161        """
    162        return self.args.get("expressions") or []

Retrieves the argument with key "expressions".

def text(self, key) -> str: View Source

    164    def text(self, key) -> str:
    165        """
    166        Returns a textual representation of the argument corresponding to "key". This can only be used
    167        for args that are strings or leaf Expression instances, such as identifiers and literals.
    168        """
    169        field = self.args.get(key)
    170        if isinstance(field, str):
    171            return field
    172        if isinstance(field, (Identifier, Literal, Var)):
    173            return field.this
    174        if isinstance(field, (Star, Null)):
    175            return field.name
    176        return ""

Returns a textual representation of the argument corresponding to "key". This can only be used for args that are strings or leaf Expression instances, such as identifiers and literals.

is_string: bool View Source

    178    @property
    179    def is_string(self) -> bool:
    180        """
    181        Checks whether a Literal expression is a string.
    182        """
    183        return isinstance(self, Literal) and self.args["is_string"]

Checks whether a Literal expression is a string.

is_number: bool View Source

    185    @property
    186    def is_number(self) -> bool:
    187        """
    188        Checks whether a Literal expression is a number.
    189        """
    190        return (isinstance(self, Literal) and not self.args["is_string"]) or (
    191            isinstance(self, Neg) and self.this.is_number
    192        )

Checks whether a Literal expression is a number.

def to_py(self) -> Any: View Source

    194    def to_py(self) -> t.Any:
    195        """
    196        Returns a Python object equivalent of the SQL node.
    197        """
    198        raise ValueError(f"{self} cannot be converted to a Python object.")

Returns a Python object equivalent of the SQL node.

is_int: bool View Source

    200    @property
    201    def is_int(self) -> bool:
    202        """
    203        Checks whether an expression is an integer.
    204        """
    205        return self.is_number and isinstance(self.to_py(), int)

Checks whether an expression is an integer.

is_star: bool View Source

    207    @property
    208    def is_star(self) -> bool:
    209        """Checks whether an expression is a star."""
    210        return isinstance(self, Star) or (isinstance(self, Column) and isinstance(self.this, Star))

Checks whether an expression is a star.

alias: str View Source

    212    @property
    213    def alias(self) -> str:
    214        """
    215        Returns the alias of the expression, or an empty string if it's not aliased.
    216        """
    217        if isinstance(self.args.get("alias"), TableAlias):
    218            return self.args["alias"].name
    219        return self.text("alias")

Returns the alias of the expression, or an empty string if it's not aliased.

alias_column_names: List[str] View Source

    221    @property
    222    def alias_column_names(self) -> t.List[str]:
    223        table_alias = self.args.get("alias")
    224        if not table_alias:
    225            return []
    226        return [c.name for c in table_alias.args.get("columns") or []]

name: str View Source

    228    @property
    229    def name(self) -> str:
    230        return self.text("this")

alias_or_name: str View Source

    232    @property
    233    def alias_or_name(self) -> str:
    234        return self.alias or self.name

output_name: str View Source

    236    @property
    237    def output_name(self) -> str:
    238        """
    239        Name of the output column if this expression is a selection.
    240
    241        If the Expression has no output name, an empty string is returned.
    242
    243        Example:
    244            >>> from sqlglot import parse_one
    245            >>> parse_one("SELECT a").expressions[0].output_name
    246            'a'
    247            >>> parse_one("SELECT b AS c").expressions[0].output_name
    248            'c'
    249            >>> parse_one("SELECT 1 + 2").expressions[0].output_name
    250            ''
    251        """
    252        return ""

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

type: Optional[DataType] View Source

    254    @property
    255    def type(self) -> t.Optional[DataType]:
    256        return self._type

def is_type(self, *dtypes) -> bool: View Source

    264    def is_type(self, *dtypes) -> bool:
    265        return self.type is not None and self.type.is_type(*dtypes)

def is_leaf(self) -> bool: View Source

    267    def is_leaf(self) -> bool:
    268        return not any(isinstance(v, (Expression, list)) and v for v in self.args.values())

meta: Dict[str, Any] View Source

    270    @property
    271    def meta(self) -> t.Dict[str, t.Any]:
    272        if self._meta is None:
    273            self._meta = {}
    274        return self._meta

def copy(self) -> typing_extensions.Self: View Source

    310    def copy(self) -> Self:
    311        """
    312        Returns a deep copy of the expression.
    313        """
    314        return deepcopy(self)

Returns a deep copy of the expression.

def add_comments( self, comments: Optional[List[str]] = None, prepend: bool = False) -> None: View Source

    316    def add_comments(self, comments: t.Optional[t.List[str]] = None, prepend: bool = False) -> None:
    317        if self.comments is None:
    318            self.comments = []
    319
    320        if comments:
    321            for comment in comments:
    322                _, *meta = comment.split(SQLGLOT_META)
    323                if meta:
    324                    for kv in "".join(meta).split(","):
    325                        k, *v = kv.split("=")
    326                        value = v[0].strip() if v else True
    327                        self.meta[k.strip()] = to_bool(value)
    328
    329                if not prepend:
    330                    self.comments.append(comment)
    331
    332            if prepend:
    333                self.comments = comments + self.comments

def pop_comments(self) -> List[str]: View Source

    335    def pop_comments(self) -> t.List[str]:
    336        comments = self.comments or []
    337        self.comments = None
    338        return comments

def append(self, arg_key: str, value: Any) -> None: View Source

    340    def append(self, arg_key: str, value: t.Any) -> None:
    341        """
    342        Appends value to arg_key if it's a list or sets it as a new list.
    343
    344        Args:
    345            arg_key (str): name of the list expression arg
    346            value (Any): value to append to the list
    347        """
    348        if type(self.args.get(arg_key)) is not list:
    349            self.args[arg_key] = []
    350        self._set_parent(arg_key, value)
    351        values = self.args[arg_key]
    352        if hasattr(value, "parent"):
    353            value.index = len(values)
    354        values.append(value)

Appends value to arg_key if it's a list or sets it as a new list.

###### Arguments:

- arg_key (str): name of the list expression arg
- value (Any): value to append to the list

def set( self, arg_key: str, value: Any, index: Optional[int] = None, overwrite: bool = True) -> None: View Source

    356    def set(
    357        self,
    358        arg_key: str,
    359        value: t.Any,
    360        index: t.Optional[int] = None,
    361        overwrite: bool = True,
    362    ) -> None:
    363        """
    364        Sets arg_key to value.
    365
    366        Args:
    367            arg_key: name of the expression arg.
    368            value: value to set the arg to.
    369            index: if the arg is a list, this specifies what position to add the value in it.
    370            overwrite: assuming an index is given, this determines whether to overwrite the
    371                list entry instead of only inserting a new value (i.e., like list.insert).
    372        """
    373        if index is not None:
    374            expressions = self.args.get(arg_key) or []
    375
    376            if seq_get(expressions, index) is None:
    377                return
    378            if value is None:
    379                expressions.pop(index)
    380                for v in expressions[index:]:
    381                    v.index = v.index - 1
    382                return
    383
    384            if isinstance(value, list):
    385                expressions.pop(index)
    386                expressions[index:index] = value
    387            elif overwrite:
    388                expressions[index] = value
    389            else:
    390                expressions.insert(index, value)
    391
    392            value = expressions
    393        elif value is None:
    394            self.args.pop(arg_key, None)
    395            return
    396
    397        self.args[arg_key] = value
    398        self._set_parent(arg_key, value, index)

Sets arg_key to value.

###### Arguments:

- arg_key: name of the expression arg.
- value: value to set the arg to.
- index: if the arg is a list, this specifies what position to add the value in it.
- overwrite: assuming an index is given, this determines whether to overwrite the list entry instead of only inserting a new value (i.e., like list.insert).

depth: int View Source

    412    @property
    413    def depth(self) -> int:
    414        """
    415        Returns the depth of this tree.
    416        """
    417        if self.parent:
    418            return self.parent.depth + 1
    419        return 0

Returns the depth of this tree.

def iter_expressions(self, reverse: bool = False) -> Iterator[Expression]: View Source

    421    def iter_expressions(self, reverse: bool = False) -> t.Iterator[Expression]:
    422        """Yields the key and expression for all arguments, exploding list args."""
    423        for vs in reversed(self.args.values()) if reverse else self.args.values():  # type: ignore
    424            if type(vs) is list:
    425                for v in reversed(vs) if reverse else vs:  # type: ignore
    426                    if hasattr(v, "parent"):
    427                        yield v
    428            else:
    429                if hasattr(vs, "parent"):
    430                    yield vs

Yields the key and expression for all arguments, exploding list args.

def find(self, *expression_types: Type[~E], bfs: bool = True) -> Optional[~E]: View Source

    432    def find(self, *expression_types: t.Type[E], bfs: bool = True) -> t.Optional[E]:
    433        """
    434        Returns the first node in this tree which matches at least one of
    435        the specified types.
    436
    437        Args:
    438            expression_types: the expression type(s) to match.
    439            bfs: whether to search the AST using the BFS algorithm (DFS is used if false).
    440
    441        Returns:
    442            The node which matches the criteria or None if no such node was found.
    443        """
    444        return next(self.find_all(*expression_types, bfs=bfs), None)

Returns the first node in this tree which matches at least one of the specified types.

###### Arguments:

- expression_types: the expression type(s) to match.
- bfs: whether to search the AST using the BFS algorithm (DFS is used if false).

###### Returns:

> The node which matches the criteria or None if no such node was found.

def find_all(self, *expression_types: Type[~E], bfs: bool = True) -> Iterator[~E]: View Source

    446    def find_all(self, *expression_types: t.Type[E], bfs: bool = True) -> t.Iterator[E]:
    447        """
    448        Returns a generator object which visits all nodes in this tree and only
    449        yields those that match at least one of the specified expression types.
    450
    451        Args:
    452            expression_types: the expression type(s) to match.
    453            bfs: whether to search the AST using the BFS algorithm (DFS is used if false).
    454
    455        Returns:
    456            The generator object.
    457        """
    458        for expression in self.walk(bfs=bfs):
    459            if isinstance(expression, expression_types):
    460                yield expression

Returns a generator object which visits all nodes in this tree and only yields those that match at least one of the specified expression types.

###### Arguments:

- expression_types: the expression type(s) to match.
- bfs: whether to search the AST using the BFS algorithm (DFS is used if false).

###### Returns:

> The generator object.

def find_ancestor(self, *expression_types: Type[~E]) -> Optional[~E]: View Source

    462    def find_ancestor(self, *expression_types: t.Type[E]) -> t.Optional[E]:
    463        """
    464        Returns a nearest parent matching expression_types.
    465
    466        Args:
    467            expression_types: the expression type(s) to match.
    468
    469        Returns:
    470            The parent node.
    471        """
    472        ancestor = self.parent
    473        while ancestor and not isinstance(ancestor, expression_types):
    474            ancestor = ancestor.parent
    475        return ancestor  # type: ignore

Returns a nearest parent matching expression_types.

###### Arguments:

- expression_types: the expression type(s) to match.

###### Returns:

> The parent node.

parent_select: Optional[Select] View Source

    477    @property
    478    def parent_select(self) -> t.Optional[Select]:
    479        """
    480        Returns the parent select statement.
    481        """
    482        return self.find_ancestor(Select)

Returns the parent select statement.

same_parent: bool View Source

    484    @property
    485    def same_parent(self) -> bool:
    486        """Returns if the parent is the same class as itself."""
    487        return type(self.parent) is self.__class__

Returns if the parent is the same class as itself.

def root(self) -> Expression: View Source

    489    def root(self) -> Expression:
    490        """
    491        Returns the root expression of this tree.
    492        """
    493        expression = self
    494        while expression.parent:
    495            expression = expression.parent
    496        return expression

Returns the root expression of this tree.

def walk( self, bfs: bool = True, prune: Optional[Callable[[Expression], bool]] = None) -> Iterator[Expression]: View Source

    498    def walk(
    499        self, bfs: bool = True, prune: t.Optional[t.Callable[[Expression], bool]] = None
    500    ) -> t.Iterator[Expression]:
    501        """
    502        Returns a generator object which visits all nodes in this tree.
    503
    504        Args:
    505            bfs: if set to True the BFS traversal order will be applied,
    506                otherwise the DFS traversal will be used instead.
    507            prune: callable that returns True if the generator should stop traversing
    508                this branch of the tree.
    509
    510        Returns:
    511            the generator object.
    512        """
    513        if bfs:
    514            yield from self.bfs(prune=prune)
    515        else:
    516            yield from self.dfs(prune=prune)

Returns a generator object which visits all nodes in this tree.

###### Arguments:

- bfs: if set to True the BFS traversal order will be applied, otherwise the DFS traversal will be used instead.
- prune: callable that returns True if the generator should stop traversing this branch of the tree.

###### Returns:

> the generator object.

def dfs( self, prune: Optional[Callable[[Expression], bool]] = None) -> Iterator[Expression]: View Source

    518    def dfs(
    519        self, prune: t.Optional[t.Callable[[Expression], bool]] = None
    520    ) -> t.Iterator[Expression]:
    521        """
    522        Returns a generator object which visits all nodes in this tree in
    523        the DFS (Depth-first) order.
    524
    525        Returns:
    526            The generator object.
    527        """
    528        stack = [self]
    529
    530        while stack:
    531            node = stack.pop()
    532
    533            yield node
    534
    535            if prune and prune(node):
    536                continue
    537
    538            for v in node.iter_expressions(reverse=True):
    539                stack.append(v)

Returns a generator object which visits all nodes in this tree in the DFS (Depth-first) order.

###### Returns:

> The generator object.

def bfs( self, prune: Optional[Callable[[Expression], bool]] = None) -> Iterator[Expression]: View Source

    541    def bfs(
    542        self, prune: t.Optional[t.Callable[[Expression], bool]] = None
    543    ) -> t.Iterator[Expression]:
    544        """
    545        Returns a generator object which visits all nodes in this tree in
    546        the BFS (Breadth-first) order.
    547
    548        Returns:
    549            The generator object.
    550        """
    551        queue = deque([self])
    552
    553        while queue:
    554            node = queue.popleft()
    555
    556            yield node
    557
    558            if prune and prune(node):
    559                continue
    560
    561            for v in node.iter_expressions():
    562                queue.append(v)

Returns a generator object which visits all nodes in this tree in the BFS (Breadth-first) order.

###### Returns:

> The generator object.

def unnest(self): View Source

    564    def unnest(self):
    565        """
    566        Returns the first non parenthesis child or self.
    567        """
    568        expression = self
    569        while type(expression) is Paren:
    570            expression = expression.this
    571        return expression

Returns the first non parenthesis child or self.

def unalias(self): View Source

    573    def unalias(self):
    574        """
    575        Returns the inner expression if this is an Alias.
    576        """
    577        if isinstance(self, Alias):
    578            return self.this
    579        return self

Returns the inner expression if this is an Alias.

def unnest_operands(self): View Source

    581    def unnest_operands(self):
    582        """
    583        Returns unnested operands as a tuple.
    584        """
    585        return tuple(arg.unnest() for arg in self.iter_expressions())

Returns unnested operands as a tuple.

def flatten(self, unnest=True): View Source

    587    def flatten(self, unnest=True):
    588        """
    589        Returns a generator which yields child nodes whose parents are the same class.
    590
    591        A AND B AND C -> [A, B, C]
    592        """
    593        for node in self.dfs(prune=lambda n: n.parent and type(n) is not self.__class__):
    594            if type(node) is not self.__class__:
    595                yield node.unnest() if unnest and not isinstance(node, Subquery) else node

Returns a generator which yields child nodes whose parents are the same class.

A AND B AND C -> [A, B, C]

def to_s(self) -> str: View Source

    603    def to_s(self) -> str:
    604        """
    605        Same as __repr__, but includes additional information which can be useful
    606        for debugging, like empty or missing args and the AST nodes' object IDs.
    607        """
    608        return _to_s(self, verbose=True)

Same as __repr__, but includes additional information which can be useful for debugging, like empty or missing args and the AST nodes' object IDs.

def sql( self, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **opts) -> str: View Source

    610    def sql(self, dialect: DialectType = None, **opts) -> str:
    611        """
    612        Returns SQL string representation of this tree.
    613
    614        Args:
    615            dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").
    616            opts: other `sqlglot.generator.Generator` options.
    617
    618        Returns:
    619            The SQL string.
    620        """
    621        from sqlglot.dialects import Dialect
    622
    623        return Dialect.get_or_raise(dialect).generate(self, **opts)

Returns SQL string representation of this tree.

###### Arguments:

- dialect: the dialect of the output SQL string (eg. "spark", "hive", "presto", "mysql").
- opts: other `sqlglot.generator.Generator` options.

###### Returns:

> The SQL string.

def transform( self, fun: Callable, *args: Any, copy: bool = True, **kwargs) -> Expression: View Source

    625    def transform(self, fun: t.Callable, *args: t.Any, copy: bool = True, **kwargs) -> Expression:
    626        """
    627        Visits all tree nodes (excluding already transformed ones)
    628        and applies the given transformation function to each node.
    629
    630        Args:
    631            fun: a function which takes a node as an argument and returns a
    632                new transformed node or the same node without modifications. If the function
    633                returns None, then the corresponding node will be removed from the syntax tree.
    634            copy: if set to True a new tree instance is constructed, otherwise the tree is
    635                modified in place.
    636
    637        Returns:
    638            The transformed tree.
    639        """
    640        root = None
    641        new_node = None
    642
    643        for node in (self.copy() if copy else self).dfs(prune=lambda n: n is not new_node):
    644            parent, arg_key, index = node.parent, node.arg_key, node.index
    645            new_node = fun(node, *args, **kwargs)
    646
    647            if not root:
    648                root = new_node
    649            elif parent and arg_key and new_node is not node:
    650                parent.set(arg_key, new_node, index)
    651
    652        assert root
    653        return root.assert_is(Expression)

Visits all tree nodes (excluding already transformed ones) and applies the given transformation function to each node.

###### Arguments:

- fun: a function which takes a node as an argument and returns a new transformed node or the same node without modifications. If the function returns None, then the corresponding node will be removed from the syntax tree.
- copy: if set to True a new tree instance is constructed, otherwise the tree is modified in place.

###### Returns:

> The transformed tree.

def replace(self, expression): View Source

    661    def replace(self, expression):
    662        """
    663        Swap out this expression with a new expression.
    664
    665        For example::
    666
    667            >>> tree = Select().select("x").from_("tbl")
    668            >>> tree.find(Column).replace(column("y"))
    669            Column(
    670              this=Identifier(this=y, quoted=False))
    671            >>> tree.sql()
    672            'SELECT y FROM tbl'
    673
    674        Args:
    675            expression: new node
    676
    677        Returns:
    678            The new expression or expressions.
    679        """
    680        parent = self.parent
    681
    682        if not parent or parent is expression:
    683            return expression
    684
    685        key = self.arg_key
    686        value = parent.args.get(key)
    687
    688        if type(expression) is list and isinstance(value, Expression):
    689            # We are trying to replace an Expression with a list, so it's assumed that
    690            # the intention was to really replace the parent of this expression.
    691            value.parent.replace(expression)
    692        else:
    693            parent.set(key, expression, self.index)
    694
    695        if expression is not self:
    696            self.parent = None
    697            self.arg_key = None
    698            self.index = None
    699
    700        return expression

Swap out this expression with a new expression.

For example::

    >>> tree = Select().select("x").from_("tbl")
    >>> tree.find(Column).replace(column("y"))
    Column(
      this=Identifier(this=y, quoted=False))
    >>> tree.sql()
    'SELECT y FROM tbl'

###### Arguments:

- expression: new node

###### Returns:

> The new expression or expressions.

def pop(self: ~E) -> ~E: View Source

    702    def pop(self: E) -> E:
    703        """
    704        Remove this expression from its AST.
    705
    706        Returns:
    707            The popped expression.
    708        """
    709        self.replace(None)
    710        return self

Remove this expression from its AST.

###### Returns:

> The popped expression.

def assert_is(self, type_: Type[~E]) -> ~E: View Source

    712    def assert_is(self, type_: t.Type[E]) -> E:
    713        """
    714        Assert that this `Expression` is an instance of `type_`.
    715
    716        If it is NOT an instance of `type_`, this raises an assertion error.
    717        Otherwise, this returns this expression.
    718
    719        Examples:
    720            This is useful for type security in chained expressions:
    721
    722            >>> import sqlglot
    723            >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()
    724            'SELECT x, z FROM y'
    725        """
    726        if not isinstance(self, type_):
    727            raise AssertionError(f"{self} is not {type_}.")
    728        return self

Assert that this `Expression` is an instance of `type_`.

If it is NOT an instance of `type_`, this raises an assertion error. Otherwise, this returns this expression.

###### Examples:

> This is useful for type security in chained expressions:

>     >>> import sqlglot
>     >>> sqlglot.parse_one("SELECT x from y").assert_is(Select).select("z").sql()
>     'SELECT x, z FROM y'

def error_messages(self, args: Optional[Sequence] = None) -> List[str]: View Source

    730    def error_messages(self, args: t.Optional[t.Sequence] = None) -> t.List[str]:
    731        """
    732        Checks if this expression is valid (e.g. all mandatory args are set).
    733
    734        Args:
    735            args: a sequence of values that were used to instantiate a Func expression. This is used
    736                to check that the provided arguments don't exceed the function argument limit.
    737
    738        Returns:
    739            A list of error messages for all possible errors that were found.
    740        """
    741        errors: t.List[str] = []
    742
    743        for k in self.args:
    744            if k not in self.arg_types:
    745                errors.append(f"Unexpected keyword: '{k}' for {self.__class__}")
    746        for k, mandatory in self.arg_types.items():
    747            v = self.args.get(k)
    748            if mandatory and (v is None or (isinstance(v, list) and not v)):
    749                errors.append(f"Required keyword: '{k}' missing for {self.__class__}")
    750
    751        if (
    752            args
    753            and isinstance(self, Func)
    754            and len(args) > len(self.arg_types)
    755            and not self.is_var_len_args
    756        ):
    757            errors.append(
    758                f"The number of provided arguments ({len(args)}) is greater than "
    759                f"the maximum number of supported arguments ({len(self.arg_types)})"
    760            )
    761
    762        return errors

Checks if this expression is valid (e.g. all mandatory args are set).

###### Arguments:

- args: a sequence of values that were used to instantiate a Func expression. This is used to check that the provided arguments don't exceed the function argument limit.

###### Returns:

> A list of error messages for all possible errors that were found.

def dump(self): View Source

    764    def dump(self):
    765        """
    766        Dump this Expression to a JSON-serializable dict.
    767        """
    768        from sqlglot.serde import dump
    769
    770        return dump(self)

Dump this Expression to a JSON-serializable dict.

@classmethod
def load(cls, obj): View Source

    772    @classmethod
    773    def load(cls, obj):
    774        """
    775        Load a dict (as returned by `Expression.dump`) into an Expression instance.
    776        """
    777        from sqlglot.serde import load
    778
    779        return load(obj)

Load a dict (as returned by `Expression.dump`) into an Expression instance.

def and_( self, *expressions: Union[str, Expression, NoneType], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, wrap: bool = True, **opts) -> Condition: View Source

    781    def and_(
    782        self,
    783        *expressions: t.Optional[ExpOrStr],
    784        dialect: DialectType = None,
    785        copy: bool = True,
    786        wrap: bool = True,
    787        **opts,
    788    ) -> Condition:
    789        """
    790        AND this condition with one or multiple expressions.
    791
    792        Example:
    793            >>> condition("x=1").and_("y=1").sql()
    794            'x = 1 AND y = 1'
    795
    796        Args:
    797            *expressions: the SQL code strings to parse.
    798                If an `Expression` instance is passed, it will be used as-is.
    799            dialect: the dialect used to parse the input expression.
    800            copy: whether to copy the involved expressions (only applies to Expressions).
    801            wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
    802                precedence issues, but can be turned off when the produced AST is too deep and
    803                causes recursion-related issues.
    804            opts: other options to use to parse the input expressions.
    805
    806        Returns:
    807            The new And condition.
    808        """
    809        return and_(self, *expressions, dialect=dialect, copy=copy, wrap=wrap, **opts)

AND this condition with one or multiple expressions.

###### Example:

>     >>> condition("x=1").and_("y=1").sql()
>     'x = 1 AND y = 1'

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is.
- dialect: the dialect used to parse the input expression.
- copy: whether to copy the involved expressions (only applies to Expressions).
- wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid precedence issues, but can be turned off when the produced AST is too deep and causes recursion-related issues.
- opts: other options to use to parse the input expressions.

###### Returns:

> The new And condition.

def or_( self, *expressions: Union[str, Expression, NoneType], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, wrap: bool = True, **opts) -> Condition: View Source

    811    def or_(
    812        self,
    813        *expressions: t.Optional[ExpOrStr],
    814        dialect: DialectType = None,
    815        copy: bool = True,
    816        wrap: bool = True,
    817        **opts,
    818    ) -> Condition:
    819        """
    820        OR this condition with one or multiple expressions.
    821
    822        Example:
    823            >>> condition("x=1").or_("y=1").sql()
    824            'x = 1 OR y = 1'
    825
    826        Args:
    827            *expressions: the SQL code strings to parse.
    828                If an `Expression` instance is passed, it will be used as-is.
    829            dialect: the dialect used to parse the input expression.
    830            copy: whether to copy the involved expressions (only applies to Expressions).
    831            wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
    832                precedence issues, but can be turned off when the produced AST is too deep and
    833                causes recursion-related issues.
    834            opts: other options to use to parse the input expressions.
    835
    836        Returns:
    837            The new Or condition.
    838        """
    839        return or_(self, *expressions, dialect=dialect, copy=copy, wrap=wrap, **opts)

OR this condition with one or multiple expressions.

###### Example:

>     >>> condition("x=1").or_("y=1").sql()
>     'x = 1 OR y = 1'

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is.
- dialect: the dialect used to parse the input expression.
- copy: whether to copy the involved expressions (only applies to Expressions).
- wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid precedence issues, but can be turned off when the produced AST is too deep and causes recursion-related issues.
- opts: other options to use to parse the input expressions.

###### Returns:

> The new Or condition.

def not_(self, copy: bool = True): View Source

    841    def not_(self, copy: bool = True):
    842        """
    843        Wrap this condition with NOT.
    844
    845        Example:
    846            >>> condition("x=1").not_().sql()
    847            'NOT x = 1'
    848
    849        Args:
    850            copy: whether to copy this object.
    851
    852        Returns:
    853            The new Not instance.
    854        """
    855        return not_(self, copy=copy)

Wrap this condition with NOT.

###### Example:

>     >>> condition("x=1").not_().sql()
>     'NOT x = 1'

###### Arguments:

- copy: whether to copy this object.

###### Returns:

> The new Not instance.

def update_positions( self: ~E, other: Union[sqlglot.tokens.Token, Expression, NoneType] = None, **kwargs: Any) -> ~E: View Source

    857    def update_positions(
    858        self: E, other: t.Optional[Token | Expression] = None, **kwargs: t.Any
    859    ) -> E:
    860        """
    861        Update this expression with positions from a token or other expression.
    862
    863        Args:
    864            other: a token or expression to update this expression with.
    865
    866        Returns:
    867            The updated expression.
    868        """
    869        if isinstance(other, Expression):
    870            self.meta.update({k: v for k, v in other.meta.items() if k in POSITION_META_KEYS})
    871        elif other is not None:
    872            self.meta.update(
    873                {
    874                    "line": other.line,
    875                    "col": other.col,
    876                    "start": other.start,
    877                    "end": other.end,
    878                }
    879            )
    880        self.meta.update({k: v for k, v in kwargs.items() if k in POSITION_META_KEYS})
    881        return self

Update this expression with positions from a token or other expression.

###### Arguments:

- other: a token or expression to update this expression with.

###### Returns:

> The updated expression.

def as_( self, alias: str | Identifier, quoted: Optional[bool] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Alias: View Source

    883    def as_(
    884        self,
    885        alias: str | Identifier,
    886        quoted: t.Optional[bool] = None,
    887        dialect: DialectType = None,
    888        copy: bool = True,
    889        **opts,
    890    ) -> Alias:
    891        return alias_(self, alias, quoted=quoted, dialect=dialect, copy=copy, **opts)

def isin( self, *expressions: Any, query: Union[str, Expression, NoneType] = None, unnest: Union[str, Expression, NoneType, Collection[Union[str, Expression]]] = None, copy: bool = True, **opts) -> In: View Source

    916    def isin(
    917        self,
    918        *expressions: t.Any,
    919        query: t.Optional[ExpOrStr] = None,
    920        unnest: t.Optional[ExpOrStr] | t.Collection[ExpOrStr] = None,
    921        copy: bool = True,
    922        **opts,
    923    ) -> In:
    924        subquery = maybe_parse(query, copy=copy, **opts) if query else None
    925        if subquery and not isinstance(subquery, Subquery):
    926            subquery = subquery.subquery(copy=False)
    927
    928        return In(
    929            this=maybe_copy(self, copy),
    930            expressions=[convert(e, copy=copy) for e in expressions],
    931            query=subquery,
    932            unnest=(
    933                Unnest(
    934                    expressions=[
    935                        maybe_parse(t.cast(ExpOrStr, e), copy=copy, **opts)
    936                        for e in ensure_list(unnest)
    937                    ]
    938                )
    939                if unnest
    940                else None
    941            ),
    942        )

def between( self, low: Any, high: Any, copy: bool = True, symmetric: Optional[bool] = None, **opts) -> Between: View Source

    944    def between(
    945        self,
    946        low: t.Any,
    947        high: t.Any,
    948        copy: bool = True,
    949        symmetric: t.Optional[bool] = None,
    950        **opts,
    951    ) -> Between:
    952        between = Between(
    953            this=maybe_copy(self, copy),
    954            low=convert(low, copy=copy, **opts),
    955            high=convert(high, copy=copy, **opts),
    956        )
    957        if symmetric is not None:
    958            between.set("symmetric", symmetric)
    959
    960        return between

def is_( self, other: Union[str, Expression]) -> Is: View Source

    962    def is_(self, other: ExpOrStr) -> Is:
    963        return self._binop(Is, other)

def like( self, other: Union[str, Expression]) -> Like: View Source

    965    def like(self, other: ExpOrStr) -> Like:
    966        return self._binop(Like, other)

def ilike( self, other: Union[str, Expression]) -> ILike: View Source

    968    def ilike(self, other: ExpOrStr) -> ILike:
    969        return self._binop(ILike, other)

def eq(self, other: Any) -> EQ: View Source

    971    def eq(self, other: t.Any) -> EQ:
    972        return self._binop(EQ, other)

def neq(self, other: Any) -> NEQ: View Source

    974    def neq(self, other: t.Any) -> NEQ:
    975        return self._binop(NEQ, other)

def rlike( self, other: Union[str, Expression]) -> RegexpLike: View Source

    977    def rlike(self, other: ExpOrStr) -> RegexpLike:
    978        return self._binop(RegexpLike, other)

def div( self, other: Union[str, Expression], typed: bool = False, safe: bool = False) -> Div: View Source

    980    def div(self, other: ExpOrStr, typed: bool = False, safe: bool = False) -> Div:
    981        div = self._binop(Div, other)
    982        div.args["typed"] = typed
    983        div.args["safe"] = safe
    984        return div

def asc(self, nulls_first: bool = True) -> Ordered: View Source

    986    def asc(self, nulls_first: bool = True) -> Ordered:
    987        return Ordered(this=self.copy(), nulls_first=nulls_first)

def desc(self, nulls_first: bool = False) -> Ordered: View Source

    989    def desc(self, nulls_first: bool = False) -> Ordered:
    990        return Ordered(this=self.copy(), desc=True, nulls_first=nulls_first)

IntoType = typing.Union[str, typing.Type[Expression], typing.Collection[typing.Union[str, typing.Type[Expression]]]]
ExpOrStr = typing.Union[str, Expression]
class Condition(Expression): View Source

    1073class Condition(Expression):
    1074    """Logical conditions like x AND y, or simply x"""

Logical conditions like x AND y, or simply x

key = 'condition'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Predicate(Condition): View Source

    1077class Predicate(Condition):
    1078    """Relationships like x = y, x > 1, x >= y."""

Relationships like x = y, x > 1, x >= y.

key = 'predicate'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DerivedTable(Expression): View Source

    1081class DerivedTable(Expression):
    1082    @property
    1083    def selects(self) -> t.List[Expression]:
    1084        return self.this.selects if isinstance(self.this, Query) else []
    1085
    1086    @property
    1087    def named_selects(self) -> t.List[str]:
    1088        return [select.output_name for select in self.selects]

selects: List[Expression] View Source

    1082    @property
    1083    def selects(self) -> t.List[Expression]:
    1084        return self.this.selects if isinstance(self.this, Query) else []

named_selects: List[str] View Source

    1086    @property
    1087    def named_selects(self) -> t.List[str]:
    1088        return [select.output_name for select in self.selects]

key = 'derivedtable'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Query(Expression): View Source

    1091class Query(Expression):
    1092    def subquery(self, alias: t.Optional[ExpOrStr] = None, copy: bool = True) -> Subquery:
    1093        """
    1094        Returns a `Subquery` that wraps around this query.
    1095
    1096        Example:
    1097            >>> subquery = Select().select("x").from_("tbl").subquery()
    1098            >>> Select().select("x").from_(subquery).sql()
    1099            'SELECT x FROM (SELECT x FROM tbl)'
    1100
    1101        Args:
    1102            alias: an optional alias for the subquery.
    1103            copy: if `False`, modify this expression instance in-place.
    1104        """
    1105        instance = maybe_copy(self, copy)
    1106        if not isinstance(alias, Expression):
    1107            alias = TableAlias(this=to_identifier(alias)) if alias else None
    1108
    1109        return Subquery(this=instance, alias=alias)
    1110
    1111    def limit(
    1112        self: Q, expression: ExpOrStr | int, dialect: DialectType = None, copy: bool = True, **opts
    1113    ) -> Q:
    1114        """
    1115        Adds a LIMIT clause to this query.
    1116
    1117        Example:
    1118            >>> select("1").union(select("1")).limit(1).sql()
    1119            'SELECT 1 UNION SELECT 1 LIMIT 1'
    1120
    1121        Args:
    1122            expression: the SQL code string to parse.
    1123                This can also be an integer.
    1124                If a `Limit` instance is passed, it will be used as-is.
    1125                If another `Expression` instance is passed, it will be wrapped in a `Limit`.
    1126            dialect: the dialect used to parse the input expression.
    1127            copy: if `False`, modify this expression instance in-place.
    1128            opts: other options to use to parse the input expressions.
    1129
    1130        Returns:
    1131            A limited Select expression.
    1132        """
    1133        return _apply_builder(
    1134            expression=expression,
    1135            instance=self,
    1136            arg="limit",
    1137            into=Limit,
    1138            prefix="LIMIT",
    1139            dialect=dialect,
    1140            copy=copy,
    1141            into_arg="expression",
    1142            **opts,
    1143        )
    1144
    1145    def offset(
    1146        self: Q, expression: ExpOrStr | int, dialect: DialectType = None, copy: bool = True, **opts
    1147    ) -> Q:
    1148        """
    1149        Set the OFFSET expression.
    1150
    1151        Example:
    1152            >>> Select().from_("tbl").select("x").offset(10).sql()
    1153            'SELECT x FROM tbl OFFSET 10'
    1154
    1155        Args:
    1156            expression: the SQL code string to parse.
    1157                This can also be an integer.
    1158                If a `Offset` instance is passed, this is used as-is.
    1159                If another `Expression` instance is passed, it will be wrapped in a `Offset`.
    1160            dialect: the dialect used to parse the input expression.
    1161            copy: if `False`, modify this expression instance in-place.
    1162            opts: other options to use to parse the input expressions.
    1163
    1164        Returns:
    1165            The modified Select expression.
    1166        """
    1167        return _apply_builder(
    1168            expression=expression,
    1169            instance=self,
    1170            arg="offset",
    1171            into=Offset,
    1172            prefix="OFFSET",
    1173            dialect=dialect,
    1174            copy=copy,
    1175            into_arg="expression",
    1176            **opts,
    1177        )
    1178
    1179    def order_by(
    1180        self: Q,
    1181        *expressions: t.Optional[ExpOrStr],
    1182        append: bool = True,
    1183        dialect: DialectType = None,
    1184        copy: bool = True,
    1185        **opts,
    1186    ) -> Q:
    1187        """
    1188        Set the ORDER BY expression.
    1189
    1190        Example:
    1191            >>> Select().from_("tbl").select("x").order_by("x DESC").sql()
    1192            'SELECT x FROM tbl ORDER BY x DESC'
    1193
    1194        Args:
    1195            *expressions: the SQL code strings to parse.
    1196                If a `Group` instance is passed, this is used as-is.
    1197                If another `Expression` instance is passed, it will be wrapped in a `Order`.
    1198            append: if `True`, add to any existing expressions.
    1199                Otherwise, this flattens all the `Order` expression into a single expression.
    1200            dialect: the dialect used to parse the input expression.
    1201            copy: if `False`, modify this expression instance in-place.
    1202            opts: other options to use to parse the input expressions.
    1203
    1204        Returns:
    1205            The modified Select expression.
    1206        """
    1207        return _apply_child_list_builder(
    1208            *expressions,
    1209            instance=self,
    1210            arg="order",
    1211            append=append,
    1212            copy=copy,
    1213            prefix="ORDER BY",
    1214            into=Order,
    1215            dialect=dialect,
    1216            **opts,
    1217        )
    1218
    1219    @property
    1220    def ctes(self) -> t.List[CTE]:
    1221        """Returns a list of all the CTEs attached to this query."""
    1222        with_ = self.args.get("with")
    1223        return with_.expressions if with_ else []
    1224
    1225    @property
    1226    def selects(self) -> t.List[Expression]:
    1227        """Returns the query's projections."""
    1228        raise NotImplementedError("Query objects must implement `selects`")
    1229
    1230    @property
    1231    def named_selects(self) -> t.List[str]:
    1232        """Returns the output names of the query's projections."""
    1233        raise NotImplementedError("Query objects must implement `named_selects`")
    1234
    1235    def select(
    1236        self: Q,
    1237        *expressions: t.Optional[ExpOrStr],
    1238        append: bool = True,
    1239        dialect: DialectType = None,
    1240        copy: bool = True,
    1241        **opts,
    1242    ) -> Q:
    1243        """
    1244        Append to or set the SELECT expressions.
    1245
    1246        Example:
    1247            >>> Select().select("x", "y").sql()
    1248            'SELECT x, y'
    1249
    1250        Args:
    1251            *expressions: the SQL code strings to parse.
    1252                If an `Expression` instance is passed, it will be used as-is.
    1253            append: if `True`, add to any existing expressions.
    1254                Otherwise, this resets the expressions.
    1255            dialect: the dialect used to parse the input expressions.
    1256            copy: if `False`, modify this expression instance in-place.
    1257            opts: other options to use to parse the input expressions.
    1258
    1259        Returns:
    1260            The modified Query expression.
    1261        """
    1262        raise NotImplementedError("Query objects must implement `select`")
    1263
    1264    def where(
    1265        self: Q,
    1266        *expressions: t.Optional[ExpOrStr],
    1267        append: bool = True,
    1268        dialect: DialectType = None,
    1269        copy: bool = True,
    1270        **opts,
    1271    ) -> Q:
    1272        """
    1273        Append to or set the WHERE expressions.
    1274
    1275        Examples:
    1276            >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()
    1277            "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"
    1278
    1279        Args:
    1280            *expressions: the SQL code strings to parse.
    1281                If an `Expression` instance is passed, it will be used as-is.
    1282                Multiple expressions are combined with an AND operator.
    1283            append: if `True`, AND the new expressions to any existing expression.
    1284                Otherwise, this resets the expression.
    1285            dialect: the dialect used to parse the input expressions.
    1286            copy: if `False`, modify this expression instance in-place.
    1287            opts: other options to use to parse the input expressions.
    1288
    1289        Returns:
    1290            The modified expression.
    1291        """
    1292        return _apply_conjunction_builder(
    1293            *[expr.this if isinstance(expr, Where) else expr for expr in expressions],
    1294            instance=self,
    1295            arg="where",
    1296            append=append,
    1297            into=Where,
    1298            dialect=dialect,
    1299            copy=copy,
    1300            **opts,
    1301        )
    1302
    1303    def with_(
    1304        self: Q,
    1305        alias: ExpOrStr,
    1306        as_: ExpOrStr,
    1307        recursive: t.Optional[bool] = None,
    1308        materialized: t.Optional[bool] = None,
    1309        append: bool = True,
    1310        dialect: DialectType = None,
    1311        copy: bool = True,
    1312        scalar: bool = False,
    1313        **opts,
    1314    ) -> Q:
    1315        """
    1316        Append to or set the common table expressions.
    1317
    1318        Example:
    1319            >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()
    1320            'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'
    1321
    1322        Args:
    1323            alias: the SQL code string to parse as the table name.
    1324                If an `Expression` instance is passed, this is used as-is.
    1325            as_: the SQL code string to parse as the table expression.
    1326                If an `Expression` instance is passed, it will be used as-is.
    1327            recursive: set the RECURSIVE part of the expression. Defaults to `False`.
    1328            materialized: set the MATERIALIZED part of the expression.
    1329            append: if `True`, add to any existing expressions.
    1330                Otherwise, this resets the expressions.
    1331            dialect: the dialect used to parse the input expression.
    1332            copy: if `False`, modify this expression instance in-place.
    1333            scalar: if `True`, this is a scalar common table expression.
    1334            opts: other options to use to parse the input expressions.
    1335
    1336        Returns:
    1337            The modified expression.
    1338        """
    1339        return _apply_cte_builder(
    1340            self,
    1341            alias,
    1342            as_,
    1343            recursive=recursive,
    1344            materialized=materialized,
    1345            append=append,
    1346            dialect=dialect,
    1347            copy=copy,
    1348            scalar=scalar,
    1349            **opts,
    1350        )
    1351
    1352    def union(
    1353        self, *expressions: ExpOrStr, distinct: bool = True, dialect: DialectType = None, **opts
    1354    ) -> Union:
    1355        """
    1356        Builds a UNION expression.
    1357
    1358        Example:
    1359            >>> import sqlglot
    1360            >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()
    1361            'SELECT * FROM foo UNION SELECT * FROM bla'
    1362
    1363        Args:
    1364            expressions: the SQL code strings.
    1365                If `Expression` instances are passed, they will be used as-is.
    1366            distinct: set the DISTINCT flag if and only if this is true.
    1367            dialect: the dialect used to parse the input expression.
    1368            opts: other options to use to parse the input expressions.
    1369
    1370        Returns:
    1371            The new Union expression.
    1372        """
    1373        return union(self, *expressions, distinct=distinct, dialect=dialect, **opts)
    1374
    1375    def intersect(
    1376        self, *expressions: ExpOrStr, distinct: bool = True, dialect: DialectType = None, **opts
    1377    ) -> Intersect:
    1378        """
    1379        Builds an INTERSECT expression.
    1380
    1381        Example:
    1382            >>> import sqlglot
    1383            >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()
    1384            'SELECT * FROM foo INTERSECT SELECT * FROM bla'
    1385
    1386        Args:
    1387            expressions: the SQL code strings.
    1388                If `Expression` instances are passed, they will be used as-is.
    1389            distinct: set the DISTINCT flag if and only if this is true.
    1390            dialect: the dialect used to parse the input expression.
    1391            opts: other options to use to parse the input expressions.
    1392
    1393        Returns:
    1394            The new Intersect expression.
    1395        """
    1396        return intersect(self, *expressions, distinct=distinct, dialect=dialect, **opts)
    1397
    1398    def except_(
    1399        self, *expressions: ExpOrStr, distinct: bool = True, dialect: DialectType = None, **opts
    1400    ) -> Except:
    1401        """
    1402        Builds an EXCEPT expression.
    1403
    1404        Example:
    1405            >>> import sqlglot
    1406            >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()
    1407            'SELECT * FROM foo EXCEPT SELECT * FROM bla'
    1408
    1409        Args:
    1410            expressions: the SQL code strings.
    1411                If `Expression` instance are passed, they will be used as-is.
    1412            distinct: set the DISTINCT flag if and only if this is true.
    1413            dialect: the dialect used to parse the input expression.
    1414            opts: other options to use to parse the input expressions.
    1415
    1416        Returns:
    1417            The new Except expression.
    1418        """
    1419        return except_(self, *expressions, distinct=distinct, dialect=dialect, **opts)

def subquery( self, alias: Union[str, Expression, NoneType] = None, copy: bool = True) -> Subquery: View Source

    1092    def subquery(self, alias: t.Optional[ExpOrStr] = None, copy: bool = True) -> Subquery:
    1093        """
    1094        Returns a `Subquery` that wraps around this query.
    1095
    1096        Example:
    1097            >>> subquery = Select().select("x").from_("tbl").subquery()
    1098            >>> Select().select("x").from_(subquery).sql()
    1099            'SELECT x FROM (SELECT x FROM tbl)'
    1100
    1101        Args:
    1102            alias: an optional alias for the subquery.
    1103            copy: if `False`, modify this expression instance in-place.
    1104        """
    1105        instance = maybe_copy(self, copy)
    1106        if not isinstance(alias, Expression):
    1107            alias = TableAlias(this=to_identifier(alias)) if alias else None
    1108
    1109        return Subquery(this=instance, alias=alias)

Returns a `Subquery` that wraps around this query.

###### Example:

>     >>> subquery = Select().select("x").from_("tbl").subquery()
>     >>> Select().select("x").from_(subquery).sql()
>     'SELECT x FROM (SELECT x FROM tbl)'

###### Arguments:

- alias: an optional alias for the subquery.
- copy: if `False`, modify this expression instance in-place.

def limit( self: ~Q, expression: Union[str, Expression, int], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> ~Q: View Source

    1111    def limit(
    1112        self: Q, expression: ExpOrStr | int, dialect: DialectType = None, copy: bool = True, **opts
    1113    ) -> Q:
    1114        """
    1115        Adds a LIMIT clause to this query.
    1116
    1117        Example:
    1118            >>> select("1").union(select("1")).limit(1).sql()
    1119            'SELECT 1 UNION SELECT 1 LIMIT 1'
    1120
    1121        Args:
    1122            expression: the SQL code string to parse.
    1123                This can also be an integer.
    1124                If a `Limit` instance is passed, it will be used as-is.
    1125                If another `Expression` instance is passed, it will be wrapped in a `Limit`.
    1126            dialect: the dialect used to parse the input expression.
    1127            copy: if `False`, modify this expression instance in-place.
    1128            opts: other options to use to parse the input expressions.
    1129
    1130        Returns:
    1131            A limited Select expression.
    1132        """
    1133        return _apply_builder(
    1134            expression=expression,
    1135            instance=self,
    1136            arg="limit",
    1137            into=Limit,
    1138            prefix="LIMIT",
    1139            dialect=dialect,
    1140            copy=copy,
    1141            into_arg="expression",
    1142            **opts,
    1143        )

Adds a LIMIT clause to this query.

###### Example:

>     >>> select("1").union(select("1")).limit(1).sql()
>     'SELECT 1 UNION SELECT 1 LIMIT 1'

###### Arguments:

- expression: the SQL code string to parse. This can also be an integer. If a `Limit` instance is passed, it will be used as-is. If another `Expression` instance is passed, it will be wrapped in a `Limit`.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> A limited Select expression.

def offset( self: ~Q, expression: Union[str, Expression, int], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> ~Q: View Source

    1145    def offset(
    1146        self: Q, expression: ExpOrStr | int, dialect: DialectType = None, copy: bool = True, **opts
    1147    ) -> Q:
    1148        """
    1149        Set the OFFSET expression.
    1150
    1151        Example:
    1152            >>> Select().from_("tbl").select("x").offset(10).sql()
    1153            'SELECT x FROM tbl OFFSET 10'
    1154
    1155        Args:
    1156            expression: the SQL code string to parse.
    1157                This can also be an integer.
    1158                If a `Offset` instance is passed, this is used as-is.
    1159                If another `Expression` instance is passed, it will be wrapped in a `Offset`.
    1160            dialect: the dialect used to parse the input expression.
    1161            copy: if `False`, modify this expression instance in-place.
    1162            opts: other options to use to parse the input expressions.
    1163
    1164        Returns:
    1165            The modified Select expression.
    1166        """
    1167        return _apply_builder(
    1168            expression=expression,
    1169            instance=self,
    1170            arg="offset",
    1171            into=Offset,
    1172            prefix="OFFSET",
    1173            dialect=dialect,
    1174            copy=copy,
    1175            into_arg="expression",
    1176            **opts,
    1177        )

Set the OFFSET expression.

###### Example:

>     >>> Select().from_("tbl").select("x").offset(10).sql()
>     'SELECT x FROM tbl OFFSET 10'

###### Arguments:

- expression: the SQL code string to parse. This can also be an integer. If a `Offset` instance is passed, this is used as-is. If another `Expression` instance is passed, it will be wrapped in a `Offset`.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Select expression.

def order_by( self: ~Q, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> ~Q: View Source

    1179    def order_by(
    1180        self: Q,
    1181        *expressions: t.Optional[ExpOrStr],
    1182        append: bool = True,
    1183        dialect: DialectType = None,
    1184        copy: bool = True,
    1185        **opts,
    1186    ) -> Q:
    1187        """
    1188        Set the ORDER BY expression.
    1189
    1190        Example:
    1191            >>> Select().from_("tbl").select("x").order_by("x DESC").sql()
    1192            'SELECT x FROM tbl ORDER BY x DESC'
    1193
    1194        Args:
    1195            *expressions: the SQL code strings to parse.
    1196                If a `Group` instance is passed, this is used as-is.
    1197                If another `Expression` instance is passed, it will be wrapped in a `Order`.
    1198            append: if `True`, add to any existing expressions.
    1199                Otherwise, this flattens all the `Order` expression into a single expression.
    1200            dialect: the dialect used to parse the input expression.
    1201            copy: if `False`, modify this expression instance in-place.
    1202            opts: other options to use to parse the input expressions.
    1203
    1204        Returns:
    1205            The modified Select expression.
    1206        """
    1207        return _apply_child_list_builder(
    1208            *expressions,
    1209            instance=self,
    1210            arg="order",
    1211            append=append,
    1212            copy=copy,
    1213            prefix="ORDER BY",
    1214            into=Order,
    1215            dialect=dialect,
    1216            **opts,
    1217        )

Set the ORDER BY expression.

###### Example:

>     >>> Select().from_("tbl").select("x").order_by("x DESC").sql()
>     'SELECT x FROM tbl ORDER BY x DESC'

###### Arguments:

- *expressions: the SQL code strings to parse. If a `Group` instance is passed, this is used as-is. If another `Expression` instance is passed, it will be wrapped in a `Order`.
- append: if `True`, add to any existing expressions. Otherwise, this flattens all the `Order` expression into a single expression.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Select expression.

ctes: List[CTE] View Source

    1219    @property
    1220    def ctes(self) -> t.List[CTE]:
    1221        """Returns a list of all the CTEs attached to this query."""
    1222        with_ = self.args.get("with")
    1223        return with_.expressions if with_ else []

Returns a list of all the CTEs attached to this query.

selects: List[Expression] View Source

    1225    @property
    1226    def selects(self) -> t.List[Expression]:
    1227        """Returns the query's projections."""
    1228        raise NotImplementedError("Query objects must implement `selects`")

Returns the query's projections.

named_selects: List[str] View Source

    1230    @property
    1231    def named_selects(self) -> t.List[str]:
    1232        """Returns the output names of the query's projections."""
    1233        raise NotImplementedError("Query objects must implement `named_selects`")

Returns the output names of the query's projections.

def select( self: ~Q, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> ~Q: View Source

    1235    def select(
    1236        self: Q,
    1237        *expressions: t.Optional[ExpOrStr],
    1238        append: bool = True,
    1239        dialect: DialectType = None,
    1240        copy: bool = True,
    1241        **opts,
    1242    ) -> Q:
    1243        """
    1244        Append to or set the SELECT expressions.
    1245
    1246        Example:
    1247            >>> Select().select("x", "y").sql()
    1248            'SELECT x, y'
    1249
    1250        Args:
    1251            *expressions: the SQL code strings to parse.
    1252                If an `Expression` instance is passed, it will be used as-is.
    1253            append: if `True`, add to any existing expressions.
    1254                Otherwise, this resets the expressions.
    1255            dialect: the dialect used to parse the input expressions.
    1256            copy: if `False`, modify this expression instance in-place.
    1257            opts: other options to use to parse the input expressions.
    1258
    1259        Returns:
    1260            The modified Query expression.
    1261        """
    1262        raise NotImplementedError("Query objects must implement `select`")

Append to or set the SELECT expressions.

###### Example:

>     >>> Select().select("x", "y").sql()
>     'SELECT x, y'

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is.
- append: if `True`, add to any existing expressions. Otherwise, this resets the expressions.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Query expression.

def where( self: ~Q, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> ~Q: View Source

    1264    def where(
    1265        self: Q,
    1266        *expressions: t.Optional[ExpOrStr],
    1267        append: bool = True,
    1268        dialect: DialectType = None,
    1269        copy: bool = True,
    1270        **opts,
    1271    ) -> Q:
    1272        """
    1273        Append to or set the WHERE expressions.
    1274
    1275        Examples:
    1276            >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()
    1277            "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"
    1278
    1279        Args:
    1280            *expressions: the SQL code strings to parse.
    1281                If an `Expression` instance is passed, it will be used as-is.
    1282                Multiple expressions are combined with an AND operator.
    1283            append: if `True`, AND the new expressions to any existing expression.
    1284                Otherwise, this resets the expression.
    1285            dialect: the dialect used to parse the input expressions.
    1286            copy: if `False`, modify this expression instance in-place.
    1287            opts: other options to use to parse the input expressions.
    1288
    1289        Returns:
    1290            The modified expression.
    1291        """
    1292        return _apply_conjunction_builder(
    1293            *[expr.this if isinstance(expr, Where) else expr for expr in expressions],
    1294            instance=self,
    1295            arg="where",
    1296            append=append,
    1297            into=Where,
    1298            dialect=dialect,
    1299            copy=copy,
    1300            **opts,
    1301        )

Append to or set the WHERE expressions.

###### Examples:

>     >>> Select().select("x").from_("tbl").where("x = 'a' OR x < 'b'").sql()
>     "SELECT x FROM tbl WHERE x = 'a' OR x < 'b'"

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is. Multiple expressions are combined with an AND operator.
- append: if `True`, AND the new expressions to any existing expression. Otherwise, this resets the expression.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified expression.

def with_( self: ~Q, alias: Union[str, Expression], as_: Union[str, Expression], recursive: Optional[bool] = None, materialized: Optional[bool] = None, append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, scalar: bool = False, **opts) -> ~Q: View Source

    1303    def with_(
    1304        self: Q,
    1305        alias: ExpOrStr,
    1306        as_: ExpOrStr,
    1307        recursive: t.Optional[bool] = None,
    1308        materialized: t.Optional[bool] = None,
    1309        append: bool = True,
    1310        dialect: DialectType = None,
    1311        copy: bool = True,
    1312        scalar: bool = False,
    1313        **opts,
    1314    ) -> Q:
    1315        """
    1316        Append to or set the common table expressions.
    1317
    1318        Example:
    1319            >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()
    1320            'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'
    1321
    1322        Args:
    1323            alias: the SQL code string to parse as the table name.
    1324                If an `Expression` instance is passed, this is used as-is.
    1325            as_: the SQL code string to parse as the table expression.
    1326                If an `Expression` instance is passed, it will be used as-is.
    1327            recursive: set the RECURSIVE part of the expression. Defaults to `False`.
    1328            materialized: set the MATERIALIZED part of the expression.
    1329            append: if `True`, add to any existing expressions.
    1330                Otherwise, this resets the expressions.
    1331            dialect: the dialect used to parse the input expression.
    1332            copy: if `False`, modify this expression instance in-place.
    1333            scalar: if `True`, this is a scalar common table expression.
    1334            opts: other options to use to parse the input expressions.
    1335
    1336        Returns:
    1337            The modified expression.
    1338        """
    1339        return _apply_cte_builder(
    1340            self,
    1341            alias,
    1342            as_,
    1343            recursive=recursive,
    1344            materialized=materialized,
    1345            append=append,
    1346            dialect=dialect,
    1347            copy=copy,
    1348            scalar=scalar,
    1349            **opts,
    1350        )

Append to or set the common table expressions.

###### Example:

>     >>> Select().with_("tbl2", as_="SELECT * FROM tbl").select("x").from_("tbl2").sql()
>     'WITH tbl2 AS (SELECT * FROM tbl) SELECT x FROM tbl2'

###### Arguments:

- alias: the SQL code string to parse as the table name. If an `Expression` instance is passed, this is used as-is.
- as_: the SQL code string to parse as the table expression. If an `Expression` instance is passed, it will be used as-is.
- recursive: set the RECURSIVE part of the expression. Defaults to `False`.
- materialized: set the MATERIALIZED part of the expression.
- append: if `True`, add to any existing expressions. Otherwise, this resets the expressions.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- scalar: if `True`, this is a scalar common table expression.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified expression.

def union( self, *expressions: Union[str, Expression], distinct: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **opts) -> Union: View Source

    1352    def union(
    1353        self, *expressions: ExpOrStr, distinct: bool = True, dialect: DialectType = None, **opts
    1354    ) -> Union:
    1355        """
    1356        Builds a UNION expression.
    1357
    1358        Example:
    1359            >>> import sqlglot
    1360            >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()
    1361            'SELECT * FROM foo UNION SELECT * FROM bla'
    1362
    1363        Args:
    1364            expressions: the SQL code strings.
    1365                If `Expression` instances are passed, they will be used as-is.
    1366            distinct: set the DISTINCT flag if and only if this is true.
    1367            dialect: the dialect used to parse the input expression.
    1368            opts: other options to use to parse the input expressions.
    1369
    1370        Returns:
    1371            The new Union expression.
    1372        """
    1373        return union(self, *expressions, distinct=distinct, dialect=dialect, **opts)

Builds a UNION expression.

###### Example:

>     >>> import sqlglot
>     >>> sqlglot.parse_one("SELECT * FROM foo").union("SELECT * FROM bla").sql()
>     'SELECT * FROM foo UNION SELECT * FROM bla'

###### Arguments:

- expressions: the SQL code strings. If `Expression` instances are passed, they will be used as-is.
- distinct: set the DISTINCT flag if and only if this is true.
- dialect: the dialect used to parse the input expression.
- opts: other options to use to parse the input expressions.

###### Returns:

> The new Union expression.

def intersect( self, *expressions: Union[str, Expression], distinct: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **opts) -> Intersect: View Source

    1375    def intersect(
    1376        self, *expressions: ExpOrStr, distinct: bool = True, dialect: DialectType = None, **opts
    1377    ) -> Intersect:
    1378        """
    1379        Builds an INTERSECT expression.
    1380
    1381        Example:
    1382            >>> import sqlglot
    1383            >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()
    1384            'SELECT * FROM foo INTERSECT SELECT * FROM bla'
    1385
    1386        Args:
    1387            expressions: the SQL code strings.
    1388                If `Expression` instances are passed, they will be used as-is.
    1389            distinct: set the DISTINCT flag if and only if this is true.
    1390            dialect: the dialect used to parse the input expression.
    1391            opts: other options to use to parse the input expressions.
    1392
    1393        Returns:
    1394            The new Intersect expression.
    1395        """
    1396        return intersect(self, *expressions, distinct=distinct, dialect=dialect, **opts)

Builds an INTERSECT expression.

###### Example:

>     >>> import sqlglot
>     >>> sqlglot.parse_one("SELECT * FROM foo").intersect("SELECT * FROM bla").sql()
>     'SELECT * FROM foo INTERSECT SELECT * FROM bla'

###### Arguments:

- expressions: the SQL code strings. If `Expression` instances are passed, they will be used as-is.
- distinct: set the DISTINCT flag if and only if this is true.
- dialect: the dialect used to parse the input expression.
- opts: other options to use to parse the input expressions.

###### Returns:

> The new Intersect expression.

def except_( self, *expressions: Union[str, Expression], distinct: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **opts) -> Except: View Source

    1398    def except_(
    1399        self, *expressions: ExpOrStr, distinct: bool = True, dialect: DialectType = None, **opts
    1400    ) -> Except:
    1401        """
    1402        Builds an EXCEPT expression.
    1403
    1404        Example:
    1405            >>> import sqlglot
    1406            >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()
    1407            'SELECT * FROM foo EXCEPT SELECT * FROM bla'
    1408
    1409        Args:
    1410            expressions: the SQL code strings.
    1411                If `Expression` instance are passed, they will be used as-is.
    1412            distinct: set the DISTINCT flag if and only if this is true.
    1413            dialect: the dialect used to parse the input expression.
    1414            opts: other options to use to parse the input expressions.
    1415
    1416        Returns:
    1417            The new Except expression.
    1418        """
    1419        return except_(self, *expressions, distinct=distinct, dialect=dialect, **opts)

Builds an EXCEPT expression.

###### Example:

>     >>> import sqlglot
>     >>> sqlglot.parse_one("SELECT * FROM foo").except_("SELECT * FROM bla").sql()
>     'SELECT * FROM foo EXCEPT SELECT * FROM bla'

###### Arguments:

- expressions: the SQL code strings. If `Expression` instance are passed, they will be used as-is.
- distinct: set the DISTINCT flag if and only if this is true.
- dialect: the dialect used to parse the input expression.
- opts: other options to use to parse the input expressions.

###### Returns:

> The new Except expression.

key = 'query'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class UDTF(DerivedTable): View Source

    1422class UDTF(DerivedTable):
    1423    @property
    1424    def selects(self) -> t.List[Expression]:
    1425        alias = self.args.get("alias")
    1426        return alias.columns if alias else []

selects: List[Expression] View Source

    1423    @property
    1424    def selects(self) -> t.List[Expression]:
    1425        alias = self.args.get("alias")
    1426        return alias.columns if alias else []

key = 'udtf'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DerivedTable
  named_selects

class Cache(Expression): View Source

    1429class Cache(Expression):
    1430    arg_types = {
    1431        "this": True,
    1432        "lazy": False,
    1433        "options": False,
    1434        "expression": False,
    1435    }

arg_types = {'this': True, 'lazy': False, 'options': False, 'expression': False}
key = 'cache'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Uncache(Expression): View Source

    1438class Uncache(Expression):
    1439    arg_types = {"this": True, "exists": False}

arg_types = {'this': True, 'exists': False}
key = 'uncache'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Refresh(Expression): View Source

    1442class Refresh(Expression):
    1443    pass

key = 'refresh'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DDL(Expression): View Source

    1446class DDL(Expression):
    1447    @property
    1448    def ctes(self) -> t.List[CTE]:
    1449        """Returns a list of all the CTEs attached to this statement."""
    1450        with_ = self.args.get("with")
    1451        return with_.expressions if with_ else []
    1452
    1453    @property
    1454    def selects(self) -> t.List[Expression]:
    1455        """If this statement contains a query (e.g. a CTAS), this returns the query's projections."""
    1456        return self.expression.selects if isinstance(self.expression, Query) else []
    1457
    1458    @property
    1459    def named_selects(self) -> t.List[str]:
    1460        """
    1461        If this statement contains a query (e.g. a CTAS), this returns the output
    1462        names of the query's projections.
    1463        """
    1464        return self.expression.named_selects if isinstance(self.expression, Query) else []

ctes: List[CTE] View Source

    1447    @property
    1448    def ctes(self) -> t.List[CTE]:
    1449        """Returns a list of all the CTEs attached to this statement."""
    1450        with_ = self.args.get("with")
    1451        return with_.expressions if with_ else []

Returns a list of all the CTEs attached to this statement.

selects: List[Expression] View Source

    1453    @property
    1454    def selects(self) -> t.List[Expression]:
    1455        """If this statement contains a query (e.g. a CTAS), this returns the query's projections."""
    1456        return self.expression.selects if isinstance(self.expression, Query) else []

If this statement contains a query (e.g. a CTAS), this returns the query's projections.

named_selects: List[str] View Source

    1458    @property
    1459    def named_selects(self) -> t.List[str]:
    1460        """
    1461        If this statement contains a query (e.g. a CTAS), this returns the output
    1462        names of the query's projections.
    1463        """
    1464        return self.expression.named_selects if isinstance(self.expression, Query) else []

If this statement contains a query (e.g. a CTAS), this returns the output names of the query's projections.

key = 'ddl'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class LockingStatement(Expression): View Source

    1468class LockingStatement(Expression):
    1469    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'lockingstatement'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DML(Expression): View Source

    1472class DML(Expression):
    1473    def returning(
    1474        self,
    1475        expression: ExpOrStr,
    1476        dialect: DialectType = None,
    1477        copy: bool = True,
    1478        **opts,
    1479    ) -> "Self":
    1480        """
    1481        Set the RETURNING expression. Not supported by all dialects.
    1482
    1483        Example:
    1484            >>> delete("tbl").returning("*", dialect="postgres").sql()
    1485            'DELETE FROM tbl RETURNING *'
    1486
    1487        Args:
    1488            expression: the SQL code strings to parse.
    1489                If an `Expression` instance is passed, it will be used as-is.
    1490            dialect: the dialect used to parse the input expressions.
    1491            copy: if `False`, modify this expression instance in-place.
    1492            opts: other options to use to parse the input expressions.
    1493
    1494        Returns:
    1495            Delete: the modified expression.
    1496        """
    1497        return _apply_builder(
    1498            expression=expression,
    1499            instance=self,
    1500            arg="returning",
    1501            prefix="RETURNING",
    1502            dialect=dialect,
    1503            copy=copy,
    1504            into=Returning,
    1505            **opts,
    1506        )

def returning( self, expression: Union[str, Expression], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> typing_extensions.Self: View Source

    1473    def returning(
    1474        self,
    1475        expression: ExpOrStr,
    1476        dialect: DialectType = None,
    1477        copy: bool = True,
    1478        **opts,
    1479    ) -> "Self":
    1480        """
    1481        Set the RETURNING expression. Not supported by all dialects.
    1482
    1483        Example:
    1484            >>> delete("tbl").returning("*", dialect="postgres").sql()
    1485            'DELETE FROM tbl RETURNING *'
    1486
    1487        Args:
    1488            expression: the SQL code strings to parse.
    1489                If an `Expression` instance is passed, it will be used as-is.
    1490            dialect: the dialect used to parse the input expressions.
    1491            copy: if `False`, modify this expression instance in-place.
    1492            opts: other options to use to parse the input expressions.
    1493
    1494        Returns:
    1495            Delete: the modified expression.
    1496        """
    1497        return _apply_builder(
    1498            expression=expression,
    1499            instance=self,
    1500            arg="returning",
    1501            prefix="RETURNING",
    1502            dialect=dialect,
    1503            copy=copy,
    1504            into=Returning,
    1505            **opts,
    1506        )

Set the RETURNING expression. Not supported by all dialects.

###### Example:

>     >>> delete("tbl").returning("*", dialect="postgres").sql()
>     'DELETE FROM tbl RETURNING *'

###### Arguments:

- expression: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> Delete: the modified expression.

key = 'dml'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Create(DDL): View Source

    1509class Create(DDL):
    1510    arg_types = {
    1511        "with": False,
    1512        "this": True,
    1513        "kind": True,
    1514        "expression": False,
    1515        "exists": False,
    1516        "properties": False,
    1517        "replace": False,
    1518        "refresh": False,
    1519        "unique": False,
    1520        "indexes": False,
    1521        "no_schema_binding": False,
    1522        "begin": False,
    1523        "end": False,
    1524        "clone": False,
    1525        "concurrently": False,
    1526        "clustered": False,
    1527    }
    1528
    1529    @property
    1530    def kind(self) -> t.Optional[str]:
    1531        kind = self.args.get("kind")
    1532        return kind and kind.upper()

arg_types = {'with': False, 'this': True, 'kind': True, 'expression': False, 'exists': False, 'properties': False, 'replace': False, 'refresh': False, 'unique': False, 'indexes': False, 'no_schema_binding': False, 'begin': False, 'end': False, 'clone': False, 'concurrently': False, 'clustered': False}
kind: Optional[str] View Source

    1529    @property
    1530    def kind(self) -> t.Optional[str]:
    1531        kind = self.args.get("kind")
    1532        return kind and kind.upper()

key = 'create'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DDL
  ctes
  selects
  named_selects

class SequenceProperties(Expression): View Source

    1535class SequenceProperties(Expression):
    1536    arg_types = {
    1537        "increment": False,
    1538        "minvalue": False,
    1539        "maxvalue": False,
    1540        "cache": False,
    1541        "start": False,
    1542        "owned": False,
    1543        "options": False,
    1544    }

arg_types = {'increment': False, 'minvalue': False, 'maxvalue': False, 'cache': False, 'start': False, 'owned': False, 'options': False}
key = 'sequenceproperties'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TruncateTable(Expression): View Source

    1547class TruncateTable(Expression):
    1548    arg_types = {
    1549        "expressions": True,
    1550        "is_database": False,
    1551        "exists": False,
    1552        "only": False,
    1553        "cluster": False,
    1554        "identity": False,
    1555        "option": False,
    1556        "partition": False,
    1557    }

arg_types = {'expressions': True, 'is_database': False, 'exists': False, 'only': False, 'cluster': False, 'identity': False, 'option': False, 'partition': False}
key = 'truncatetable'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Clone(Expression): View Source

    1563class Clone(Expression):
    1564    arg_types = {"this": True, "shallow": False, "copy": False}

arg_types = {'this': True, 'shallow': False, 'copy': False}
key = 'clone'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Describe(Expression): View Source

    1567class Describe(Expression):
    1568    arg_types = {
    1569        "this": True,
    1570        "style": False,
    1571        "kind": False,
    1572        "expressions": False,
    1573        "partition": False,
    1574        "format": False,
    1575    }

arg_types = {'this': True, 'style': False, 'kind': False, 'expressions': False, 'partition': False, 'format': False}
key = 'describe'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Attach(Expression): View Source

    1579class Attach(Expression):
    1580    arg_types = {"this": True, "exists": False, "expressions": False}

arg_types = {'this': True, 'exists': False, 'expressions': False}
key = 'attach'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Detach(Expression): View Source

    1584class Detach(Expression):
    1585    arg_types = {"this": True, "exists": False}

arg_types = {'this': True, 'exists': False}
key = 'detach'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Install(Expression): View Source

    1589class Install(Expression):
    1590    arg_types = {"this": True, "from": False, "force": False}

arg_types = {'this': True, 'from': False, 'force': False}
key = 'install'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Summarize(Expression): View Source

    1594class Summarize(Expression):
    1595    arg_types = {"this": True, "table": False}

arg_types = {'this': True, 'table': False}
key = 'summarize'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Kill(Expression): View Source

    1598class Kill(Expression):
    1599    arg_types = {"this": True, "kind": False}

arg_types = {'this': True, 'kind': False}
key = 'kill'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Pragma(Expression): View Source

    1602class Pragma(Expression):
    1603    pass

key = 'pragma'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Declare(Expression): View Source

    1606class Declare(Expression):
    1607    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'declare'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DeclareItem(Expression): View Source

    1610class DeclareItem(Expression):
    1611    arg_types = {"this": True, "kind": False, "default": False}

arg_types = {'this': True, 'kind': False, 'default': False}
key = 'declareitem'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Set(Expression): View Source

    1614class Set(Expression):
    1615    arg_types = {"expressions": False, "unset": False, "tag": False}

arg_types = {'expressions': False, 'unset': False, 'tag': False}
key = 'set'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Heredoc(Expression): View Source

    1618class Heredoc(Expression):
    1619    arg_types = {"this": True, "tag": False}

arg_types = {'this': True, 'tag': False}
key = 'heredoc'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SetItem(Expression): View Source

    1622class SetItem(Expression):
    1623    arg_types = {
    1624        "this": False,
    1625        "expressions": False,
    1626        "kind": False,
    1627        "collate": False,  # MySQL SET NAMES statement
    1628        "global": False,
    1629    }

arg_types = {'this': False, 'expressions': False, 'kind': False, 'collate': False, 'global': False}
key = 'setitem'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class QueryBand(Expression): View Source

    1632class QueryBand(Expression):
    1633    arg_types = {"this": True, "scope": False, "update": False}

arg_types = {'this': True, 'scope': False, 'update': False}
key = 'queryband'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Show(Expression): View Source

    1636class Show(Expression):
    1637    arg_types = {
    1638        "this": True,
    1639        "history": False,
    1640        "terse": False,
    1641        "target": False,
    1642        "offset": False,
    1643        "starts_with": False,
    1644        "limit": False,
    1645        "from": False,
    1646        "like": False,
    1647        "where": False,
    1648        "db": False,
    1649        "scope": False,
    1650        "scope_kind": False,
    1651        "full": False,
    1652        "mutex": False,
    1653        "query": False,
    1654        "channel": False,
    1655        "global": False,
    1656        "log": False,
    1657        "position": False,
    1658        "types": False,
    1659        "privileges": False,
    1660        "for_table": False,
    1661        "for_group": False,
    1662        "for_user": False,
    1663        "for_role": False,
    1664        "into_outfile": False,
    1665        "json": False,
    1666    }

arg_types = {'this': True, 'history': False, 'terse': False, 'target': False, 'offset': False, 'starts_with': False, 'limit': False, 'from': False, 'like': False, 'where': False, 'db': False, 'scope': False, 'scope_kind': False, 'full': False, 'mutex': False, 'query': False, 'channel': False, 'global': False, 'log': False, 'position': False, 'types': False, 'privileges': False, 'for_table': False, 'for_group': False, 'for_user': False, 'for_role': False, 'into_outfile': False, 'json': False}
key = 'show'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class UserDefinedFunction(Expression): View Source

    1669class UserDefinedFunction(Expression):
    1670    arg_types = {"this": True, "expressions": False, "wrapped": False}

arg_types = {'this': True, 'expressions': False, 'wrapped': False}
key = 'userdefinedfunction'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CharacterSet(Expression): View Source

    1673class CharacterSet(Expression):
    1674    arg_types = {"this": True, "default": False}

arg_types = {'this': True, 'default': False}
key = 'characterset'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class RecursiveWithSearch(Expression): View Source

    1677class RecursiveWithSearch(Expression):
    1678    arg_types = {"kind": True, "this": True, "expression": True, "using": False}

arg_types = {'kind': True, 'this': True, 'expression': True, 'using': False}
key = 'recursivewithsearch'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class With(Expression): View Source

    1681class With(Expression):
    1682    arg_types = {"expressions": True, "recursive": False, "search": False}
    1683
    1684    @property
    1685    def recursive(self) -> bool:
    1686        return bool(self.args.get("recursive"))

arg_types = {'expressions': True, 'recursive': False, 'search': False}
recursive: bool View Source

    1684    @property
    1685    def recursive(self) -> bool:
    1686        return bool(self.args.get("recursive"))

key = 'with'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WithinGroup(Expression): View Source

    1689class WithinGroup(Expression):
    1690    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'withingroup'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CTE(DerivedTable): View Source

    1695class CTE(DerivedTable):
    1696    arg_types = {
    1697        "this": True,
    1698        "alias": True,
    1699        "scalar": False,
    1700        "materialized": False,
    1701    }

arg_types = {'this': True, 'alias': True, 'scalar': False, 'materialized': False}
key = 'cte'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DerivedTable
  selects
  named_selects

class ProjectionDef(Expression): View Source

    1704class ProjectionDef(Expression):
    1705    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'projectiondef'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TableAlias(Expression): View Source

    1708class TableAlias(Expression):
    1709    arg_types = {"this": False, "columns": False}
    1710
    1711    @property
    1712    def columns(self):
    1713        return self.args.get("columns") or []

arg_types = {'this': False, 'columns': False}
columns View Source

    1711    @property
    1712    def columns(self):
    1713        return self.args.get("columns") or []

key = 'tablealias'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class BitString(Condition): View Source

    1716class BitString(Condition):
    1717    pass

key = 'bitstring'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class HexString(Condition): View Source

    1720class HexString(Condition):
    1721    arg_types = {"this": True, "is_integer": False}

arg_types = {'this': True, 'is_integer': False}
key = 'hexstring'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ByteString(Condition): View Source

    1724class ByteString(Condition):
    1725    pass

key = 'bytestring'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class RawString(Condition): View Source

    1728class RawString(Condition):
    1729    pass

key = 'rawstring'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class UnicodeString(Condition): View Source

    1732class UnicodeString(Condition):
    1733    arg_types = {"this": True, "escape": False}

arg_types = {'this': True, 'escape': False}
key = 'unicodestring'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Column(Condition): View Source

    1736class Column(Condition):
    1737    arg_types = {"this": True, "table": False, "db": False, "catalog": False, "join_mark": False}
    1738
    1739    @property
    1740    def table(self) -> str:
    1741        return self.text("table")
    1742
    1743    @property
    1744    def db(self) -> str:
    1745        return self.text("db")
    1746
    1747    @property
    1748    def catalog(self) -> str:
    1749        return self.text("catalog")
    1750
    1751    @property
    1752    def output_name(self) -> str:
    1753        return self.name
    1754
    1755    @property
    1756    def parts(self) -> t.List[Identifier]:
    1757        """Return the parts of a column in order catalog, db, table, name."""
    1758        return [
    1759            t.cast(Identifier, self.args[part])
    1760            for part in ("catalog", "db", "table", "this")
    1761            if self.args.get(part)
    1762        ]
    1763
    1764    def to_dot(self, include_dots: bool = True) -> Dot | Identifier:
    1765        """Converts the column into a dot expression."""
    1766        parts = self.parts
    1767        parent = self.parent
    1768
    1769        if include_dots:
    1770            while isinstance(parent, Dot):
    1771                parts.append(parent.expression)
    1772                parent = parent.parent
    1773
    1774        return Dot.build(deepcopy(parts)) if len(parts) > 1 else parts[0]

arg_types = {'this': True, 'table': False, 'db': False, 'catalog': False, 'join_mark': False}
table: str View Source

    1739    @property
    1740    def table(self) -> str:
    1741        return self.text("table")

db: str View Source

    1743    @property
    1744    def db(self) -> str:
    1745        return self.text("db")

catalog: str View Source

    1747    @property
    1748    def catalog(self) -> str:
    1749        return self.text("catalog")

output_name: str View Source

    1751    @property
    1752    def output_name(self) -> str:
    1753        return self.name

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

parts: List[Identifier] View Source

    1755    @property
    1756    def parts(self) -> t.List[Identifier]:
    1757        """Return the parts of a column in order catalog, db, table, name."""
    1758        return [
    1759            t.cast(Identifier, self.args[part])
    1760            for part in ("catalog", "db", "table", "this")
    1761            if self.args.get(part)
    1762        ]

Return the parts of a column in order catalog, db, table, name.

def to_dot( self, include_dots: bool = True) -> Dot | Identifier: View Source

    1764    def to_dot(self, include_dots: bool = True) -> Dot | Identifier:
    1765        """Converts the column into a dot expression."""
    1766        parts = self.parts
    1767        parent = self.parent
    1768
    1769        if include_dots:
    1770            while isinstance(parent, Dot):
    1771                parts.append(parent.expression)
    1772                parent = parent.parent
    1773
    1774        return Dot.build(deepcopy(parts)) if len(parts) > 1 else parts[0]

Converts the column into a dot expression.

key = 'column'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ColumnPosition(Expression): View Source

    1777class ColumnPosition(Expression):
    1778    arg_types = {"this": False, "position": True}

arg_types = {'this': False, 'position': True}
key = 'columnposition'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ColumnDef(Expression): View Source

    1781class ColumnDef(Expression):
    1782    arg_types = {
    1783        "this": True,
    1784        "kind": False,
    1785        "constraints": False,
    1786        "exists": False,
    1787        "position": False,
    1788        "default": False,
    1789        "output": False,
    1790    }
    1791
    1792    @property
    1793    def constraints(self) -> t.List[ColumnConstraint]:
    1794        return self.args.get("constraints") or []
    1795
    1796    @property
    1797    def kind(self) -> t.Optional[DataType]:
    1798        return self.args.get("kind")

arg_types = {'this': True, 'kind': False, 'constraints': False, 'exists': False, 'position': False, 'default': False, 'output': False}
constraints: List[ColumnConstraint] View Source

    1792    @property
    1793    def constraints(self) -> t.List[ColumnConstraint]:
    1794        return self.args.get("constraints") or []

kind: Optional[DataType] View Source

    1796    @property
    1797    def kind(self) -> t.Optional[DataType]:
    1798        return self.args.get("kind")

key = 'columndef'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AlterColumn(Expression): View Source

    1801class AlterColumn(Expression):
    1802    arg_types = {
    1803        "this": True,
    1804        "dtype": False,
    1805        "collate": False,
    1806        "using": False,
    1807        "default": False,
    1808        "drop": False,
    1809        "comment": False,
    1810        "allow_null": False,
    1811        "visible": False,
    1812    }

arg_types = {'this': True, 'dtype': False, 'collate': False, 'using': False, 'default': False, 'drop': False, 'comment': False, 'allow_null': False, 'visible': False}
key = 'altercolumn'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AlterIndex(Expression): View Source

    1816class AlterIndex(Expression):
    1817    arg_types = {"this": True, "visible": True}

arg_types = {'this': True, 'visible': True}
key = 'alterindex'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AlterDistStyle(Expression): View Source

    1821class AlterDistStyle(Expression):
    1822    pass

key = 'alterdiststyle'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AlterSortKey(Expression): View Source

    1825class AlterSortKey(Expression):
    1826    arg_types = {"this": False, "expressions": False, "compound": False}

arg_types = {'this': False, 'expressions': False, 'compound': False}
key = 'altersortkey'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AlterSet(Expression): View Source

    1829class AlterSet(Expression):
    1830    arg_types = {
    1831        "expressions": False,
    1832        "option": False,
    1833        "tablespace": False,
    1834        "access_method": False,
    1835        "file_format": False,
    1836        "copy_options": False,
    1837        "tag": False,
    1838        "location": False,
    1839        "serde": False,
    1840    }

arg_types = {'expressions': False, 'option': False, 'tablespace': False, 'access_method': False, 'file_format': False, 'copy_options': False, 'tag': False, 'location': False, 'serde': False}
key = 'alterset'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class RenameColumn(Expression): View Source

    1843class RenameColumn(Expression):
    1844    arg_types = {"this": True, "to": True, "exists": False}

arg_types = {'this': True, 'to': True, 'exists': False}
key = 'renamecolumn'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AlterRename(Expression): View Source

    1847class AlterRename(Expression):
    1848    pass

key = 'alterrename'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SwapTable(Expression): View Source

    1851class SwapTable(Expression):
    1852    pass

key = 'swaptable'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Comment(Expression): View Source

    1855class Comment(Expression):
    1856    arg_types = {
    1857        "this": True,
    1858        "kind": True,
    1859        "expression": True,
    1860        "exists": False,
    1861        "materialized": False,
    1862    }

arg_types = {'this': True, 'kind': True, 'expression': True, 'exists': False, 'materialized': False}
key = 'comment'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Comprehension(Expression): View Source

    1865class Comprehension(Expression):
    1866    arg_types = {"this": True, "expression": True, "iterator": True, "condition": False}

arg_types = {'this': True, 'expression': True, 'iterator': True, 'condition': False}
key = 'comprehension'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class MergeTreeTTLAction(Expression): View Source

    1870class MergeTreeTTLAction(Expression):
    1871    arg_types = {
    1872        "this": True,
    1873        "delete": False,
    1874        "recompress": False,
    1875        "to_disk": False,
    1876        "to_volume": False,
    1877    }

arg_types = {'this': True, 'delete': False, 'recompress': False, 'to_disk': False, 'to_volume': False}
key = 'mergetreettlaction'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class MergeTreeTTL(Expression): View Source

    1881class MergeTreeTTL(Expression):
    1882    arg_types = {
    1883        "expressions": True,
    1884        "where": False,
    1885        "group": False,
    1886        "aggregates": False,
    1887    }

arg_types = {'expressions': True, 'where': False, 'group': False, 'aggregates': False}
key = 'mergetreettl'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class IndexConstraintOption(Expression): View Source

    1891class IndexConstraintOption(Expression):
    1892    arg_types = {
    1893        "key_block_size": False,
    1894        "using": False,
    1895        "parser": False,
    1896        "comment": False,
    1897        "visible": False,
    1898        "engine_attr": False,
    1899        "secondary_engine_attr": False,
    1900    }

arg_types = {'key_block_size': False, 'using': False, 'parser': False, 'comment': False, 'visible': False, 'engine_attr': False, 'secondary_engine_attr': False}
key = 'indexconstraintoption'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ColumnConstraint(Expression): View Source

    1903class ColumnConstraint(Expression):
    1904    arg_types = {"this": False, "kind": True}
    1905
    1906    @property
    1907    def kind(self) -> ColumnConstraintKind:
    1908        return self.args["kind"]

arg_types = {'this': False, 'kind': True}
kind: ColumnConstraintKind View Source

    1906    @property
    1907    def kind(self) -> ColumnConstraintKind:
    1908        return self.args["kind"]

key = 'columnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ColumnConstraintKind(Expression): View Source

    1911class ColumnConstraintKind(Expression):
    1912    pass

key = 'columnconstraintkind'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AutoIncrementColumnConstraint(ColumnConstraintKind): View Source

    1915class AutoIncrementColumnConstraint(ColumnConstraintKind):
    1916    pass

key = 'autoincrementcolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PeriodForSystemTimeConstraint(ColumnConstraintKind): View Source

    1919class PeriodForSystemTimeConstraint(ColumnConstraintKind):
    1920    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'periodforsystemtimeconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CaseSpecificColumnConstraint(ColumnConstraintKind): View Source

    1923class CaseSpecificColumnConstraint(ColumnConstraintKind):
    1924    arg_types = {"not_": True}

arg_types = {'not_': True}
key = 'casespecificcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CharacterSetColumnConstraint(ColumnConstraintKind): View Source

    1927class CharacterSetColumnConstraint(ColumnConstraintKind):
    1928    arg_types = {"this": True}

arg_types = {'this': True}
key = 'charactersetcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CheckColumnConstraint(ColumnConstraintKind): View Source

    1931class CheckColumnConstraint(ColumnConstraintKind):
    1932    arg_types = {"this": True, "enforced": False}

arg_types = {'this': True, 'enforced': False}
key = 'checkcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ClusteredColumnConstraint(ColumnConstraintKind): View Source

    1935class ClusteredColumnConstraint(ColumnConstraintKind):
    1936    pass

key = 'clusteredcolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CollateColumnConstraint(ColumnConstraintKind): View Source

    1939class CollateColumnConstraint(ColumnConstraintKind):
    1940    pass

key = 'collatecolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CommentColumnConstraint(ColumnConstraintKind): View Source

    1943class CommentColumnConstraint(ColumnConstraintKind):
    1944    pass

key = 'commentcolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CompressColumnConstraint(ColumnConstraintKind): View Source

    1947class CompressColumnConstraint(ColumnConstraintKind):
    1948    arg_types = {"this": False}

arg_types = {'this': False}
key = 'compresscolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DateFormatColumnConstraint(ColumnConstraintKind): View Source

    1951class DateFormatColumnConstraint(ColumnConstraintKind):
    1952    arg_types = {"this": True}

arg_types = {'this': True}
key = 'dateformatcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DefaultColumnConstraint(ColumnConstraintKind): View Source

    1955class DefaultColumnConstraint(ColumnConstraintKind):
    1956    pass

key = 'defaultcolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class EncodeColumnConstraint(ColumnConstraintKind): View Source

    1959class EncodeColumnConstraint(ColumnConstraintKind):
    1960    pass

key = 'encodecolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ExcludeColumnConstraint(ColumnConstraintKind): View Source

    1964class ExcludeColumnConstraint(ColumnConstraintKind):
    1965    pass

key = 'excludecolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class EphemeralColumnConstraint(ColumnConstraintKind): View Source

    1968class EphemeralColumnConstraint(ColumnConstraintKind):
    1969    arg_types = {"this": False}

arg_types = {'this': False}
key = 'ephemeralcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WithOperator(Expression): View Source

    1972class WithOperator(Expression):
    1973    arg_types = {"this": True, "op": True}

arg_types = {'this': True, 'op': True}
key = 'withoperator'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class GeneratedAsIdentityColumnConstraint(ColumnConstraintKind): View Source

    1976class GeneratedAsIdentityColumnConstraint(ColumnConstraintKind):
    1977    # this: True -> ALWAYS, this: False -> BY DEFAULT
    1978    arg_types = {
    1979        "this": False,
    1980        "expression": False,
    1981        "on_null": False,
    1982        "start": False,
    1983        "increment": False,
    1984        "minvalue": False,
    1985        "maxvalue": False,
    1986        "cycle": False,
    1987        "order": False,
    1988    }

arg_types = {'this': False, 'expression': False, 'on_null': False, 'start': False, 'increment': False, 'minvalue': False, 'maxvalue': False, 'cycle': False, 'order': False}
key = 'generatedasidentitycolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class GeneratedAsRowColumnConstraint(ColumnConstraintKind): View Source

    1991class GeneratedAsRowColumnConstraint(ColumnConstraintKind):
    1992    arg_types = {"start": False, "hidden": False}

arg_types = {'start': False, 'hidden': False}
key = 'generatedasrowcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class IndexColumnConstraint(ColumnConstraintKind): View Source

    1997class IndexColumnConstraint(ColumnConstraintKind):
    1998    arg_types = {
    1999        "this": False,
    2000        "expressions": False,
    2001        "kind": False,
    2002        "index_type": False,
    2003        "options": False,
    2004        "expression": False,  # Clickhouse
    2005        "granularity": False,
    2006    }

arg_types = {'this': False, 'expressions': False, 'kind': False, 'index_type': False, 'options': False, 'expression': False, 'granularity': False}
key = 'indexcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class InlineLengthColumnConstraint(ColumnConstraintKind): View Source

    2009class InlineLengthColumnConstraint(ColumnConstraintKind):
    2010    pass

key = 'inlinelengthcolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class NonClusteredColumnConstraint(ColumnConstraintKind): View Source

    2013class NonClusteredColumnConstraint(ColumnConstraintKind):
    2014    pass

key = 'nonclusteredcolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class NotForReplicationColumnConstraint(ColumnConstraintKind): View Source

    2017class NotForReplicationColumnConstraint(ColumnConstraintKind):
    2018    arg_types = {}

arg_types = {}
key = 'notforreplicationcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class MaskingPolicyColumnConstraint(ColumnConstraintKind): View Source

    2022class MaskingPolicyColumnConstraint(ColumnConstraintKind):
    2023    arg_types = {"this": True, "expressions": False}

arg_types = {'this': True, 'expressions': False}
key = 'maskingpolicycolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class NotNullColumnConstraint(ColumnConstraintKind): View Source

    2026class NotNullColumnConstraint(ColumnConstraintKind):
    2027    arg_types = {"allow_null": False}

arg_types = {'allow_null': False}
key = 'notnullcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class OnUpdateColumnConstraint(ColumnConstraintKind): View Source

    2031class OnUpdateColumnConstraint(ColumnConstraintKind):
    2032    pass

key = 'onupdatecolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PrimaryKeyColumnConstraint(ColumnConstraintKind): View Source

    2035class PrimaryKeyColumnConstraint(ColumnConstraintKind):
    2036    arg_types = {"desc": False, "options": False}

arg_types = {'desc': False, 'options': False}
key = 'primarykeycolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TitleColumnConstraint(ColumnConstraintKind): View Source

    2039class TitleColumnConstraint(ColumnConstraintKind):
    2040    pass

key = 'titlecolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class UniqueColumnConstraint(ColumnConstraintKind): View Source

    2043class UniqueColumnConstraint(ColumnConstraintKind):
    2044    arg_types = {
    2045        "this": False,
    2046        "index_type": False,
    2047        "on_conflict": False,
    2048        "nulls": False,
    2049        "options": False,
    2050    }

arg_types = {'this': False, 'index_type': False, 'on_conflict': False, 'nulls': False, 'options': False}
key = 'uniquecolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class UppercaseColumnConstraint(ColumnConstraintKind): View Source

    2053class UppercaseColumnConstraint(ColumnConstraintKind):
    2054    arg_types: t.Dict[str, t.Any] = {}

arg_types: Dict[str, Any] = {}
key = 'uppercasecolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WatermarkColumnConstraint(Expression): View Source

    2058class WatermarkColumnConstraint(Expression):
    2059    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'watermarkcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PathColumnConstraint(ColumnConstraintKind): View Source

    2062class PathColumnConstraint(ColumnConstraintKind):
    2063    pass

key = 'pathcolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ProjectionPolicyColumnConstraint(ColumnConstraintKind): View Source

    2067class ProjectionPolicyColumnConstraint(ColumnConstraintKind):
    2068    pass

key = 'projectionpolicycolumnconstraint'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ComputedColumnConstraint(ColumnConstraintKind): View Source

    2073class ComputedColumnConstraint(ColumnConstraintKind):
    2074    arg_types = {"this": True, "persisted": False, "not_null": False, "data_type": False}

arg_types = {'this': True, 'persisted': False, 'not_null': False, 'data_type': False}
key = 'computedcolumnconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Constraint(Expression): View Source

    2077class Constraint(Expression):
    2078    arg_types = {"this": True, "expressions": True}

arg_types = {'this': True, 'expressions': True}
key = 'constraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Delete(DML): View Source

    2081class Delete(DML):
    2082    arg_types = {
    2083        "with": False,
    2084        "this": False,
    2085        "using": False,
    2086        "where": False,
    2087        "returning": False,
    2088        "limit": False,
    2089        "tables": False,  # Multiple-Table Syntax (MySQL)
    2090        "cluster": False,  # Clickhouse
    2091    }
    2092
    2093    def delete(
    2094        self,
    2095        table: ExpOrStr,
    2096        dialect: DialectType = None,
    2097        copy: bool = True,
    2098        **opts,
    2099    ) -> Delete:
    2100        """
    2101        Create a DELETE expression or replace the table on an existing DELETE expression.
    2102
    2103        Example:
    2104            >>> delete("tbl").sql()
    2105            'DELETE FROM tbl'
    2106
    2107        Args:
    2108            table: the table from which to delete.
    2109            dialect: the dialect used to parse the input expression.
    2110            copy: if `False`, modify this expression instance in-place.
    2111            opts: other options to use to parse the input expressions.
    2112
    2113        Returns:
    2114            Delete: the modified expression.
    2115        """
    2116        return _apply_builder(
    2117            expression=table,
    2118            instance=self,
    2119            arg="this",
    2120            dialect=dialect,
    2121            into=Table,
    2122            copy=copy,
    2123            **opts,
    2124        )
    2125
    2126    def where(
    2127        self,
    2128        *expressions: t.Optional[ExpOrStr],
    2129        append: bool = True,
    2130        dialect: DialectType = None,
    2131        copy: bool = True,
    2132        **opts,
    2133    ) -> Delete:
    2134        """
    2135        Append to or set the WHERE expressions.
    2136
    2137        Example:
    2138            >>> delete("tbl").where("x = 'a' OR x < 'b'").sql()
    2139            "DELETE FROM tbl WHERE x = 'a' OR x < 'b'"
    2140
    2141        Args:
    2142            *expressions: the SQL code strings to parse.
    2143                If an `Expression` instance is passed, it will be used as-is.
    2144                Multiple expressions are combined with an AND operator.
    2145            append: if `True`, AND the new expressions to any existing expression.
    2146                Otherwise, this resets the expression.
    2147            dialect: the dialect used to parse the input expressions.
    2148            copy: if `False`, modify this expression instance in-place.
    2149            opts: other options to use to parse the input expressions.
    2150
    2151        Returns:
    2152            Delete: the modified expression.
    2153        """
    2154        return _apply_conjunction_builder(
    2155            *expressions,
    2156            instance=self,
    2157            arg="where",
    2158            append=append,
    2159            into=Where,
    2160            dialect=dialect,
    2161            copy=copy,
    2162            **opts,
    2163        )

arg_types = {'with': False, 'this': False, 'using': False, 'where': False, 'returning': False, 'limit': False, 'tables': False, 'cluster': False}
def delete( self, table: Union[str, Expression], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Delete: View Source

    2093    def delete(
    2094        self,
    2095        table: ExpOrStr,
    2096        dialect: DialectType = None,
    2097        copy: bool = True,
    2098        **opts,
    2099    ) -> Delete:
    2100        """
    2101        Create a DELETE expression or replace the table on an existing DELETE expression.
    2102
    2103        Example:
    2104            >>> delete("tbl").sql()
    2105            'DELETE FROM tbl'
    2106
    2107        Args:
    2108            table: the table from which to delete.
    2109            dialect: the dialect used to parse the input expression.
    2110            copy: if `False`, modify this expression instance in-place.
    2111            opts: other options to use to parse the input expressions.
    2112
    2113        Returns:
    2114            Delete: the modified expression.
    2115        """
    2116        return _apply_builder(
    2117            expression=table,
    2118            instance=self,
    2119            arg="this",
    2120            dialect=dialect,
    2121            into=Table,
    2122            copy=copy,
    2123            **opts,
    2124        )

Create a DELETE expression or replace the table on an existing DELETE expression.

###### Example:

>     >>> delete("tbl").sql()
>     'DELETE FROM tbl'

###### Arguments:

- table: the table from which to delete.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> Delete: the modified expression.

def where( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Delete: View Source

    2126    def where(
    2127        self,
    2128        *expressions: t.Optional[ExpOrStr],
    2129        append: bool = True,
    2130        dialect: DialectType = None,
    2131        copy: bool = True,
    2132        **opts,
    2133    ) -> Delete:
    2134        """
    2135        Append to or set the WHERE expressions.
    2136
    2137        Example:
    2138            >>> delete("tbl").where("x = 'a' OR x < 'b'").sql()
    2139            "DELETE FROM tbl WHERE x = 'a' OR x < 'b'"
    2140
    2141        Args:
    2142            *expressions: the SQL code strings to parse.
    2143                If an `Expression` instance is passed, it will be used as-is.
    2144                Multiple expressions are combined with an AND operator.
    2145            append: if `True`, AND the new expressions to any existing expression.
    2146                Otherwise, this resets the expression.
    2147            dialect: the dialect used to parse the input expressions.
    2148            copy: if `False`, modify this expression instance in-place.
    2149            opts: other options to use to parse the input expressions.
    2150
    2151        Returns:
    2152            Delete: the modified expression.
    2153        """
    2154        return _apply_conjunction_builder(
    2155            *expressions,
    2156            instance=self,
    2157            arg="where",
    2158            append=append,
    2159            into=Where,
    2160            dialect=dialect,
    2161            copy=copy,
    2162            **opts,
    2163        )

Append to or set the WHERE expressions.

###### Example:

>     >>> delete("tbl").where("x = 'a' OR x < 'b'").sql()
>     "DELETE FROM tbl WHERE x = 'a' OR x < 'b'"

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is. Multiple expressions are combined with an AND operator.
- append: if `True`, AND the new expressions to any existing expression. Otherwise, this resets the expression.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> Delete: the modified expression.

key = 'delete'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DML
  returning

class Drop(Expression): View Source

    2166class Drop(Expression):
    2167    arg_types = {
    2168        "this": False,
    2169        "kind": False,
    2170        "expressions": False,
    2171        "exists": False,
    2172        "temporary": False,
    2173        "materialized": False,
    2174        "cascade": False,
    2175        "constraints": False,
    2176        "purge": False,
    2177        "cluster": False,
    2178        "concurrently": False,
    2179    }
    2180
    2181    @property
    2182    def kind(self) -> t.Optional[str]:
    2183        kind = self.args.get("kind")
    2184        return kind and kind.upper()

arg_types = {'this': False, 'kind': False, 'expressions': False, 'exists': False, 'temporary': False, 'materialized': False, 'cascade': False, 'constraints': False, 'purge': False, 'cluster': False, 'concurrently': False}
kind: Optional[str] View Source

    2181    @property
    2182    def kind(self) -> t.Optional[str]:
    2183        kind = self.args.get("kind")
    2184        return kind and kind.upper()

key = 'drop'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Export(Expression): View Source

    2188class Export(Expression):
    2189    arg_types = {"this": True, "connection": False, "options": True}

arg_types = {'this': True, 'connection': False, 'options': True}
key = 'export'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Filter(Expression): View Source

    2192class Filter(Expression):
    2193    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'filter'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Check(Expression): View Source

    2196class Check(Expression):
    2197    pass

key = 'check'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Changes(Expression): View Source

    2200class Changes(Expression):
    2201    arg_types = {"information": True, "at_before": False, "end": False}

arg_types = {'information': True, 'at_before': False, 'end': False}
key = 'changes'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Connect(Expression): View Source

    2205class Connect(Expression):
    2206    arg_types = {"start": False, "connect": True, "nocycle": False}

arg_types = {'start': False, 'connect': True, 'nocycle': False}
key = 'connect'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CopyParameter(Expression): View Source

    2209class CopyParameter(Expression):
    2210    arg_types = {"this": True, "expression": False, "expressions": False}

arg_types = {'this': True, 'expression': False, 'expressions': False}
key = 'copyparameter'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Copy(DML): View Source

    2213class Copy(DML):
    2214    arg_types = {
    2215        "this": True,
    2216        "kind": True,
    2217        "files": False,
    2218        "credentials": False,
    2219        "format": False,
    2220        "params": False,
    2221    }

arg_types = {'this': True, 'kind': True, 'files': False, 'credentials': False, 'format': False, 'params': False}
key = 'copy'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DML
  returning

class Credentials(Expression): View Source

    2224class Credentials(Expression):
    2225    arg_types = {
    2226        "credentials": False,
    2227        "encryption": False,
    2228        "storage": False,
    2229        "iam_role": False,
    2230        "region": False,
    2231    }

arg_types = {'credentials': False, 'encryption': False, 'storage': False, 'iam_role': False, 'region': False}
key = 'credentials'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Prior(Expression): View Source

    2234class Prior(Expression):
    2235    pass

key = 'prior'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Directory(Expression): View Source

    2238class Directory(Expression):
    2239    # https://spark.apache.org/docs/3.0.0-preview/sql-ref-syntax-dml-insert-overwrite-directory-hive.html
    2240    arg_types = {"this": True, "local": False, "row_format": False}

arg_types = {'this': True, 'local': False, 'row_format': False}
key = 'directory'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ForeignKey(Expression): View Source

    2243class ForeignKey(Expression):
    2244    arg_types = {
    2245        "expressions": False,
    2246        "reference": False,
    2247        "delete": False,
    2248        "update": False,
    2249        "options": False,
    2250    }

arg_types = {'expressions': False, 'reference': False, 'delete': False, 'update': False, 'options': False}
key = 'foreignkey'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ColumnPrefix(Expression): View Source

    2253class ColumnPrefix(Expression):
    2254    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'columnprefix'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PrimaryKey(Expression): View Source

    2257class PrimaryKey(Expression):
    2258    arg_types = {"expressions": True, "options": False, "include": False}

arg_types = {'expressions': True, 'options': False, 'include': False}
key = 'primarykey'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Into(Expression): View Source

    2263class Into(Expression):
    2264    arg_types = {
    2265        "this": False,
    2266        "temporary": False,
    2267        "unlogged": False,
    2268        "bulk_collect": False,
    2269        "expressions": False,
    2270    }

arg_types = {'this': False, 'temporary': False, 'unlogged': False, 'bulk_collect': False, 'expressions': False}
key = 'into'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class From(Expression): View Source

    2273class From(Expression):
    2274    @property
    2275    def name(self) -> str:
    2276        return self.this.name
    2277
    2278    @property
    2279    def alias_or_name(self) -> str:
    2280        return self.this.alias_or_name

name: str View Source

    2274    @property
    2275    def name(self) -> str:
    2276        return self.this.name

alias_or_name: str View Source

    2278    @property
    2279    def alias_or_name(self) -> str:
    2280        return self.this.alias_or_name

key = 'from'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Having(Expression): View Source

    2283class Having(Expression):
    2284    pass

key = 'having'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Hint(Expression): View Source

    2287class Hint(Expression):
    2288    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'hint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JoinHint(Expression): View Source

    2291class JoinHint(Expression):
    2292    arg_types = {"this": True, "expressions": True}

arg_types = {'this': True, 'expressions': True}
key = 'joinhint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Identifier(Expression): View Source

    2295class Identifier(Expression):
    2296    arg_types = {"this": True, "quoted": False, "global": False, "temporary": False}
    2297
    2298    @property
    2299    def quoted(self) -> bool:
    2300        return bool(self.args.get("quoted"))
    2301
    2302    @property
    2303    def hashable_args(self) -> t.Any:
    2304        return (self.this, self.quoted)
    2305
    2306    @property
    2307    def output_name(self) -> str:
    2308        return self.name

arg_types = {'this': True, 'quoted': False, 'global': False, 'temporary': False}
quoted: bool View Source

    2298    @property
    2299    def quoted(self) -> bool:
    2300        return bool(self.args.get("quoted"))

hashable_args: Any View Source

    2302    @property
    2303    def hashable_args(self) -> t.Any:
    2304        return (self.this, self.quoted)

output_name: str View Source

    2306    @property
    2307    def output_name(self) -> str:
    2308        return self.name

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

key = 'identifier'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Opclass(Expression): View Source

    2312class Opclass(Expression):
    2313    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'opclass'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Index(Expression): View Source

    2316class Index(Expression):
    2317    arg_types = {
    2318        "this": False,
    2319        "table": False,
    2320        "unique": False,
    2321        "primary": False,
    2322        "amp": False,  # teradata
    2323        "params": False,
    2324    }

arg_types = {'this': False, 'table': False, 'unique': False, 'primary': False, 'amp': False, 'params': False}
key = 'index'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class IndexParameters(Expression): View Source

    2327class IndexParameters(Expression):
    2328    arg_types = {
    2329        "using": False,
    2330        "include": False,
    2331        "columns": False,
    2332        "with_storage": False,
    2333        "partition_by": False,
    2334        "tablespace": False,
    2335        "where": False,
    2336        "on": False,
    2337    }

arg_types = {'using': False, 'include': False, 'columns': False, 'with_storage': False, 'partition_by': False, 'tablespace': False, 'where': False, 'on': False}
key = 'indexparameters'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Insert(DDL, DML): View Source

    2340class Insert(DDL, DML):
    2341    arg_types = {
    2342        "hint": False,
    2343        "with": False,
    2344        "is_function": False,
    2345        "this": False,
    2346        "expression": False,
    2347        "conflict": False,
    2348        "returning": False,
    2349        "overwrite": False,
    2350        "exists": False,
    2351        "alternative": False,
    2352        "where": False,
    2353        "ignore": False,
    2354        "by_name": False,
    2355        "stored": False,
    2356        "partition": False,
    2357        "settings": False,
    2358        "source": False,
    2359    }
    2360
    2361    def with_(
    2362        self,
    2363        alias: ExpOrStr,
    2364        as_: ExpOrStr,
    2365        recursive: t.Optional[bool] = None,
    2366        materialized: t.Optional[bool] = None,
    2367        append: bool = True,
    2368        dialect: DialectType = None,
    2369        copy: bool = True,
    2370        **opts,
    2371    ) -> Insert:
    2372        """
    2373        Append to or set the common table expressions.
    2374
    2375        Example:
    2376            >>> insert("SELECT x FROM cte", "t").with_("cte", as_="SELECT * FROM tbl").sql()
    2377            'WITH cte AS (SELECT * FROM tbl) INSERT INTO t SELECT x FROM cte'
    2378
    2379        Args:
    2380            alias: the SQL code string to parse as the table name.
    2381                If an `Expression` instance is passed, this is used as-is.
    2382            as_: the SQL code string to parse as the table expression.
    2383                If an `Expression` instance is passed, it will be used as-is.
    2384            recursive: set the RECURSIVE part of the expression. Defaults to `False`.
    2385            materialized: set the MATERIALIZED part of the expression.
    2386            append: if `True`, add to any existing expressions.
    2387                Otherwise, this resets the expressions.
    2388            dialect: the dialect used to parse the input expression.
    2389            copy: if `False`, modify this expression instance in-place.
    2390            opts: other options to use to parse the input expressions.
    2391
    2392        Returns:
    2393            The modified expression.
    2394        """
    2395        return _apply_cte_builder(
    2396            self,
    2397            alias,
    2398            as_,
    2399            recursive=recursive,
    2400            materialized=materialized,
    2401            append=append,
    2402            dialect=dialect,
    2403            copy=copy,
    2404            **opts,
    2405        )

arg_types = {'hint': False, 'with': False, 'is_function': False, 'this': False, 'expression': False, 'conflict': False, 'returning': False, 'overwrite': False, 'exists': False, 'alternative': False, 'where': False, 'ignore': False, 'by_name': False, 'stored': False, 'partition': False, 'settings': False, 'source': False}
def with_( self, alias: Union[str, Expression], as_: Union[str, Expression], recursive: Optional[bool] = None, materialized: Optional[bool] = None, append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Insert: View Source

    2361    def with_(
    2362        self,
    2363        alias: ExpOrStr,
    2364        as_: ExpOrStr,
    2365        recursive: t.Optional[bool] = None,
    2366        materialized: t.Optional[bool] = None,
    2367        append: bool = True,
    2368        dialect: DialectType = None,
    2369        copy: bool = True,
    2370        **opts,
    2371    ) -> Insert:
    2372        """
    2373        Append to or set the common table expressions.
    2374
    2375        Example:
    2376            >>> insert("SELECT x FROM cte", "t").with_("cte", as_="SELECT * FROM tbl").sql()
    2377            'WITH cte AS (SELECT * FROM tbl) INSERT INTO t SELECT x FROM cte'
    2378
    2379        Args:
    2380            alias: the SQL code string to parse as the table name.
    2381                If an `Expression` instance is passed, this is used as-is.
    2382            as_: the SQL code string to parse as the table expression.
    2383                If an `Expression` instance is passed, it will be used as-is.
    2384            recursive: set the RECURSIVE part of the expression. Defaults to `False`.
    2385            materialized: set the MATERIALIZED part of the expression.
    2386            append: if `True`, add to any existing expressions.
    2387                Otherwise, this resets the expressions.
    2388            dialect: the dialect used to parse the input expression.
    2389            copy: if `False`, modify this expression instance in-place.
    2390            opts: other options to use to parse the input expressions.
    2391
    2392        Returns:
    2393            The modified expression.
    2394        """
    2395        return _apply_cte_builder(
    2396            self,
    2397            alias,
    2398            as_,
    2399            recursive=recursive,
    2400            materialized=materialized,
    2401            append=append,
    2402            dialect=dialect,
    2403            copy=copy,
    2404            **opts,
    2405        )

Append to or set the common table expressions.

###### Example:

>     >>> insert("SELECT x FROM cte", "t").with_("cte", as_="SELECT * FROM tbl").sql()
>     'WITH cte AS (SELECT * FROM tbl) INSERT INTO t SELECT x FROM cte'

###### Arguments:

- alias: the SQL code string to parse as the table name. If an `Expression` instance is passed, this is used as-is.
- as_: the SQL code string to parse as the table expression. If an `Expression` instance is passed, it will be used as-is.
- recursive: set the RECURSIVE part of the expression. Defaults to `False`.
- materialized: set the MATERIALIZED part of the expression.
- append: if `True`, add to any existing expressions. Otherwise, this resets the expressions.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified expression.

key = 'insert'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DDL
  ctes
  selects
  named_selects
DML
  returning

class ConditionalInsert(Expression): View Source

    2408class ConditionalInsert(Expression):
    2409    arg_types = {"this": True, "expression": False, "else_": False}

arg_types = {'this': True, 'expression': False, 'else_': False}
key = 'conditionalinsert'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class MultitableInserts(Expression): View Source

    2412class MultitableInserts(Expression):
    2413    arg_types = {"expressions": True, "kind": True, "source": True}

arg_types = {'expressions': True, 'kind': True, 'source': True}
key = 'multitableinserts'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class OnConflict(Expression): View Source

    2416class OnConflict(Expression):
    2417    arg_types = {
    2418        "duplicate": False,
    2419        "expressions": False,
    2420        "action": False,
    2421        "conflict_keys": False,
    2422        "constraint": False,
    2423        "where": False,
    2424    }

arg_types = {'duplicate': False, 'expressions': False, 'action': False, 'conflict_keys': False, 'constraint': False, 'where': False}
key = 'onconflict'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class OnCondition(Expression): View Source

    2427class OnCondition(Expression):
    2428    arg_types = {"error": False, "empty": False, "null": False}

arg_types = {'error': False, 'empty': False, 'null': False}
key = 'oncondition'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Returning(Expression): View Source

    2431class Returning(Expression):
    2432    arg_types = {"expressions": True, "into": False}

arg_types = {'expressions': True, 'into': False}
key = 'returning'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Introducer(Expression): View Source

    2436class Introducer(Expression):
    2437    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'introducer'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class National(Expression): View Source

    2441class National(Expression):
    2442    pass

key = 'national'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class LoadData(Expression): View Source

    2445class LoadData(Expression):
    2446    arg_types = {
    2447        "this": True,
    2448        "local": False,
    2449        "overwrite": False,
    2450        "inpath": True,
    2451        "partition": False,
    2452        "input_format": False,
    2453        "serde": False,
    2454    }

arg_types = {'this': True, 'local': False, 'overwrite': False, 'inpath': True, 'partition': False, 'input_format': False, 'serde': False}
key = 'loaddata'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Partition(Expression): View Source

    2457class Partition(Expression):
    2458    arg_types = {"expressions": True, "subpartition": False}

arg_types = {'expressions': True, 'subpartition': False}
key = 'partition'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionRange(Expression): View Source

    2461class PartitionRange(Expression):
    2462    arg_types = {"this": True, "expression": False, "expressions": False}

arg_types = {'this': True, 'expression': False, 'expressions': False}
key = 'partitionrange'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionId(Expression): View Source

    2466class PartitionId(Expression):
    2467    pass

key = 'partitionid'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Fetch(Expression): View Source

    2470class Fetch(Expression):
    2471    arg_types = {
    2472        "direction": False,
    2473        "count": False,
    2474        "limit_options": False,
    2475    }

arg_types = {'direction': False, 'count': False, 'limit_options': False}
key = 'fetch'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Grant(Expression): View Source

    2478class Grant(Expression):
    2479    arg_types = {
    2480        "privileges": True,
    2481        "kind": False,
    2482        "securable": True,
    2483        "principals": True,
    2484        "grant_option": False,
    2485    }

arg_types = {'privileges': True, 'kind': False, 'securable': True, 'principals': True, 'grant_option': False}
key = 'grant'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Revoke(Expression): View Source

    2488class Revoke(Expression):
    2489    arg_types = {**Grant.arg_types, "cascade": False}

arg_types = {'privileges': True, 'kind': False, 'securable': True, 'principals': True, 'grant_option': False, 'cascade': False}
key = 'revoke'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Group(Expression): View Source

    2492class Group(Expression):
    2493    arg_types = {
    2494        "expressions": False,
    2495        "grouping_sets": False,
    2496        "cube": False,
    2497        "rollup": False,
    2498        "totals": False,
    2499        "all": False,
    2500    }

arg_types = {'expressions': False, 'grouping_sets': False, 'cube': False, 'rollup': False, 'totals': False, 'all': False}
key = 'group'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Cube(Expression): View Source

    2503class Cube(Expression):
    2504    arg_types = {"expressions": False}

arg_types = {'expressions': False}
key = 'cube'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Rollup(Expression): View Source

    2507class Rollup(Expression):
    2508    arg_types = {"expressions": False}

arg_types = {'expressions': False}
key = 'rollup'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class GroupingSets(Expression): View Source

    2511class GroupingSets(Expression):
    2512    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'groupingsets'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Lambda(Expression): View Source

    2515class Lambda(Expression):
    2516    arg_types = {"this": True, "expressions": True, "colon": False}

arg_types = {'this': True, 'expressions': True, 'colon': False}
key = 'lambda'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Limit(Expression): View Source

    2519class Limit(Expression):
    2520    arg_types = {
    2521        "this": False,
    2522        "expression": True,
    2523        "offset": False,
    2524        "limit_options": False,
    2525        "expressions": False,
    2526    }

arg_types = {'this': False, 'expression': True, 'offset': False, 'limit_options': False, 'expressions': False}
key = 'limit'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class LimitOptions(Expression): View Source

    2529class LimitOptions(Expression):
    2530    arg_types = {
    2531        "percent": False,
    2532        "rows": False,
    2533        "with_ties": False,
    2534    }

arg_types = {'percent': False, 'rows': False, 'with_ties': False}
key = 'limitoptions'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Literal(Condition): View Source

    2537class Literal(Condition):
    2538    arg_types = {"this": True, "is_string": True}
    2539
    2540    @property
    2541    def hashable_args(self) -> t.Any:
    2542        return (self.this, self.args.get("is_string"))
    2543
    2544    @classmethod
    2545    def number(cls, number) -> Literal:
    2546        return cls(this=str(number), is_string=False)
    2547
    2548    @classmethod
    2549    def string(cls, string) -> Literal:
    2550        return cls(this=str(string), is_string=True)
    2551
    2552    @property
    2553    def output_name(self) -> str:
    2554        return self.name
    2555
    2556    def to_py(self) -> int | str | Decimal:
    2557        if self.is_number:
    2558            try:
    2559                return int(self.this)
    2560            except ValueError:
    2561                return Decimal(self.this)
    2562        return self.this

arg_types = {'this': True, 'is_string': True}
hashable_args: Any View Source

    2540    @property
    2541    def hashable_args(self) -> t.Any:
    2542        return (self.this, self.args.get("is_string"))

@classmethod
def number(cls, number) -> Literal: View Source

    2544    @classmethod
    2545    def number(cls, number) -> Literal:
    2546        return cls(this=str(number), is_string=False)

@classmethod
def string(cls, string) -> Literal: View Source

    2548    @classmethod
    2549    def string(cls, string) -> Literal:
    2550        return cls(this=str(string), is_string=True)

output_name: str View Source

    2552    @property
    2553    def output_name(self) -> str:
    2554        return self.name

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

def to_py(self) -> int | str | decimal.Decimal: View Source

    2556    def to_py(self) -> int | str | Decimal:
    2557        if self.is_number:
    2558            try:
    2559                return int(self.this)
    2560            except ValueError:
    2561                return Decimal(self.this)
    2562        return self.this

Returns a Python object equivalent of the SQL node.

key = 'literal'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  this
  expression
  expressions
  text
  is_string
  is_number
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Join(Expression): View Source

    2565class Join(Expression):
    2566    arg_types = {
    2567        "this": True,
    2568        "on": False,
    2569        "side": False,
    2570        "kind": False,
    2571        "using": False,
    2572        "method": False,
    2573        "global": False,
    2574        "hint": False,
    2575        "match_condition": False,  # Snowflake
    2576        "expressions": False,
    2577        "pivots": False,
    2578    }
    2579
    2580    @property
    2581    def method(self) -> str:
    2582        return self.text("method").upper()
    2583
    2584    @property
    2585    def kind(self) -> str:
    2586        return self.text("kind").upper()
    2587
    2588    @property
    2589    def side(self) -> str:
    2590        return self.text("side").upper()
    2591
    2592    @property
    2593    def hint(self) -> str:
    2594        return self.text("hint").upper()
    2595
    2596    @property
    2597    def alias_or_name(self) -> str:
    2598        return self.this.alias_or_name
    2599
    2600    @property
    2601    def is_semi_or_anti_join(self) -> bool:
    2602        return self.kind in ("SEMI", "ANTI")
    2603
    2604    def on(
    2605        self,
    2606        *expressions: t.Optional[ExpOrStr],
    2607        append: bool = True,
    2608        dialect: DialectType = None,
    2609        copy: bool = True,
    2610        **opts,
    2611    ) -> Join:
    2612        """
    2613        Append to or set the ON expressions.
    2614
    2615        Example:
    2616            >>> import sqlglot
    2617            >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()
    2618            'JOIN x ON y = 1'
    2619
    2620        Args:
    2621            *expressions: the SQL code strings to parse.
    2622                If an `Expression` instance is passed, it will be used as-is.
    2623                Multiple expressions are combined with an AND operator.
    2624            append: if `True`, AND the new expressions to any existing expression.
    2625                Otherwise, this resets the expression.
    2626            dialect: the dialect used to parse the input expressions.
    2627            copy: if `False`, modify this expression instance in-place.
    2628            opts: other options to use to parse the input expressions.
    2629
    2630        Returns:
    2631            The modified Join expression.
    2632        """
    2633        join = _apply_conjunction_builder(
    2634            *expressions,
    2635            instance=self,
    2636            arg="on",
    2637            append=append,
    2638            dialect=dialect,
    2639            copy=copy,
    2640            **opts,
    2641        )
    2642
    2643        if join.kind == "CROSS":
    2644            join.set("kind", None)
    2645
    2646        return join
    2647
    2648    def using(
    2649        self,
    2650        *expressions: t.Optional[ExpOrStr],
    2651        append: bool = True,
    2652        dialect: DialectType = None,
    2653        copy: bool = True,
    2654        **opts,
    2655    ) -> Join:
    2656        """
    2657        Append to or set the USING expressions.
    2658
    2659        Example:
    2660            >>> import sqlglot
    2661            >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()
    2662            'JOIN x USING (foo, bla)'
    2663
    2664        Args:
    2665            *expressions: the SQL code strings to parse.
    2666                If an `Expression` instance is passed, it will be used as-is.
    2667            append: if `True`, concatenate the new expressions to the existing "using" list.
    2668                Otherwise, this resets the expression.
    2669            dialect: the dialect used to parse the input expressions.
    2670            copy: if `False`, modify this expression instance in-place.
    2671            opts: other options to use to parse the input expressions.
    2672
    2673        Returns:
    2674            The modified Join expression.
    2675        """
    2676        join = _apply_list_builder(
    2677            *expressions,
    2678            instance=self,
    2679            arg="using",
    2680            append=append,
    2681            dialect=dialect,
    2682            copy=copy,
    2683            **opts,
    2684        )
    2685
    2686        if join.kind == "CROSS":
    2687            join.set("kind", None)
    2688
    2689        return join

arg_types = {'this': True, 'on': False, 'side': False, 'kind': False, 'using': False, 'method': False, 'global': False, 'hint': False, 'match_condition': False, 'expressions': False, 'pivots': False}
method: str View Source

    2580    @property
    2581    def method(self) -> str:
    2582        return self.text("method").upper()

kind: str View Source

    2584    @property
    2585    def kind(self) -> str:
    2586        return self.text("kind").upper()

side: str View Source

    2588    @property
    2589    def side(self) -> str:
    2590        return self.text("side").upper()

hint: str View Source

    2592    @property
    2593    def hint(self) -> str:
    2594        return self.text("hint").upper()

alias_or_name: str View Source

    2596    @property
    2597    def alias_or_name(self) -> str:
    2598        return self.this.alias_or_name

is_semi_or_anti_join: bool View Source

    2600    @property
    2601    def is_semi_or_anti_join(self) -> bool:
    2602        return self.kind in ("SEMI", "ANTI")

def on( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Join: View Source

    2604    def on(
    2605        self,
    2606        *expressions: t.Optional[ExpOrStr],
    2607        append: bool = True,
    2608        dialect: DialectType = None,
    2609        copy: bool = True,
    2610        **opts,
    2611    ) -> Join:
    2612        """
    2613        Append to or set the ON expressions.
    2614
    2615        Example:
    2616            >>> import sqlglot
    2617            >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()
    2618            'JOIN x ON y = 1'
    2619
    2620        Args:
    2621            *expressions: the SQL code strings to parse.
    2622                If an `Expression` instance is passed, it will be used as-is.
    2623                Multiple expressions are combined with an AND operator.
    2624            append: if `True`, AND the new expressions to any existing expression.
    2625                Otherwise, this resets the expression.
    2626            dialect: the dialect used to parse the input expressions.
    2627            copy: if `False`, modify this expression instance in-place.
    2628            opts: other options to use to parse the input expressions.
    2629
    2630        Returns:
    2631            The modified Join expression.
    2632        """
    2633        join = _apply_conjunction_builder(
    2634            *expressions,
    2635            instance=self,
    2636            arg="on",
    2637            append=append,
    2638            dialect=dialect,
    2639            copy=copy,
    2640            **opts,
    2641        )
    2642
    2643        if join.kind == "CROSS":
    2644            join.set("kind", None)
    2645
    2646        return join

Append to or set the ON expressions.

###### Example:

>     >>> import sqlglot
>     >>> sqlglot.parse_one("JOIN x", into=Join).on("y = 1").sql()
>     'JOIN x ON y = 1'

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is. Multiple expressions are combined with an AND operator.
- append: if `True`, AND the new expressions to any existing expression. Otherwise, this resets the expression.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Join expression.

def using( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Join: View Source

    2648    def using(
    2649        self,
    2650        *expressions: t.Optional[ExpOrStr],
    2651        append: bool = True,
    2652        dialect: DialectType = None,
    2653        copy: bool = True,
    2654        **opts,
    2655    ) -> Join:
    2656        """
    2657        Append to or set the USING expressions.
    2658
    2659        Example:
    2660            >>> import sqlglot
    2661            >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()
    2662            'JOIN x USING (foo, bla)'
    2663
    2664        Args:
    2665            *expressions: the SQL code strings to parse.
    2666                If an `Expression` instance is passed, it will be used as-is.
    2667            append: if `True`, concatenate the new expressions to the existing "using" list.
    2668                Otherwise, this resets the expression.
    2669            dialect: the dialect used to parse the input expressions.
    2670            copy: if `False`, modify this expression instance in-place.
    2671            opts: other options to use to parse the input expressions.
    2672
    2673        Returns:
    2674            The modified Join expression.
    2675        """
    2676        join = _apply_list_builder(
    2677            *expressions,
    2678            instance=self,
    2679            arg="using",
    2680            append=append,
    2681            dialect=dialect,
    2682            copy=copy,
    2683            **opts,
    2684        )
    2685
    2686        if join.kind == "CROSS":
    2687            join.set("kind", None)
    2688
    2689        return join

Append to or set the USING expressions.

###### Example:

>     >>> import sqlglot
>     >>> sqlglot.parse_one("JOIN x", into=Join).using("foo", "bla").sql()
>     'JOIN x USING (foo, bla)'

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is.
- append: if `True`, concatenate the new expressions to the existing "using" list. Otherwise, this resets the expression.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Join expression.

key = 'join'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Lateral(UDTF): View Source

    2692class Lateral(UDTF):
    2693    arg_types = {
    2694        "this": True,
    2695        "view": False,
    2696        "outer": False,
    2697        "alias": False,
    2698        "cross_apply": False,  # True -> CROSS APPLY, False -> OUTER APPLY
    2699        "ordinality": False,
    2700    }

arg_types = {'this': True, 'view': False, 'outer': False, 'alias': False, 'cross_apply': False, 'ordinality': False}
key = 'lateral'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
UDTF
  selects
DerivedTable
  named_selects

class TableFromRows(UDTF): View Source

    2705class TableFromRows(UDTF):
    2706    arg_types = {
    2707        "this": True,
    2708        "alias": False,
    2709        "joins": False,
    2710        "pivots": False,
    2711        "sample": False,
    2712    }

arg_types = {'this': True, 'alias': False, 'joins': False, 'pivots': False, 'sample': False}
key = 'tablefromrows'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
UDTF
  selects
DerivedTable
  named_selects

class MatchRecognizeMeasure(Expression): View Source

    2715class MatchRecognizeMeasure(Expression):
    2716    arg_types = {
    2717        "this": True,
    2718        "window_frame": False,
    2719    }

arg_types = {'this': True, 'window_frame': False}
key = 'matchrecognizemeasure'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class MatchRecognize(Expression): View Source

    2722class MatchRecognize(Expression):
    2723    arg_types = {
    2724        "partition_by": False,
    2725        "order": False,
    2726        "measures": False,
    2727        "rows": False,
    2728        "after": False,
    2729        "pattern": False,
    2730        "define": False,
    2731        "alias": False,
    2732    }

arg_types = {'partition_by': False, 'order': False, 'measures': False, 'rows': False, 'after': False, 'pattern': False, 'define': False, 'alias': False}
key = 'matchrecognize'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Final(Expression): View Source

    2737class Final(Expression):
    2738    pass

key = 'final'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Offset(Expression): View Source

    2741class Offset(Expression):
    2742    arg_types = {"this": False, "expression": True, "expressions": False}

arg_types = {'this': False, 'expression': True, 'expressions': False}
key = 'offset'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Order(Expression): View Source

    2745class Order(Expression):
    2746    arg_types = {"this": False, "expressions": True, "siblings": False}

arg_types = {'this': False, 'expressions': True, 'siblings': False}
key = 'order'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WithFill(Expression): View Source

    2750class WithFill(Expression):
    2751    arg_types = {
    2752        "from": False,
    2753        "to": False,
    2754        "step": False,
    2755        "interpolate": False,
    2756    }

arg_types = {'from': False, 'to': False, 'step': False, 'interpolate': False}
key = 'withfill'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Cluster(Order): View Source

    2761class Cluster(Order):
    2762    pass

key = 'cluster'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Order
  arg_types

class Distribute(Order): View Source

    2765class Distribute(Order):
    2766    pass

key = 'distribute'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Order
  arg_types

class Sort(Order): View Source

    2769class Sort(Order):
    2770    pass

key = 'sort'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Order
  arg_types

class Ordered(Expression): View Source

    2773class Ordered(Expression):
    2774    arg_types = {"this": True, "desc": False, "nulls_first": True, "with_fill": False}
    2775
    2776    @property
    2777    def name(self) -> str:
    2778        return self.this.name

arg_types = {'this': True, 'desc': False, 'nulls_first': True, 'with_fill': False}
name: str View Source

    2776    @property
    2777    def name(self) -> str:
    2778        return self.this.name

key = 'ordered'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Property(Expression): View Source

    2781class Property(Expression):
    2782    arg_types = {"this": True, "value": True}

arg_types = {'this': True, 'value': True}
key = 'property'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class GrantPrivilege(Expression): View Source

    2785class GrantPrivilege(Expression):
    2786    arg_types = {"this": True, "expressions": False}

arg_types = {'this': True, 'expressions': False}
key = 'grantprivilege'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class GrantPrincipal(Expression): View Source

    2789class GrantPrincipal(Expression):
    2790    arg_types = {"this": True, "kind": False}

arg_types = {'this': True, 'kind': False}
key = 'grantprincipal'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AllowedValuesProperty(Expression): View Source

    2793class AllowedValuesProperty(Expression):
    2794    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'allowedvaluesproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AlgorithmProperty(Property): View Source

    2797class AlgorithmProperty(Property):
    2798    arg_types = {"this": True}

arg_types = {'this': True}
key = 'algorithmproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AutoIncrementProperty(Property): View Source

    2801class AutoIncrementProperty(Property):
    2802    arg_types = {"this": True}

arg_types = {'this': True}
key = 'autoincrementproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AutoRefreshProperty(Property): View Source

    2806class AutoRefreshProperty(Property):
    2807    arg_types = {"this": True}

arg_types = {'this': True}
key = 'autorefreshproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class BackupProperty(Property): View Source

    2810class BackupProperty(Property):
    2811    arg_types = {"this": True}

arg_types = {'this': True}
key = 'backupproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class BuildProperty(Property): View Source

    2815class BuildProperty(Property):
    2816    arg_types = {"this": True}

arg_types = {'this': True}
key = 'buildproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class BlockCompressionProperty(Property): View Source

    2819class BlockCompressionProperty(Property):
    2820    arg_types = {
    2821        "autotemp": False,
    2822        "always": False,
    2823        "default": False,
    2824        "manual": False,
    2825        "never": False,
    2826    }

arg_types = {'autotemp': False, 'always': False, 'default': False, 'manual': False, 'never': False}
key = 'blockcompressionproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CharacterSetProperty(Property): View Source

    2829class CharacterSetProperty(Property):
    2830    arg_types = {"this": True, "default": True}

arg_types = {'this': True, 'default': True}
key = 'charactersetproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ChecksumProperty(Property): View Source

    2833class ChecksumProperty(Property):
    2834    arg_types = {"on": False, "default": False}

arg_types = {'on': False, 'default': False}
key = 'checksumproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CollateProperty(Property): View Source

    2837class CollateProperty(Property):
    2838    arg_types = {"this": True, "default": False}

arg_types = {'this': True, 'default': False}
key = 'collateproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CopyGrantsProperty(Property): View Source

    2841class CopyGrantsProperty(Property):
    2842    arg_types = {}

arg_types = {}
key = 'copygrantsproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DataBlocksizeProperty(Property): View Source

    2845class DataBlocksizeProperty(Property):
    2846    arg_types = {
    2847        "size": False,
    2848        "units": False,
    2849        "minimum": False,
    2850        "maximum": False,
    2851        "default": False,
    2852    }

arg_types = {'size': False, 'units': False, 'minimum': False, 'maximum': False, 'default': False}
key = 'datablocksizeproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DataDeletionProperty(Property): View Source

    2855class DataDeletionProperty(Property):
    2856    arg_types = {"on": True, "filter_col": False, "retention_period": False}

arg_types = {'on': True, 'filter_col': False, 'retention_period': False}
key = 'datadeletionproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DefinerProperty(Property): View Source

    2859class DefinerProperty(Property):
    2860    arg_types = {"this": True}

arg_types = {'this': True}
key = 'definerproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DistKeyProperty(Property): View Source

    2863class DistKeyProperty(Property):
    2864    arg_types = {"this": True}

arg_types = {'this': True}
key = 'distkeyproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DistributedByProperty(Property): View Source

    2869class DistributedByProperty(Property):
    2870    arg_types = {"expressions": False, "kind": True, "buckets": False, "order": False}

arg_types = {'expressions': False, 'kind': True, 'buckets': False, 'order': False}
key = 'distributedbyproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DistStyleProperty(Property): View Source

    2873class DistStyleProperty(Property):
    2874    arg_types = {"this": True}

arg_types = {'this': True}
key = 'diststyleproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DuplicateKeyProperty(Property): View Source

    2877class DuplicateKeyProperty(Property):
    2878    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'duplicatekeyproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class EngineProperty(Property): View Source

    2881class EngineProperty(Property):
    2882    arg_types = {"this": True}

arg_types = {'this': True}
key = 'engineproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class HeapProperty(Property): View Source

    2885class HeapProperty(Property):
    2886    arg_types = {}

arg_types = {}
key = 'heapproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ToTableProperty(Property): View Source

    2889class ToTableProperty(Property):
    2890    arg_types = {"this": True}

arg_types = {'this': True}
key = 'totableproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ExecuteAsProperty(Property): View Source

    2893class ExecuteAsProperty(Property):
    2894    arg_types = {"this": True}

arg_types = {'this': True}
key = 'executeasproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ExternalProperty(Property): View Source

    2897class ExternalProperty(Property):
    2898    arg_types = {"this": False}

arg_types = {'this': False}
key = 'externalproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class FallbackProperty(Property): View Source

    2901class FallbackProperty(Property):
    2902    arg_types = {"no": True, "protection": False}

arg_types = {'no': True, 'protection': False}
key = 'fallbackproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class FileFormatProperty(Property): View Source

    2906class FileFormatProperty(Property):
    2907    arg_types = {"this": False, "expressions": False, "hive_format": False}

arg_types = {'this': False, 'expressions': False, 'hive_format': False}
key = 'fileformatproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class CredentialsProperty(Property): View Source

    2910class CredentialsProperty(Property):
    2911    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'credentialsproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class FreespaceProperty(Property): View Source

    2914class FreespaceProperty(Property):
    2915    arg_types = {"this": True, "percent": False}

arg_types = {'this': True, 'percent': False}
key = 'freespaceproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class GlobalProperty(Property): View Source

    2918class GlobalProperty(Property):
    2919    arg_types = {}

arg_types = {}
key = 'globalproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class IcebergProperty(Property): View Source

    2922class IcebergProperty(Property):
    2923    arg_types = {}

arg_types = {}
key = 'icebergproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class InheritsProperty(Property): View Source

    2926class InheritsProperty(Property):
    2927    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'inheritsproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class InputModelProperty(Property): View Source

    2930class InputModelProperty(Property):
    2931    arg_types = {"this": True}

arg_types = {'this': True}
key = 'inputmodelproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class OutputModelProperty(Property): View Source

    2934class OutputModelProperty(Property):
    2935    arg_types = {"this": True}

arg_types = {'this': True}
key = 'outputmodelproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class IsolatedLoadingProperty(Property): View Source

    2938class IsolatedLoadingProperty(Property):
    2939    arg_types = {"no": False, "concurrent": False, "target": False}

arg_types = {'no': False, 'concurrent': False, 'target': False}
key = 'isolatedloadingproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JournalProperty(Property): View Source

    2942class JournalProperty(Property):
    2943    arg_types = {
    2944        "no": False,
    2945        "dual": False,
    2946        "before": False,
    2947        "local": False,
    2948        "after": False,
    2949    }

arg_types = {'no': False, 'dual': False, 'before': False, 'local': False, 'after': False}
key = 'journalproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class LanguageProperty(Property): View Source

    2952class LanguageProperty(Property):
    2953    arg_types = {"this": True}

arg_types = {'this': True}
key = 'languageproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class EnviromentProperty(Property): View Source

    2956class EnviromentProperty(Property):
    2957    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'enviromentproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ClusteredByProperty(Property): View Source

    2961class ClusteredByProperty(Property):
    2962    arg_types = {"expressions": True, "sorted_by": False, "buckets": True}

arg_types = {'expressions': True, 'sorted_by': False, 'buckets': True}
key = 'clusteredbyproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DictProperty(Property): View Source

    2965class DictProperty(Property):
    2966    arg_types = {"this": True, "kind": True, "settings": False}

arg_types = {'this': True, 'kind': True, 'settings': False}
key = 'dictproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DictSubProperty(Property): View Source

    2969class DictSubProperty(Property):
    2970    pass

key = 'dictsubproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Property
  arg_types

class DictRange(Property): View Source

    2973class DictRange(Property):
    2974    arg_types = {"this": True, "min": True, "max": True}

arg_types = {'this': True, 'min': True, 'max': True}
key = 'dictrange'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DynamicProperty(Property): View Source

    2977class DynamicProperty(Property):
    2978    arg_types = {}

arg_types = {}
key = 'dynamicproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class OnCluster(Property): View Source

    2983class OnCluster(Property):
    2984    arg_types = {"this": True}

arg_types = {'this': True}
key = 'oncluster'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class EmptyProperty(Property): View Source

    2988class EmptyProperty(Property):
    2989    arg_types = {}

arg_types = {}
key = 'emptyproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class LikeProperty(Property): View Source

    2992class LikeProperty(Property):
    2993    arg_types = {"this": True, "expressions": False}

arg_types = {'this': True, 'expressions': False}
key = 'likeproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class LocationProperty(Property): View Source

    2996class LocationProperty(Property):
    2997    arg_types = {"this": True}

arg_types = {'this': True}
key = 'locationproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class LockProperty(Property): View Source

    3000class LockProperty(Property):
    3001    arg_types = {"this": True}

arg_types = {'this': True}
key = 'lockproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class LockingProperty(Property): View Source

    3004class LockingProperty(Property):
    3005    arg_types = {
    3006        "this": False,
    3007        "kind": True,
    3008        "for_or_in": False,
    3009        "lock_type": True,
    3010        "override": False,
    3011    }

arg_types = {'this': False, 'kind': True, 'for_or_in': False, 'lock_type': True, 'override': False}
key = 'lockingproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class LogProperty(Property): View Source

    3014class LogProperty(Property):
    3015    arg_types = {"no": True}

arg_types = {'no': True}
key = 'logproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class MaterializedProperty(Property): View Source

    3018class MaterializedProperty(Property):
    3019    arg_types = {"this": False}

arg_types = {'this': False}
key = 'materializedproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class MergeBlockRatioProperty(Property): View Source

    3022class MergeBlockRatioProperty(Property):
    3023    arg_types = {"this": False, "no": False, "default": False, "percent": False}

arg_types = {'this': False, 'no': False, 'default': False, 'percent': False}
key = 'mergeblockratioproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class NoPrimaryIndexProperty(Property): View Source

    3026class NoPrimaryIndexProperty(Property):
    3027    arg_types = {}

arg_types = {}
key = 'noprimaryindexproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class OnProperty(Property): View Source

    3030class OnProperty(Property):
    3031    arg_types = {"this": True}

arg_types = {'this': True}
key = 'onproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class OnCommitProperty(Property): View Source

    3034class OnCommitProperty(Property):
    3035    arg_types = {"delete": False}

arg_types = {'delete': False}
key = 'oncommitproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionedByProperty(Property): View Source

    3038class PartitionedByProperty(Property):
    3039    arg_types = {"this": True}

arg_types = {'this': True}
key = 'partitionedbyproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionedByBucket(Property): View Source

    3042class PartitionedByBucket(Property):
    3043    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'partitionedbybucket'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionByTruncate(Property): View Source

    3046class PartitionByTruncate(Property):
    3047    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'partitionbytruncate'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionByRangeProperty(Property): View Source

    3051class PartitionByRangeProperty(Property):
    3052    arg_types = {"partition_expressions": True, "create_expressions": True}

arg_types = {'partition_expressions': True, 'create_expressions': True}
key = 'partitionbyrangeproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionByRangePropertyDynamic(Expression): View Source

    3056class PartitionByRangePropertyDynamic(Expression):
    3057    arg_types = {"this": False, "start": True, "end": True, "every": True}

arg_types = {'this': False, 'start': True, 'end': True, 'every': True}
key = 'partitionbyrangepropertydynamic'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionByListProperty(Property): View Source

    3061class PartitionByListProperty(Property):
    3062    arg_types = {"partition_expressions": True, "create_expressions": True}

arg_types = {'partition_expressions': True, 'create_expressions': True}
key = 'partitionbylistproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionList(Expression): View Source

    3066class PartitionList(Expression):
    3067    arg_types = {"this": True, "expressions": True}

arg_types = {'this': True, 'expressions': True}
key = 'partitionlist'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class RefreshTriggerProperty(Property): View Source

    3071class RefreshTriggerProperty(Property):
    3072    arg_types = {
    3073        "method": True,
    3074        "kind": False,
    3075        "every": False,
    3076        "unit": False,
    3077        "starts": False,
    3078    }

arg_types = {'method': True, 'kind': False, 'every': False, 'unit': False, 'starts': False}
key = 'refreshtriggerproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class UniqueKeyProperty(Property): View Source

    3082class UniqueKeyProperty(Property):
    3083    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'uniquekeyproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionBoundSpec(Expression): View Source

    3087class PartitionBoundSpec(Expression):
    3088    # this -> IN / MODULUS, expression -> REMAINDER, from_expressions -> FROM (...), to_expressions -> TO (...)
    3089    arg_types = {
    3090        "this": False,
    3091        "expression": False,
    3092        "from_expressions": False,
    3093        "to_expressions": False,
    3094    }

arg_types = {'this': False, 'expression': False, 'from_expressions': False, 'to_expressions': False}
key = 'partitionboundspec'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PartitionedOfProperty(Property): View Source

    3097class PartitionedOfProperty(Property):
    3098    # this -> parent_table (schema), expression -> FOR VALUES ... / DEFAULT
    3099    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'partitionedofproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class StreamingTableProperty(Property): View Source

    3102class StreamingTableProperty(Property):
    3103    arg_types = {}

arg_types = {}
key = 'streamingtableproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class RemoteWithConnectionModelProperty(Property): View Source

    3106class RemoteWithConnectionModelProperty(Property):
    3107    arg_types = {"this": True}

arg_types = {'this': True}
key = 'remotewithconnectionmodelproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ReturnsProperty(Property): View Source

    3110class ReturnsProperty(Property):
    3111    arg_types = {"this": False, "is_table": False, "table": False, "null": False}

arg_types = {'this': False, 'is_table': False, 'table': False, 'null': False}
key = 'returnsproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class StrictProperty(Property): View Source

    3114class StrictProperty(Property):
    3115    arg_types = {}

arg_types = {}
key = 'strictproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class RowFormatProperty(Property): View Source

    3118class RowFormatProperty(Property):
    3119    arg_types = {"this": True}

arg_types = {'this': True}
key = 'rowformatproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class RowFormatDelimitedProperty(Property): View Source

    3122class RowFormatDelimitedProperty(Property):
    3123    # https://cwiki.apache.org/confluence/display/hive/languagemanual+dml
    3124    arg_types = {
    3125        "fields": False,
    3126        "escaped": False,
    3127        "collection_items": False,
    3128        "map_keys": False,
    3129        "lines": False,
    3130        "null": False,
    3131        "serde": False,
    3132    }

arg_types = {'fields': False, 'escaped': False, 'collection_items': False, 'map_keys': False, 'lines': False, 'null': False, 'serde': False}
key = 'rowformatdelimitedproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class RowFormatSerdeProperty(Property): View Source

    3135class RowFormatSerdeProperty(Property):
    3136    arg_types = {"this": True, "serde_properties": False}

arg_types = {'this': True, 'serde_properties': False}
key = 'rowformatserdeproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class QueryTransform(Expression): View Source

    3140class QueryTransform(Expression):
    3141    arg_types = {
    3142        "expressions": True,
    3143        "command_script": True,
    3144        "schema": False,
    3145        "row_format_before": False,
    3146        "record_writer": False,
    3147        "row_format_after": False,
    3148        "record_reader": False,
    3149    }

arg_types = {'expressions': True, 'command_script': True, 'schema': False, 'row_format_before': False, 'record_writer': False, 'row_format_after': False, 'record_reader': False}
key = 'querytransform'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SampleProperty(Property): View Source

    3152class SampleProperty(Property):
    3153    arg_types = {"this": True}

arg_types = {'this': True}
key = 'sampleproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SecurityProperty(Property): View Source

    3157class SecurityProperty(Property):
    3158    arg_types = {"this": True}

arg_types = {'this': True}
key = 'securityproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SchemaCommentProperty(Property): View Source

    3161class SchemaCommentProperty(Property):
    3162    arg_types = {"this": True}

arg_types = {'this': True}
key = 'schemacommentproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SemanticView(Expression): View Source

    3165class SemanticView(Expression):
    3166    arg_types = {"this": True, "metrics": False, "dimensions": False, "where": False}

arg_types = {'this': True, 'metrics': False, 'dimensions': False, 'where': False}
key = 'semanticview'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SerdeProperties(Property): View Source

    3169class SerdeProperties(Property):
    3170    arg_types = {"expressions": True, "with": False}

arg_types = {'expressions': True, 'with': False}
key = 'serdeproperties'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SetProperty(Property): View Source

    3173class SetProperty(Property):
    3174    arg_types = {"multi": True}

arg_types = {'multi': True}
key = 'setproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SharingProperty(Property): View Source

    3177class SharingProperty(Property):
    3178    arg_types = {"this": False}

arg_types = {'this': False}
key = 'sharingproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SetConfigProperty(Property): View Source

    3181class SetConfigProperty(Property):
    3182    arg_types = {"this": True}

arg_types = {'this': True}
key = 'setconfigproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SettingsProperty(Property): View Source

    3185class SettingsProperty(Property):
    3186    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'settingsproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SortKeyProperty(Property): View Source

    3189class SortKeyProperty(Property):
    3190    arg_types = {"this": True, "compound": False}

arg_types = {'this': True, 'compound': False}
key = 'sortkeyproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SqlReadWriteProperty(Property): View Source

    3193class SqlReadWriteProperty(Property):
    3194    arg_types = {"this": True}

arg_types = {'this': True}
key = 'sqlreadwriteproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SqlSecurityProperty(Property): View Source

    3197class SqlSecurityProperty(Property):
    3198    arg_types = {"definer": True}

arg_types = {'definer': True}
key = 'sqlsecurityproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class StabilityProperty(Property): View Source

    3201class StabilityProperty(Property):
    3202    arg_types = {"this": True}

arg_types = {'this': True}
key = 'stabilityproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class StorageHandlerProperty(Property): View Source

    3205class StorageHandlerProperty(Property):
    3206    arg_types = {"this": True}

arg_types = {'this': True}
key = 'storagehandlerproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TemporaryProperty(Property): View Source

    3209class TemporaryProperty(Property):
    3210    arg_types = {"this": False}

arg_types = {'this': False}
key = 'temporaryproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SecureProperty(Property): View Source

    3213class SecureProperty(Property):
    3214    arg_types = {}

arg_types = {}
key = 'secureproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Tags(ColumnConstraintKind, Property): View Source

    3218class Tags(ColumnConstraintKind, Property):
    3219    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'tags'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TransformModelProperty(Property): View Source

    3222class TransformModelProperty(Property):
    3223    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'transformmodelproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TransientProperty(Property): View Source

    3226class TransientProperty(Property):
    3227    arg_types = {"this": False}

arg_types = {'this': False}
key = 'transientproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class UnloggedProperty(Property): View Source

    3230class UnloggedProperty(Property):
    3231    arg_types = {}

arg_types = {}
key = 'unloggedproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class UsingTemplateProperty(Property): View Source

    3235class UsingTemplateProperty(Property):
    3236    arg_types = {"this": True}

arg_types = {'this': True}
key = 'usingtemplateproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ViewAttributeProperty(Property): View Source

    3240class ViewAttributeProperty(Property):
    3241    arg_types = {"this": True}

arg_types = {'this': True}
key = 'viewattributeproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class VolatileProperty(Property): View Source

    3244class VolatileProperty(Property):
    3245    arg_types = {"this": False}

arg_types = {'this': False}
key = 'volatileproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WithDataProperty(Property): View Source

    3248class WithDataProperty(Property):
    3249    arg_types = {"no": True, "statistics": False}

arg_types = {'no': True, 'statistics': False}
key = 'withdataproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WithJournalTableProperty(Property): View Source

    3252class WithJournalTableProperty(Property):
    3253    arg_types = {"this": True}

arg_types = {'this': True}
key = 'withjournaltableproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WithSchemaBindingProperty(Property): View Source

    3256class WithSchemaBindingProperty(Property):
    3257    arg_types = {"this": True}

arg_types = {'this': True}
key = 'withschemabindingproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WithSystemVersioningProperty(Property): View Source

    3260class WithSystemVersioningProperty(Property):
    3261    arg_types = {
    3262        "on": False,
    3263        "this": False,
    3264        "data_consistency": False,
    3265        "retention_period": False,
    3266        "with": True,
    3267    }

arg_types = {'on': False, 'this': False, 'data_consistency': False, 'retention_period': False, 'with': True}
key = 'withsystemversioningproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WithProcedureOptions(Property): View Source

    3270class WithProcedureOptions(Property):
    3271    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'withprocedureoptions'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class EncodeProperty(Property): View Source

    3274class EncodeProperty(Property):
    3275    arg_types = {"this": True, "properties": False, "key": False}

arg_types = {'this': True, 'properties': False, 'key': False}
key = 'encodeproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class IncludeProperty(Property): View Source

    3278class IncludeProperty(Property):
    3279    arg_types = {"this": True, "alias": False, "column_def": False}

arg_types = {'this': True, 'alias': False, 'column_def': False}
key = 'includeproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ForceProperty(Property): View Source

    3282class ForceProperty(Property):
    3283    arg_types = {}

arg_types = {}
key = 'forceproperty'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Properties(Expression): View Source

    3286class Properties(Expression):
    3287    arg_types = {"expressions": True}
    3288
    3289    NAME_TO_PROPERTY = {
    3290        "ALGORITHM": AlgorithmProperty,
    3291        "AUTO_INCREMENT": AutoIncrementProperty,
    3292        "CHARACTER SET": CharacterSetProperty,
    3293        "CLUSTERED_BY": ClusteredByProperty,
    3294        "COLLATE": CollateProperty,
    3295        "COMMENT": SchemaCommentProperty,
    3296        "CREDENTIALS": CredentialsProperty,
    3297        "DEFINER": DefinerProperty,
    3298        "DISTKEY": DistKeyProperty,
    3299        "DISTRIBUTED_BY": DistributedByProperty,
    3300        "DISTSTYLE": DistStyleProperty,
    3301        "ENGINE": EngineProperty,
    3302        "EXECUTE AS": ExecuteAsProperty,
    3303        "FORMAT": FileFormatProperty,
    3304        "LANGUAGE": LanguageProperty,
    3305        "LOCATION": LocationProperty,
    3306        "LOCK": LockProperty,
    3307        "PARTITIONED_BY": PartitionedByProperty,
    3308        "RETURNS": ReturnsProperty,
    3309        "ROW_FORMAT": RowFormatProperty,
    3310        "SORTKEY": SortKeyProperty,
    3311        "ENCODE": EncodeProperty,
    3312        "INCLUDE": IncludeProperty,
    3313    }
    3314
    3315    PROPERTY_TO_NAME = {v: k for k, v in NAME_TO_PROPERTY.items()}
    3316
    3317    # CREATE property locations
    3318    # Form: schema specified
    3319    #   create [POST_CREATE]
    3320    #     table a [POST_NAME]
    3321    #     (b int) [POST_SCHEMA]
    3322    #     with ([POST_WITH])
    3323    #     index (b) [POST_INDEX]
    3324    #
    3325    # Form: alias selection
    3326    #   create [POST_CREATE]
    3327    #     table a [POST_NAME]
    3328    #     as [POST_ALIAS] (select * from b) [POST_EXPRESSION]
    3329    #     index (c) [POST_INDEX]
    3330    class Location(AutoName):
    3331        POST_CREATE = auto()
    3332        POST_NAME = auto()
    3333        POST_SCHEMA = auto()
    3334        POST_WITH = auto()
    3335        POST_ALIAS = auto()
    3336        POST_EXPRESSION = auto()
    3337        POST_INDEX = auto()
    3338        UNSUPPORTED = auto()
    3339
    3340    @classmethod
    3341    def from_dict(cls, properties_dict: t.Dict) -> Properties:
    3342        expressions = []
    3343        for key, value in properties_dict.items():
    3344            property_cls = cls.NAME_TO_PROPERTY.get(key.upper())
    3345            if property_cls:
    3346                expressions.append(property_cls(this=convert(value)))
    3347            else:
    3348                expressions.append(Property(this=Literal.string(key), value=convert(value)))
    3349
    3350        return cls(expressions=expressions)

arg_types = {'expressions': True}
NAME_TO_PROPERTY = {'ALGORITHM': <class 'AlgorithmProperty'>, 'AUTO_INCREMENT': <class 'AutoIncrementProperty'>, 'CHARACTER SET': <class 'CharacterSetProperty'>, 'CLUSTERED_BY': <class 'ClusteredByProperty'>, 'COLLATE': <class 'CollateProperty'>, 'COMMENT': <class 'SchemaCommentProperty'>, 'CREDENTIALS': <class 'CredentialsProperty'>, 'DEFINER': <class 'DefinerProperty'>, 'DISTKEY': <class 'DistKeyProperty'>, 'DISTRIBUTED_BY': <class 'DistributedByProperty'>, 'DISTSTYLE': <class 'DistStyleProperty'>, 'ENGINE': <class 'EngineProperty'>, 'EXECUTE AS': <class 'ExecuteAsProperty'>, 'FORMAT': <class 'FileFormatProperty'>, 'LANGUAGE': <class 'LanguageProperty'>, 'LOCATION': <class 'LocationProperty'>, 'LOCK': <class 'LockProperty'>, 'PARTITIONED_BY': <class 'PartitionedByProperty'>, 'RETURNS': <class 'ReturnsProperty'>, 'ROW_FORMAT': <class 'RowFormatProperty'>, 'SORTKEY': <class 'SortKeyProperty'>, 'ENCODE': <class 'EncodeProperty'>, 'INCLUDE': <class 'IncludeProperty'>}
PROPERTY_TO_NAME = {<class 'AlgorithmProperty'>: 'ALGORITHM', <class 'AutoIncrementProperty'>: 'AUTO_INCREMENT', <class 'CharacterSetProperty'>: 'CHARACTER SET', <class 'ClusteredByProperty'>: 'CLUSTERED_BY', <class 'CollateProperty'>: 'COLLATE', <class 'SchemaCommentProperty'>: 'COMMENT', <class 'CredentialsProperty'>: 'CREDENTIALS', <class 'DefinerProperty'>: 'DEFINER', <class 'DistKeyProperty'>: 'DISTKEY', <class 'DistributedByProperty'>: 'DISTRIBUTED_BY', <class 'DistStyleProperty'>: 'DISTSTYLE', <class 'EngineProperty'>: 'ENGINE', <class 'ExecuteAsProperty'>: 'EXECUTE AS', <class 'FileFormatProperty'>: 'FORMAT', <class 'LanguageProperty'>: 'LANGUAGE', <class 'LocationProperty'>: 'LOCATION', <class 'LockProperty'>: 'LOCK', <class 'PartitionedByProperty'>: 'PARTITIONED_BY', <class 'ReturnsProperty'>: 'RETURNS', <class 'RowFormatProperty'>: 'ROW_FORMAT', <class 'SortKeyProperty'>: 'SORTKEY', <class 'EncodeProperty'>: 'ENCODE', <class 'IncludeProperty'>: 'INCLUDE'}
@classmethod
def from_dict(cls, properties_dict: Dict) -> Properties: View Source

    3340    @classmethod
    3341    def from_dict(cls, properties_dict: t.Dict) -> Properties:
    3342        expressions = []
    3343        for key, value in properties_dict.items():
    3344            property_cls = cls.NAME_TO_PROPERTY.get(key.upper())
    3345            if property_cls:
    3346                expressions.append(property_cls(this=convert(value)))
    3347            else:
    3348                expressions.append(Property(this=Literal.string(key), value=convert(value)))
    3349
    3350        return cls(expressions=expressions)

key = 'properties'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Properties.Location(sqlglot.helper.AutoName): View Source

    3330    class Location(AutoName):
    3331        POST_CREATE = auto()
    3332        POST_NAME = auto()
    3333        POST_SCHEMA = auto()
    3334        POST_WITH = auto()
    3335        POST_ALIAS = auto()
    3336        POST_EXPRESSION = auto()
    3337        POST_INDEX = auto()
    3338        UNSUPPORTED = auto()

An enumeration.

POST_CREATE = <Location.POST_CREATE: 'POST_CREATE'>
POST_NAME = <Location.POST_NAME: 'POST_NAME'>
POST_SCHEMA = <Location.POST_SCHEMA: 'POST_SCHEMA'>
POST_WITH = <Location.POST_WITH: 'POST_WITH'>
POST_ALIAS = <Location.POST_ALIAS: 'POST_ALIAS'>
POST_EXPRESSION = <Location.POST_EXPRESSION: 'POST_EXPRESSION'>
POST_INDEX = <Location.POST_INDEX: 'POST_INDEX'>
UNSUPPORTED = <Location.UNSUPPORTED: 'UNSUPPORTED'>
class Qualify(Expression): View Source

    3353class Qualify(Expression):
    3354    pass

key = 'qualify'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class InputOutputFormat(Expression): View Source

    3357class InputOutputFormat(Expression):
    3358    arg_types = {"input_format": False, "output_format": False}

arg_types = {'input_format': False, 'output_format': False}
key = 'inputoutputformat'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Return(Expression): View Source

    3362class Return(Expression):
    3363    pass

key = 'return'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Reference(Expression): View Source

    3366class Reference(Expression):
    3367    arg_types = {"this": True, "expressions": False, "options": False}

arg_types = {'this': True, 'expressions': False, 'options': False}
key = 'reference'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Tuple(Expression): View Source

    3370class Tuple(Expression):
    3371    arg_types = {"expressions": False}
    3372
    3373    def isin(
    3374        self,
    3375        *expressions: t.Any,
    3376        query: t.Optional[ExpOrStr] = None,
    3377        unnest: t.Optional[ExpOrStr] | t.Collection[ExpOrStr] = None,
    3378        copy: bool = True,
    3379        **opts,
    3380    ) -> In:
    3381        return In(
    3382            this=maybe_copy(self, copy),
    3383            expressions=[convert(e, copy=copy) for e in expressions],
    3384            query=maybe_parse(query, copy=copy, **opts) if query else None,
    3385            unnest=(
    3386                Unnest(
    3387                    expressions=[
    3388                        maybe_parse(t.cast(ExpOrStr, e), copy=copy, **opts)
    3389                        for e in ensure_list(unnest)
    3390                    ]
    3391                )
    3392                if unnest
    3393                else None
    3394            ),
    3395        )

arg_types = {'expressions': False}
def isin( self, *expressions: Any, query: Union[str, Expression, NoneType] = None, unnest: Union[str, Expression, NoneType, Collection[Union[str, Expression]]] = None, copy: bool = True, **opts) -> In: View Source

    3373    def isin(
    3374        self,
    3375        *expressions: t.Any,
    3376        query: t.Optional[ExpOrStr] = None,
    3377        unnest: t.Optional[ExpOrStr] | t.Collection[ExpOrStr] = None,
    3378        copy: bool = True,
    3379        **opts,
    3380    ) -> In:
    3381        return In(
    3382            this=maybe_copy(self, copy),
    3383            expressions=[convert(e, copy=copy) for e in expressions],
    3384            query=maybe_parse(query, copy=copy, **opts) if query else None,
    3385            unnest=(
    3386                Unnest(
    3387                    expressions=[
    3388                        maybe_parse(t.cast(ExpOrStr, e), copy=copy, **opts)
    3389                        for e in ensure_list(unnest)
    3390                    ]
    3391                )
    3392                if unnest
    3393                else None
    3394            ),
    3395        )

key = 'tuple'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

QUERY_MODIFIERS = {'match': False, 'laterals': False, 'joins': False, 'connect': False, 'pivots': False, 'prewhere': False, 'where': False, 'group': False, 'having': False, 'qualify': False, 'windows': False, 'distribute': False, 'sort': False, 'cluster': False, 'order': False, 'limit': False, 'offset': False, 'locks': False, 'sample': False, 'settings': False, 'format': False, 'options': False}
class QueryOption(Expression): View Source

    3426class QueryOption(Expression):
    3427    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'queryoption'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WithTableHint(Expression): View Source

    3431class WithTableHint(Expression):
    3432    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'withtablehint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class IndexTableHint(Expression): View Source

    3436class IndexTableHint(Expression):
    3437    arg_types = {"this": True, "expressions": False, "target": False}

arg_types = {'this': True, 'expressions': False, 'target': False}
key = 'indextablehint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class HistoricalData(Expression): View Source

    3441class HistoricalData(Expression):
    3442    arg_types = {"this": True, "kind": True, "expression": True}

arg_types = {'this': True, 'kind': True, 'expression': True}
key = 'historicaldata'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Put(Expression): View Source

    3446class Put(Expression):
    3447    arg_types = {"this": True, "target": True, "properties": False}

arg_types = {'this': True, 'target': True, 'properties': False}
key = 'put'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Get(Expression): View Source

    3451class Get(Expression):
    3452    arg_types = {"this": True, "target": True, "properties": False}

arg_types = {'this': True, 'target': True, 'properties': False}
key = 'get'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Table(Expression): View Source

    3455class Table(Expression):
    3456    arg_types = {
    3457        "this": False,
    3458        "alias": False,
    3459        "db": False,
    3460        "catalog": False,
    3461        "laterals": False,
    3462        "joins": False,
    3463        "pivots": False,
    3464        "hints": False,
    3465        "system_time": False,
    3466        "version": False,
    3467        "format": False,
    3468        "pattern": False,
    3469        "ordinality": False,
    3470        "when": False,
    3471        "only": False,
    3472        "partition": False,
    3473        "changes": False,
    3474        "rows_from": False,
    3475        "sample": False,
    3476    }
    3477
    3478    @property
    3479    def name(self) -> str:
    3480        if not self.this or isinstance(self.this, Func):
    3481            return ""
    3482        return self.this.name
    3483
    3484    @property
    3485    def db(self) -> str:
    3486        return self.text("db")
    3487
    3488    @property
    3489    def catalog(self) -> str:
    3490        return self.text("catalog")
    3491
    3492    @property
    3493    def selects(self) -> t.List[Expression]:
    3494        return []
    3495
    3496    @property
    3497    def named_selects(self) -> t.List[str]:
    3498        return []
    3499
    3500    @property
    3501    def parts(self) -> t.List[Expression]:
    3502        """Return the parts of a table in order catalog, db, table."""
    3503        parts: t.List[Expression] = []
    3504
    3505        for arg in ("catalog", "db", "this"):
    3506            part = self.args.get(arg)
    3507
    3508            if isinstance(part, Dot):
    3509                parts.extend(part.flatten())
    3510            elif isinstance(part, Expression):
    3511                parts.append(part)
    3512
    3513        return parts
    3514
    3515    def to_column(self, copy: bool = True) -> Expression:
    3516        parts = self.parts
    3517        last_part = parts[-1]
    3518
    3519        if isinstance(last_part, Identifier):
    3520            col: Expression = column(*reversed(parts[0:4]), fields=parts[4:], copy=copy)  # type: ignore
    3521        else:
    3522            # This branch will be reached if a function or array is wrapped in a `Table`
    3523            col = last_part
    3524
    3525        alias = self.args.get("alias")
    3526        if alias:
    3527            col = alias_(col, alias.this, copy=copy)
    3528
    3529        return col

arg_types = {'this': False, 'alias': False, 'db': False, 'catalog': False, 'laterals': False, 'joins': False, 'pivots': False, 'hints': False, 'system_time': False, 'version': False, 'format': False, 'pattern': False, 'ordinality': False, 'when': False, 'only': False, 'partition': False, 'changes': False, 'rows_from': False, 'sample': False}
name: str View Source

    3478    @property
    3479    def name(self) -> str:
    3480        if not self.this or isinstance(self.this, Func):
    3481            return ""
    3482        return self.this.name

db: str View Source

    3484    @property
    3485    def db(self) -> str:
    3486        return self.text("db")

catalog: str View Source

    3488    @property
    3489    def catalog(self) -> str:
    3490        return self.text("catalog")

selects: List[Expression] View Source

    3492    @property
    3493    def selects(self) -> t.List[Expression]:
    3494        return []

named_selects: List[str] View Source

    3496    @property
    3497    def named_selects(self) -> t.List[str]:
    3498        return []

parts: List[Expression] View Source

    3500    @property
    3501    def parts(self) -> t.List[Expression]:
    3502        """Return the parts of a table in order catalog, db, table."""
    3503        parts: t.List[Expression] = []
    3504
    3505        for arg in ("catalog", "db", "this"):
    3506            part = self.args.get(arg)
    3507
    3508            if isinstance(part, Dot):
    3509                parts.extend(part.flatten())
    3510            elif isinstance(part, Expression):
    3511                parts.append(part)
    3512
    3513        return parts

Return the parts of a table in order catalog, db, table.

def to_column(self, copy: bool = True) -> Expression: View Source

    3515    def to_column(self, copy: bool = True) -> Expression:
    3516        parts = self.parts
    3517        last_part = parts[-1]
    3518
    3519        if isinstance(last_part, Identifier):
    3520            col: Expression = column(*reversed(parts[0:4]), fields=parts[4:], copy=copy)  # type: ignore
    3521        else:
    3522            # This branch will be reached if a function or array is wrapped in a `Table`
    3523            col = last_part
    3524
    3525        alias = self.args.get("alias")
    3526        if alias:
    3527            col = alias_(col, alias.this, copy=copy)
    3528
    3529        return col

key = 'table'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SetOperation(Query): View Source

    3532class SetOperation(Query):
    3533    arg_types = {
    3534        "with": False,
    3535        "this": True,
    3536        "expression": True,
    3537        "distinct": False,
    3538        "by_name": False,
    3539        "side": False,
    3540        "kind": False,
    3541        "on": False,
    3542        **QUERY_MODIFIERS,
    3543    }
    3544
    3545    def select(
    3546        self: S,
    3547        *expressions: t.Optional[ExpOrStr],
    3548        append: bool = True,
    3549        dialect: DialectType = None,
    3550        copy: bool = True,
    3551        **opts,
    3552    ) -> S:
    3553        this = maybe_copy(self, copy)
    3554        this.this.unnest().select(*expressions, append=append, dialect=dialect, copy=False, **opts)
    3555        this.expression.unnest().select(
    3556            *expressions, append=append, dialect=dialect, copy=False, **opts
    3557        )
    3558        return this
    3559
    3560    @property
    3561    def named_selects(self) -> t.List[str]:
    3562        return self.this.unnest().named_selects
    3563
    3564    @property
    3565    def is_star(self) -> bool:
    3566        return self.this.is_star or self.expression.is_star
    3567
    3568    @property
    3569    def selects(self) -> t.List[Expression]:
    3570        return self.this.unnest().selects
    3571
    3572    @property
    3573    def left(self) -> Query:
    3574        return self.this
    3575
    3576    @property
    3577    def right(self) -> Query:
    3578        return self.expression
    3579
    3580    @property
    3581    def kind(self) -> str:
    3582        return self.text("kind").upper()
    3583
    3584    @property
    3585    def side(self) -> str:
    3586        return self.text("side").upper()

arg_types = {'with': False, 'this': True, 'expression': True, 'distinct': False, 'by_name': False, 'side': False, 'kind': False, 'on': False, 'match': False, 'laterals': False, 'joins': False, 'connect': False, 'pivots': False, 'prewhere': False, 'where': False, 'group': False, 'having': False, 'qualify': False, 'windows': False, 'distribute': False, 'sort': False, 'cluster': False, 'order': False, 'limit': False, 'offset': False, 'locks': False, 'sample': False, 'settings': False, 'format': False, 'options': False}
def select( self: ~S, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> ~S: View Source

    3545    def select(
    3546        self: S,
    3547        *expressions: t.Optional[ExpOrStr],
    3548        append: bool = True,
    3549        dialect: DialectType = None,
    3550        copy: bool = True,
    3551        **opts,
    3552    ) -> S:
    3553        this = maybe_copy(self, copy)
    3554        this.this.unnest().select(*expressions, append=append, dialect=dialect, copy=False, **opts)
    3555        this.expression.unnest().select(
    3556            *expressions, append=append, dialect=dialect, copy=False, **opts
    3557        )
    3558        return this

Append to or set the SELECT expressions.

###### Example:

>     >>> Select().select("x", "y").sql()
>     'SELECT x, y'

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is.
- append: if `True`, add to any existing expressions. Otherwise, this resets the expressions.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Query expression.

named_selects: List[str] View Source

    3560    @property
    3561    def named_selects(self) -> t.List[str]:
    3562        return self.this.unnest().named_selects

Returns the output names of the query's projections.

is_star: bool View Source

    3564    @property
    3565    def is_star(self) -> bool:
    3566        return self.this.is_star or self.expression.is_star

Checks whether an expression is a star.

selects: List[Expression] View Source

    3568    @property
    3569    def selects(self) -> t.List[Expression]:
    3570        return self.this.unnest().selects

Returns the query's projections.

left: Query View Source

    3572    @property
    3573    def left(self) -> Query:
    3574        return self.this

right: Query View Source

    3576    @property
    3577    def right(self) -> Query:
    3578        return self.expression

kind: str View Source

    3580    @property
    3581    def kind(self) -> str:
    3582        return self.text("kind").upper()

side: str View Source

    3584    @property
    3585    def side(self) -> str:
    3586        return self.text("side").upper()

key = 'setoperation'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Query
  subquery
  limit
  offset
  order_by
  ctes
  where
  with_
  union
  intersect
  except_

class Union(SetOperation): View Source

    3589class Union(SetOperation):
    3590    pass

key = 'union'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
SetOperation
  arg_types
  select
  named_selects
  is_star
  selects
  left
  right
  kind
  side
Query
  subquery
  limit
  offset
  order_by
  ctes
  where
  with_
  union
  intersect
  except_

class Except(SetOperation): View Source

    3593class Except(SetOperation):
    3594    pass

key = 'except'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
SetOperation
  arg_types
  select
  named_selects
  is_star
  selects
  left
  right
  kind
  side
Query
  subquery
  limit
  offset
  order_by
  ctes
  where
  with_
  union
  intersect
  except_

class Intersect(SetOperation): View Source

    3597class Intersect(SetOperation):
    3598    pass

key = 'intersect'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
SetOperation
  arg_types
  select
  named_selects
  is_star
  selects
  left
  right
  kind
  side
Query
  subquery
  limit
  offset
  order_by
  ctes
  where
  with_
  union
  intersect
  except_

class Update(DML): View Source

    3601class Update(DML):
    3602    arg_types = {
    3603        "with": False,
    3604        "this": False,
    3605        "expressions": True,
    3606        "from": False,
    3607        "where": False,
    3608        "returning": False,
    3609        "order": False,
    3610        "limit": False,
    3611    }
    3612
    3613    def table(
    3614        self, expression: ExpOrStr, dialect: DialectType = None, copy: bool = True, **opts
    3615    ) -> Update:
    3616        """
    3617        Set the table to update.
    3618
    3619        Example:
    3620            >>> Update().table("my_table").set_("x = 1").sql()
    3621            'UPDATE my_table SET x = 1'
    3622
    3623        Args:
    3624            expression : the SQL code strings to parse.
    3625                If a `Table` instance is passed, this is used as-is.
    3626                If another `Expression` instance is passed, it will be wrapped in a `Table`.
    3627            dialect: the dialect used to parse the input expression.
    3628            copy: if `False`, modify this expression instance in-place.
    3629            opts: other options to use to parse the input expressions.
    3630
    3631        Returns:
    3632            The modified Update expression.
    3633        """
    3634        return _apply_builder(
    3635            expression=expression,
    3636            instance=self,
    3637            arg="this",
    3638            into=Table,
    3639            prefix=None,
    3640            dialect=dialect,
    3641            copy=copy,
    3642            **opts,
    3643        )
    3644
    3645    def set_(
    3646        self,
    3647        *expressions: ExpOrStr,
    3648        append: bool = True,
    3649        dialect: DialectType = None,
    3650        copy: bool = True,
    3651        **opts,
    3652    ) -> Update:
    3653        """
    3654        Append to or set the SET expressions.
    3655
    3656        Example:
    3657            >>> Update().table("my_table").set_("x = 1").sql()
    3658            'UPDATE my_table SET x = 1'
    3659
    3660        Args:
    3661            *expressions: the SQL code strings to parse.
    3662                If `Expression` instance(s) are passed, they will be used as-is.
    3663                Multiple expressions are combined with a comma.
    3664            append: if `True`, add the new expressions to any existing SET expressions.
    3665                Otherwise, this resets the expressions.
    3666            dialect: the dialect used to parse the input expressions.
    3667            copy: if `False`, modify this expression instance in-place.
    3668            opts: other options to use to parse the input expressions.
    3669        """
    3670        return _apply_list_builder(
    3671            *expressions,
    3672            instance=self,
    3673            arg="expressions",
    3674            append=append,
    3675            into=Expression,
    3676            prefix=None,
    3677            dialect=dialect,
    3678            copy=copy,
    3679            **opts,
    3680        )
    3681
    3682    def where(
    3683        self,
    3684        *expressions: t.Optional[ExpOrStr],
    3685        append: bool = True,
    3686        dialect: DialectType = None,
    3687        copy: bool = True,
    3688        **opts,
    3689    ) -> Select:
    3690        """
    3691        Append to or set the WHERE expressions.
    3692
    3693        Example:
    3694            >>> Update().table("tbl").set_("x = 1").where("x = 'a' OR x < 'b'").sql()
    3695            "UPDATE tbl SET x = 1 WHERE x = 'a' OR x < 'b'"
    3696
    3697        Args:
    3698            *expressions: the SQL code strings to parse.
    3699                If an `Expression` instance is passed, it will be used as-is.
    3700                Multiple expressions are combined with an AND operator.
    3701            append: if `True`, AND the new expressions to any existing expression.
    3702                Otherwise, this resets the expression.
    3703            dialect: the dialect used to parse the input expressions.
    3704            copy: if `False`, modify this expression instance in-place.
    3705            opts: other options to use to parse the input expressions.
    3706
    3707        Returns:
    3708            Select: the modified expression.
    3709        """
    3710        return _apply_conjunction_builder(
    3711            *expressions,
    3712            instance=self,
    3713            arg="where",
    3714            append=append,
    3715            into=Where,
    3716            dialect=dialect,
    3717            copy=copy,
    3718            **opts,
    3719        )
    3720
    3721    def from_(
    3722        self,
    3723        expression: t.Optional[ExpOrStr] = None,
    3724        dialect: DialectType = None,
    3725        copy: bool = True,
    3726        **opts,
    3727    ) -> Update:
    3728        """
    3729        Set the FROM expression.
    3730
    3731        Example:
    3732            >>> Update().table("my_table").set_("x = 1").from_("baz").sql()
    3733            'UPDATE my_table SET x = 1 FROM baz'
    3734
    3735        Args:
    3736            expression : the SQL code strings to parse.
    3737                If a `From` instance is passed, this is used as-is.
    3738                If another `Expression` instance is passed, it will be wrapped in a `From`.
    3739                If nothing is passed in then a from is not applied to the expression
    3740            dialect: the dialect used to parse the input expression.
    3741            copy: if `False`, modify this expression instance in-place.
    3742            opts: other options to use to parse the input expressions.
    3743
    3744        Returns:
    3745            The modified Update expression.
    3746        """
    3747        if not expression:
    3748            return maybe_copy(self, copy)
    3749
    3750        return _apply_builder(
    3751            expression=expression,
    3752            instance=self,
    3753            arg="from",
    3754            into=From,
    3755            prefix="FROM",
    3756            dialect=dialect,
    3757            copy=copy,
    3758            **opts,
    3759        )
    3760
    3761    def with_(
    3762        self,
    3763        alias: ExpOrStr,
    3764        as_: ExpOrStr,
    3765        recursive: t.Optional[bool] = None,
    3766        materialized: t.Optional[bool] = None,
    3767        append: bool = True,
    3768        dialect: DialectType = None,
    3769        copy: bool = True,
    3770        **opts,
    3771    ) -> Update:
    3772        """
    3773        Append to or set the common table expressions.
    3774
    3775        Example:
    3776            >>> Update().table("my_table").set_("x = 1").from_("baz").with_("baz", "SELECT id FROM foo").sql()
    3777            'WITH baz AS (SELECT id FROM foo) UPDATE my_table SET x = 1 FROM baz'
    3778
    3779        Args:
    3780            alias: the SQL code string to parse as the table name.
    3781                If an `Expression` instance is passed, this is used as-is.
    3782            as_: the SQL code string to parse as the table expression.
    3783                If an `Expression` instance is passed, it will be used as-is.
    3784            recursive: set the RECURSIVE part of the expression. Defaults to `False`.
    3785            materialized: set the MATERIALIZED part of the expression.
    3786            append: if `True`, add to any existing expressions.
    3787                Otherwise, this resets the expressions.
    3788            dialect: the dialect used to parse the input expression.
    3789            copy: if `False`, modify this expression instance in-place.
    3790            opts: other options to use to parse the input expressions.
    3791
    3792        Returns:
    3793            The modified expression.
    3794        """
    3795        return _apply_cte_builder(
    3796            self,
    3797            alias,
    3798            as_,
    3799            recursive=recursive,
    3800            materialized=materialized,
    3801            append=append,
    3802            dialect=dialect,
    3803            copy=copy,
    3804            **opts,
    3805        )

arg_types = {'with': False, 'this': False, 'expressions': True, 'from': False, 'where': False, 'returning': False, 'order': False, 'limit': False}
def table( self, expression: Union[str, Expression], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Update: View Source

    3613    def table(
    3614        self, expression: ExpOrStr, dialect: DialectType = None, copy: bool = True, **opts
    3615    ) -> Update:
    3616        """
    3617        Set the table to update.
    3618
    3619        Example:
    3620            >>> Update().table("my_table").set_("x = 1").sql()
    3621            'UPDATE my_table SET x = 1'
    3622
    3623        Args:
    3624            expression : the SQL code strings to parse.
    3625                If a `Table` instance is passed, this is used as-is.
    3626                If another `Expression` instance is passed, it will be wrapped in a `Table`.
    3627            dialect: the dialect used to parse the input expression.
    3628            copy: if `False`, modify this expression instance in-place.
    3629            opts: other options to use to parse the input expressions.
    3630
    3631        Returns:
    3632            The modified Update expression.
    3633        """
    3634        return _apply_builder(
    3635            expression=expression,
    3636            instance=self,
    3637            arg="this",
    3638            into=Table,
    3639            prefix=None,
    3640            dialect=dialect,
    3641            copy=copy,
    3642            **opts,
    3643        )

Set the table to update.

###### Example:

>     >>> Update().table("my_table").set_("x = 1").sql()
>     'UPDATE my_table SET x = 1'

###### Arguments:

- expression : the SQL code strings to parse. If a `Table` instance is passed, this is used as-is. If another `Expression` instance is passed, it will be wrapped in a `Table`.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Update expression.

def set_( self, *expressions: Union[str, Expression], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Update: View Source

    3645    def set_(
    3646        self,
    3647        *expressions: ExpOrStr,
    3648        append: bool = True,
    3649        dialect: DialectType = None,
    3650        copy: bool = True,
    3651        **opts,
    3652    ) -> Update:
    3653        """
    3654        Append to or set the SET expressions.
    3655
    3656        Example:
    3657            >>> Update().table("my_table").set_("x = 1").sql()
    3658            'UPDATE my_table SET x = 1'
    3659
    3660        Args:
    3661            *expressions: the SQL code strings to parse.
    3662                If `Expression` instance(s) are passed, they will be used as-is.
    3663                Multiple expressions are combined with a comma.
    3664            append: if `True`, add the new expressions to any existing SET expressions.
    3665                Otherwise, this resets the expressions.
    3666            dialect: the dialect used to parse the input expressions.
    3667            copy: if `False`, modify this expression instance in-place.
    3668            opts: other options to use to parse the input expressions.
    3669        """
    3670        return _apply_list_builder(
    3671            *expressions,
    3672            instance=self,
    3673            arg="expressions",
    3674            append=append,
    3675            into=Expression,
    3676            prefix=None,
    3677            dialect=dialect,
    3678            copy=copy,
    3679            **opts,
    3680        )

Append to or set the SET expressions.

###### Example:

>     >>> Update().table("my_table").set_("x = 1").sql()
>     'UPDATE my_table SET x = 1'

###### Arguments:

- *expressions: the SQL code strings to parse. If `Expression` instance(s) are passed, they will be used as-is. Multiple expressions are combined with a comma.
- append: if `True`, add the new expressions to any existing SET expressions. Otherwise, this resets the expressions.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

def where( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    3682    def where(
    3683        self,
    3684        *expressions: t.Optional[ExpOrStr],
    3685        append: bool = True,
    3686        dialect: DialectType = None,
    3687        copy: bool = True,
    3688        **opts,
    3689    ) -> Select:
    3690        """
    3691        Append to or set the WHERE expressions.
    3692
    3693        Example:
    3694            >>> Update().table("tbl").set_("x = 1").where("x = 'a' OR x < 'b'").sql()
    3695            "UPDATE tbl SET x = 1 WHERE x = 'a' OR x < 'b'"
    3696
    3697        Args:
    3698            *expressions: the SQL code strings to parse.
    3699                If an `Expression` instance is passed, it will be used as-is.
    3700                Multiple expressions are combined with an AND operator.
    3701            append: if `True`, AND the new expressions to any existing expression.
    3702                Otherwise, this resets the expression.
    3703            dialect: the dialect used to parse the input expressions.
    3704            copy: if `False`, modify this expression instance in-place.
    3705            opts: other options to use to parse the input expressions.
    3706
    3707        Returns:
    3708            Select: the modified expression.
    3709        """
    3710        return _apply_conjunction_builder(
    3711            *expressions,
    3712            instance=self,
    3713            arg="where",
    3714            append=append,
    3715            into=Where,
    3716            dialect=dialect,
    3717            copy=copy,
    3718            **opts,
    3719        )

Append to or set the WHERE expressions.

###### Example:

>     >>> Update().table("tbl").set_("x = 1").where("x = 'a' OR x < 'b'").sql()
>     "UPDATE tbl SET x = 1 WHERE x = 'a' OR x < 'b'"

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is. Multiple expressions are combined with an AND operator.
- append: if `True`, AND the new expressions to any existing expression. Otherwise, this resets the expression.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> Select: the modified expression.

def from_( self, expression: Union[str, Expression, NoneType] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Update: View Source

    3721    def from_(
    3722        self,
    3723        expression: t.Optional[ExpOrStr] = None,
    3724        dialect: DialectType = None,
    3725        copy: bool = True,
    3726        **opts,
    3727    ) -> Update:
    3728        """
    3729        Set the FROM expression.
    3730
    3731        Example:
    3732            >>> Update().table("my_table").set_("x = 1").from_("baz").sql()
    3733            'UPDATE my_table SET x = 1 FROM baz'
    3734
    3735        Args:
    3736            expression : the SQL code strings to parse.
    3737                If a `From` instance is passed, this is used as-is.
    3738                If another `Expression` instance is passed, it will be wrapped in a `From`.
    3739                If nothing is passed in then a from is not applied to the expression
    3740            dialect: the dialect used to parse the input expression.
    3741            copy: if `False`, modify this expression instance in-place.
    3742            opts: other options to use to parse the input expressions.
    3743
    3744        Returns:
    3745            The modified Update expression.
    3746        """
    3747        if not expression:
    3748            return maybe_copy(self, copy)
    3749
    3750        return _apply_builder(
    3751            expression=expression,
    3752            instance=self,
    3753            arg="from",
    3754            into=From,
    3755            prefix="FROM",
    3756            dialect=dialect,
    3757            copy=copy,
    3758            **opts,
    3759        )

Set the FROM expression.

###### Example:

>     >>> Update().table("my_table").set_("x = 1").from_("baz").sql()
>     'UPDATE my_table SET x = 1 FROM baz'

###### Arguments:

- expression : the SQL code strings to parse. If a `From` instance is passed, this is used as-is. If another `Expression` instance is passed, it will be wrapped in a `From`. If nothing is passed in then a from is not applied to the expression
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Update expression.

def with_( self, alias: Union[str, Expression], as_: Union[str, Expression], recursive: Optional[bool] = None, materialized: Optional[bool] = None, append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Update: View Source

    3761    def with_(
    3762        self,
    3763        alias: ExpOrStr,
    3764        as_: ExpOrStr,
    3765        recursive: t.Optional[bool] = None,
    3766        materialized: t.Optional[bool] = None,
    3767        append: bool = True,
    3768        dialect: DialectType = None,
    3769        copy: bool = True,
    3770        **opts,
    3771    ) -> Update:
    3772        """
    3773        Append to or set the common table expressions.
    3774
    3775        Example:
    3776            >>> Update().table("my_table").set_("x = 1").from_("baz").with_("baz", "SELECT id FROM foo").sql()
    3777            'WITH baz AS (SELECT id FROM foo) UPDATE my_table SET x = 1 FROM baz'
    3778
    3779        Args:
    3780            alias: the SQL code string to parse as the table name.
    3781                If an `Expression` instance is passed, this is used as-is.
    3782            as_: the SQL code string to parse as the table expression.
    3783                If an `Expression` instance is passed, it will be used as-is.
    3784            recursive: set the RECURSIVE part of the expression. Defaults to `False`.
    3785            materialized: set the MATERIALIZED part of the expression.
    3786            append: if `True`, add to any existing expressions.
    3787                Otherwise, this resets the expressions.
    3788            dialect: the dialect used to parse the input expression.
    3789            copy: if `False`, modify this expression instance in-place.
    3790            opts: other options to use to parse the input expressions.
    3791
    3792        Returns:
    3793            The modified expression.
    3794        """
    3795        return _apply_cte_builder(
    3796            self,
    3797            alias,
    3798            as_,
    3799            recursive=recursive,
    3800            materialized=materialized,
    3801            append=append,
    3802            dialect=dialect,
    3803            copy=copy,
    3804            **opts,
    3805        )

Append to or set the common table expressions.

###### Example:

>     >>> Update().table("my_table").set_("x = 1").from_("baz").with_("baz", "SELECT id FROM foo").sql()
>     'WITH baz AS (SELECT id FROM foo) UPDATE my_table SET x = 1 FROM baz'

###### Arguments:

- alias: the SQL code string to parse as the table name. If an `Expression` instance is passed, this is used as-is.
- as_: the SQL code string to parse as the table expression. If an `Expression` instance is passed, it will be used as-is.
- recursive: set the RECURSIVE part of the expression. Defaults to `False`.
- materialized: set the MATERIALIZED part of the expression.
- append: if `True`, add to any existing expressions. Otherwise, this resets the expressions.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified expression.

key = 'update'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DML
  returning

class Values(UDTF): View Source

    3808class Values(UDTF):
    3809    arg_types = {"expressions": True, "alias": False}

arg_types = {'expressions': True, 'alias': False}
key = 'values'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
UDTF
  selects
DerivedTable
  named_selects

class Var(Expression): View Source

    3812class Var(Expression):
    3813    pass

key = 'var'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Version(Expression): View Source

    3816class Version(Expression):
    3817    """
    3818    Time travel, iceberg, bigquery etc
    3819    https://trino.io/docs/current/connector/iceberg.html?highlight=snapshot#using-snapshots
    3820    https://www.databricks.com/blog/2019/02/04/introducing-delta-time-travel-for-large-scale-data-lakes.html
    3821    https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#for_system_time_as_of
    3822    https://learn.microsoft.com/en-us/sql/relational-databases/tables/querying-data-in-a-system-versioned-temporal-table?view=sql-server-ver16
    3823    this is either TIMESTAMP or VERSION
    3824    kind is ("AS OF", "BETWEEN")
    3825    """
    3826
    3827    arg_types = {"this": True, "kind": True, "expression": False}

Time travel, iceberg, bigquery etc https://trino.io/docs/current/connector/iceberg.html?highlight=snapshot#using-snapshots https://www.databricks.com/blog/2019/02/04/introducing-delta-time-travel-for-large-scale-data-lakes.html https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#for_system_time_as_of https://learn.microsoft.com/en-us/sql/relational-databases/tables/querying-data-in-a-system-versioned-temporal-table?view=sql-server-ver16 this is either TIMESTAMP or VERSION kind is ("AS OF", "BETWEEN")

arg_types = {'this': True, 'kind': True, 'expression': False}
key = 'version'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Schema(Expression): View Source

    3830class Schema(Expression):
    3831    arg_types = {"this": False, "expressions": False}

arg_types = {'this': False, 'expressions': False}
key = 'schema'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Lock(Expression): View Source

    3836class Lock(Expression):
    3837    arg_types = {"update": True, "expressions": False, "wait": False, "key": False}

arg_types = {'update': True, 'expressions': False, 'wait': False, 'key': False}
key = 'lock'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Select(Query): View Source

    3840class Select(Query):
    3841    arg_types = {
    3842        "with": False,
    3843        "kind": False,
    3844        "expressions": False,
    3845        "hint": False,
    3846        "distinct": False,
    3847        "into": False,
    3848        "from": False,
    3849        "operation_modifiers": False,
    3850        **QUERY_MODIFIERS,
    3851    }
    3852
    3853    def from_(
    3854        self, expression: ExpOrStr, dialect: DialectType = None, copy: bool = True, **opts
    3855    ) -> Select:
    3856        """
    3857        Set the FROM expression.
    3858
    3859        Example:
    3860            >>> Select().from_("tbl").select("x").sql()
    3861            'SELECT x FROM tbl'
    3862
    3863        Args:
    3864            expression : the SQL code strings to parse.
    3865                If a `From` instance is passed, this is used as-is.
    3866                If another `Expression` instance is passed, it will be wrapped in a `From`.
    3867            dialect: the dialect used to parse the input expression.
    3868            copy: if `False`, modify this expression instance in-place.
    3869            opts: other options to use to parse the input expressions.
    3870
    3871        Returns:
    3872            The modified Select expression.
    3873        """
    3874        return _apply_builder(
    3875            expression=expression,
    3876            instance=self,
    3877            arg="from",
    3878            into=From,
    3879            prefix="FROM",
    3880            dialect=dialect,
    3881            copy=copy,
    3882            **opts,
    3883        )
    3884
    3885    def group_by(
    3886        self,
    3887        *expressions: t.Optional[ExpOrStr],
    3888        append: bool = True,
    3889        dialect: DialectType = None,
    3890        copy: bool = True,
    3891        **opts,
    3892    ) -> Select:
    3893        """
    3894        Set the GROUP BY expression.
    3895
    3896        Example:
    3897            >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()
    3898            'SELECT x, COUNT(1) FROM tbl GROUP BY x'
    3899
    3900        Args:
    3901            *expressions: the SQL code strings to parse.
    3902                If a `Group` instance is passed, this is used as-is.
    3903                If another `Expression` instance is passed, it will be wrapped in a `Group`.
    3904                If nothing is passed in then a group by is not applied to the expression
    3905            append: if `True`, add to any existing expressions.
    3906                Otherwise, this flattens all the `Group` expression into a single expression.
    3907            dialect: the dialect used to parse the input expression.
    3908            copy: if `False`, modify this expression instance in-place.
    3909            opts: other options to use to parse the input expressions.
    3910
    3911        Returns:
    3912            The modified Select expression.
    3913        """
    3914        if not expressions:
    3915            return self if not copy else self.copy()
    3916
    3917        return _apply_child_list_builder(
    3918            *expressions,
    3919            instance=self,
    3920            arg="group",
    3921            append=append,
    3922            copy=copy,
    3923            prefix="GROUP BY",
    3924            into=Group,
    3925            dialect=dialect,
    3926            **opts,
    3927        )
    3928
    3929    def sort_by(
    3930        self,
    3931        *expressions: t.Optional[ExpOrStr],
    3932        append: bool = True,
    3933        dialect: DialectType = None,
    3934        copy: bool = True,
    3935        **opts,
    3936    ) -> Select:
    3937        """
    3938        Set the SORT BY expression.
    3939
    3940        Example:
    3941            >>> Select().from_("tbl").select("x").sort_by("x DESC").sql(dialect="hive")
    3942            'SELECT x FROM tbl SORT BY x DESC'
    3943
    3944        Args:
    3945            *expressions: the SQL code strings to parse.
    3946                If a `Group` instance is passed, this is used as-is.
    3947                If another `Expression` instance is passed, it will be wrapped in a `SORT`.
    3948            append: if `True`, add to any existing expressions.
    3949                Otherwise, this flattens all the `Order` expression into a single expression.
    3950            dialect: the dialect used to parse the input expression.
    3951            copy: if `False`, modify this expression instance in-place.
    3952            opts: other options to use to parse the input expressions.
    3953
    3954        Returns:
    3955            The modified Select expression.
    3956        """
    3957        return _apply_child_list_builder(
    3958            *expressions,
    3959            instance=self,
    3960            arg="sort",
    3961            append=append,
    3962            copy=copy,
    3963            prefix="SORT BY",
    3964            into=Sort,
    3965            dialect=dialect,
    3966            **opts,
    3967        )
    3968
    3969    def cluster_by(
    3970        self,
    3971        *expressions: t.Optional[ExpOrStr],
    3972        append: bool = True,
    3973        dialect: DialectType = None,
    3974        copy: bool = True,
    3975        **opts,
    3976    ) -> Select:
    3977        """
    3978        Set the CLUSTER BY expression.
    3979
    3980        Example:
    3981            >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql(dialect="hive")
    3982            'SELECT x FROM tbl CLUSTER BY x DESC'
    3983
    3984        Args:
    3985            *expressions: the SQL code strings to parse.
    3986                If a `Group` instance is passed, this is used as-is.
    3987                If another `Expression` instance is passed, it will be wrapped in a `Cluster`.
    3988            append: if `True`, add to any existing expressions.
    3989                Otherwise, this flattens all the `Order` expression into a single expression.
    3990            dialect: the dialect used to parse the input expression.
    3991            copy: if `False`, modify this expression instance in-place.
    3992            opts: other options to use to parse the input expressions.
    3993
    3994        Returns:
    3995            The modified Select expression.
    3996        """
    3997        return _apply_child_list_builder(
    3998            *expressions,
    3999            instance=self,
    4000            arg="cluster",
    4001            append=append,
    4002            copy=copy,
    4003            prefix="CLUSTER BY",
    4004            into=Cluster,
    4005            dialect=dialect,
    4006            **opts,
    4007        )
    4008
    4009    def select(
    4010        self,
    4011        *expressions: t.Optional[ExpOrStr],
    4012        append: bool = True,
    4013        dialect: DialectType = None,
    4014        copy: bool = True,
    4015        **opts,
    4016    ) -> Select:
    4017        return _apply_list_builder(
    4018            *expressions,
    4019            instance=self,
    4020            arg="expressions",
    4021            append=append,
    4022            dialect=dialect,
    4023            into=Expression,
    4024            copy=copy,
    4025            **opts,
    4026        )
    4027
    4028    def lateral(
    4029        self,
    4030        *expressions: t.Optional[ExpOrStr],
    4031        append: bool = True,
    4032        dialect: DialectType = None,
    4033        copy: bool = True,
    4034        **opts,
    4035    ) -> Select:
    4036        """
    4037        Append to or set the LATERAL expressions.
    4038
    4039        Example:
    4040            >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()
    4041            'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'
    4042
    4043        Args:
    4044            *expressions: the SQL code strings to parse.
    4045                If an `Expression` instance is passed, it will be used as-is.
    4046            append: if `True`, add to any existing expressions.
    4047                Otherwise, this resets the expressions.
    4048            dialect: the dialect used to parse the input expressions.
    4049            copy: if `False`, modify this expression instance in-place.
    4050            opts: other options to use to parse the input expressions.
    4051
    4052        Returns:
    4053            The modified Select expression.
    4054        """
    4055        return _apply_list_builder(
    4056            *expressions,
    4057            instance=self,
    4058            arg="laterals",
    4059            append=append,
    4060            into=Lateral,
    4061            prefix="LATERAL VIEW",
    4062            dialect=dialect,
    4063            copy=copy,
    4064            **opts,
    4065        )
    4066
    4067    def join(
    4068        self,
    4069        expression: ExpOrStr,
    4070        on: t.Optional[ExpOrStr] = None,
    4071        using: t.Optional[ExpOrStr | t.Collection[ExpOrStr]] = None,
    4072        append: bool = True,
    4073        join_type: t.Optional[str] = None,
    4074        join_alias: t.Optional[Identifier | str] = None,
    4075        dialect: DialectType = None,
    4076        copy: bool = True,
    4077        **opts,
    4078    ) -> Select:
    4079        """
    4080        Append to or set the JOIN expressions.
    4081
    4082        Example:
    4083            >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()
    4084            'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'
    4085
    4086            >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()
    4087            'SELECT 1 FROM a JOIN b USING (x, y, z)'
    4088
    4089            Use `join_type` to change the type of join:
    4090
    4091            >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()
    4092            'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'
    4093
    4094        Args:
    4095            expression: the SQL code string to parse.
    4096                If an `Expression` instance is passed, it will be used as-is.
    4097            on: optionally specify the join "on" criteria as a SQL string.
    4098                If an `Expression` instance is passed, it will be used as-is.
    4099            using: optionally specify the join "using" criteria as a SQL string.
    4100                If an `Expression` instance is passed, it will be used as-is.
    4101            append: if `True`, add to any existing expressions.
    4102                Otherwise, this resets the expressions.
    4103            join_type: if set, alter the parsed join type.
    4104            join_alias: an optional alias for the joined source.
    4105            dialect: the dialect used to parse the input expressions.
    4106            copy: if `False`, modify this expression instance in-place.
    4107            opts: other options to use to parse the input expressions.
    4108
    4109        Returns:
    4110            Select: the modified expression.
    4111        """
    4112        parse_args: t.Dict[str, t.Any] = {"dialect": dialect, **opts}
    4113
    4114        try:
    4115            expression = maybe_parse(expression, into=Join, prefix="JOIN", **parse_args)
    4116        except ParseError:
    4117            expression = maybe_parse(expression, into=(Join, Expression), **parse_args)
    4118
    4119        join = expression if isinstance(expression, Join) else Join(this=expression)
    4120
    4121        if isinstance(join.this, Select):
    4122            join.this.replace(join.this.subquery())
    4123
    4124        if join_type:
    4125            method: t.Optional[Token]
    4126            side: t.Optional[Token]
    4127            kind: t.Optional[Token]
    4128
    4129            method, side, kind = maybe_parse(join_type, into="JOIN_TYPE", **parse_args)  # type: ignore
    4130
    4131            if method:
    4132                join.set("method", method.text)
    4133            if side:
    4134                join.set("side", side.text)
    4135            if kind:
    4136                join.set("kind", kind.text)
    4137
    4138        if on:
    4139            on = and_(*ensure_list(on), dialect=dialect, copy=copy, **opts)
    4140            join.set("on", on)
    4141
    4142        if using:
    4143            join = _apply_list_builder(
    4144                *ensure_list(using),
    4145                instance=join,
    4146                arg="using",
    4147                append=append,
    4148                copy=copy,
    4149                into=Identifier,
    4150                **opts,
    4151            )
    4152
    4153        if join_alias:
    4154            join.set("this", alias_(join.this, join_alias, table=True))
    4155
    4156        return _apply_list_builder(
    4157            join,
    4158            instance=self,
    4159            arg="joins",
    4160            append=append,
    4161            copy=copy,
    4162            **opts,
    4163        )
    4164
    4165    def having(
    4166        self,
    4167        *expressions: t.Optional[ExpOrStr],
    4168        append: bool = True,
    4169        dialect: DialectType = None,
    4170        copy: bool = True,
    4171        **opts,
    4172    ) -> Select:
    4173        """
    4174        Append to or set the HAVING expressions.
    4175
    4176        Example:
    4177            >>> Select().select("x", "COUNT(y)").from_("tbl").group_by("x").having("COUNT(y) > 3").sql()
    4178            'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'
    4179
    4180        Args:
    4181            *expressions: the SQL code strings to parse.
    4182                If an `Expression` instance is passed, it will be used as-is.
    4183                Multiple expressions are combined with an AND operator.
    4184            append: if `True`, AND the new expressions to any existing expression.
    4185                Otherwise, this resets the expression.
    4186            dialect: the dialect used to parse the input expressions.
    4187            copy: if `False`, modify this expression instance in-place.
    4188            opts: other options to use to parse the input expressions.
    4189
    4190        Returns:
    4191            The modified Select expression.
    4192        """
    4193        return _apply_conjunction_builder(
    4194            *expressions,
    4195            instance=self,
    4196            arg="having",
    4197            append=append,
    4198            into=Having,
    4199            dialect=dialect,
    4200            copy=copy,
    4201            **opts,
    4202        )
    4203
    4204    def window(
    4205        self,
    4206        *expressions: t.Optional[ExpOrStr],
    4207        append: bool = True,
    4208        dialect: DialectType = None,
    4209        copy: bool = True,
    4210        **opts,
    4211    ) -> Select:
    4212        return _apply_list_builder(
    4213            *expressions,
    4214            instance=self,
    4215            arg="windows",
    4216            append=append,
    4217            into=Window,
    4218            dialect=dialect,
    4219            copy=copy,
    4220            **opts,
    4221        )
    4222
    4223    def qualify(
    4224        self,
    4225        *expressions: t.Optional[ExpOrStr],
    4226        append: bool = True,
    4227        dialect: DialectType = None,
    4228        copy: bool = True,
    4229        **opts,
    4230    ) -> Select:
    4231        return _apply_conjunction_builder(
    4232            *expressions,
    4233            instance=self,
    4234            arg="qualify",
    4235            append=append,
    4236            into=Qualify,
    4237            dialect=dialect,
    4238            copy=copy,
    4239            **opts,
    4240        )
    4241
    4242    def distinct(
    4243        self, *ons: t.Optional[ExpOrStr], distinct: bool = True, copy: bool = True
    4244    ) -> Select:
    4245        """
    4246        Set the OFFSET expression.
    4247
    4248        Example:
    4249            >>> Select().from_("tbl").select("x").distinct().sql()
    4250            'SELECT DISTINCT x FROM tbl'
    4251
    4252        Args:
    4253            ons: the expressions to distinct on
    4254            distinct: whether the Select should be distinct
    4255            copy: if `False`, modify this expression instance in-place.
    4256
    4257        Returns:
    4258            Select: the modified expression.
    4259        """
    4260        instance = maybe_copy(self, copy)
    4261        on = Tuple(expressions=[maybe_parse(on, copy=copy) for on in ons if on]) if ons else None
    4262        instance.set("distinct", Distinct(on=on) if distinct else None)
    4263        return instance
    4264
    4265    def ctas(
    4266        self,
    4267        table: ExpOrStr,
    4268        properties: t.Optional[t.Dict] = None,
    4269        dialect: DialectType = None,
    4270        copy: bool = True,
    4271        **opts,
    4272    ) -> Create:
    4273        """
    4274        Convert this expression to a CREATE TABLE AS statement.
    4275
    4276        Example:
    4277            >>> Select().select("*").from_("tbl").ctas("x").sql()
    4278            'CREATE TABLE x AS SELECT * FROM tbl'
    4279
    4280        Args:
    4281            table: the SQL code string to parse as the table name.
    4282                If another `Expression` instance is passed, it will be used as-is.
    4283            properties: an optional mapping of table properties
    4284            dialect: the dialect used to parse the input table.
    4285            copy: if `False`, modify this expression instance in-place.
    4286            opts: other options to use to parse the input table.
    4287
    4288        Returns:
    4289            The new Create expression.
    4290        """
    4291        instance = maybe_copy(self, copy)
    4292        table_expression = maybe_parse(table, into=Table, dialect=dialect, **opts)
    4293
    4294        properties_expression = None
    4295        if properties:
    4296            properties_expression = Properties.from_dict(properties)
    4297
    4298        return Create(
    4299            this=table_expression,
    4300            kind="TABLE",
    4301            expression=instance,
    4302            properties=properties_expression,
    4303        )
    4304
    4305    def lock(self, update: bool = True, copy: bool = True) -> Select:
    4306        """
    4307        Set the locking read mode for this expression.
    4308
    4309        Examples:
    4310            >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")
    4311            "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"
    4312
    4313            >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")
    4314            "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"
    4315
    4316        Args:
    4317            update: if `True`, the locking type will be `FOR UPDATE`, else it will be `FOR SHARE`.
    4318            copy: if `False`, modify this expression instance in-place.
    4319
    4320        Returns:
    4321            The modified expression.
    4322        """
    4323        inst = maybe_copy(self, copy)
    4324        inst.set("locks", [Lock(update=update)])
    4325
    4326        return inst
    4327
    4328    def hint(self, *hints: ExpOrStr, dialect: DialectType = None, copy: bool = True) -> Select:
    4329        """
    4330        Set hints for this expression.
    4331
    4332        Examples:
    4333            >>> Select().select("x").from_("tbl").hint("BROADCAST(y)").sql(dialect="spark")
    4334            'SELECT /*+ BROADCAST(y) */ x FROM tbl'
    4335
    4336        Args:
    4337            hints: The SQL code strings to parse as the hints.
    4338                If an `Expression` instance is passed, it will be used as-is.
    4339            dialect: The dialect used to parse the hints.
    4340            copy: If `False`, modify this expression instance in-place.
    4341
    4342        Returns:
    4343            The modified expression.
    4344        """
    4345        inst = maybe_copy(self, copy)
    4346        inst.set(
    4347            "hint", Hint(expressions=[maybe_parse(h, copy=copy, dialect=dialect) for h in hints])
    4348        )
    4349
    4350        return inst
    4351
    4352    @property
    4353    def named_selects(self) -> t.List[str]:
    4354        selects = []
    4355
    4356        for e in self.expressions:
    4357            if e.alias_or_name:
    4358                selects.append(e.output_name)
    4359            elif isinstance(e, Aliases):
    4360                selects.extend([a.name for a in e.aliases])
    4361        return selects
    4362
    4363    @property
    4364    def is_star(self) -> bool:
    4365        return any(expression.is_star for expression in self.expressions)
    4366
    4367    @property
    4368    def selects(self) -> t.List[Expression]:
    4369        return self.expressions

arg_types = {'with': False, 'kind': False, 'expressions': False, 'hint': False, 'distinct': False, 'into': False, 'from': False, 'operation_modifiers': False, 'match': False, 'laterals': False, 'joins': False, 'connect': False, 'pivots': False, 'prewhere': False, 'where': False, 'group': False, 'having': False, 'qualify': False, 'windows': False, 'distribute': False, 'sort': False, 'cluster': False, 'order': False, 'limit': False, 'offset': False, 'locks': False, 'sample': False, 'settings': False, 'format': False, 'options': False}
def from_( self, expression: Union[str, Expression], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    3853    def from_(
    3854        self, expression: ExpOrStr, dialect: DialectType = None, copy: bool = True, **opts
    3855    ) -> Select:
    3856        """
    3857        Set the FROM expression.
    3858
    3859        Example:
    3860            >>> Select().from_("tbl").select("x").sql()
    3861            'SELECT x FROM tbl'
    3862
    3863        Args:
    3864            expression : the SQL code strings to parse.
    3865                If a `From` instance is passed, this is used as-is.
    3866                If another `Expression` instance is passed, it will be wrapped in a `From`.
    3867            dialect: the dialect used to parse the input expression.
    3868            copy: if `False`, modify this expression instance in-place.
    3869            opts: other options to use to parse the input expressions.
    3870
    3871        Returns:
    3872            The modified Select expression.
    3873        """
    3874        return _apply_builder(
    3875            expression=expression,
    3876            instance=self,
    3877            arg="from",
    3878            into=From,
    3879            prefix="FROM",
    3880            dialect=dialect,
    3881            copy=copy,
    3882            **opts,
    3883        )

Set the FROM expression.

###### Example:

>     >>> Select().from_("tbl").select("x").sql()
>     'SELECT x FROM tbl'

###### Arguments:

- expression : the SQL code strings to parse. If a `From` instance is passed, this is used as-is. If another `Expression` instance is passed, it will be wrapped in a `From`.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Select expression.

def group_by( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    3885    def group_by(
    3886        self,
    3887        *expressions: t.Optional[ExpOrStr],
    3888        append: bool = True,
    3889        dialect: DialectType = None,
    3890        copy: bool = True,
    3891        **opts,
    3892    ) -> Select:
    3893        """
    3894        Set the GROUP BY expression.
    3895
    3896        Example:
    3897            >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()
    3898            'SELECT x, COUNT(1) FROM tbl GROUP BY x'
    3899
    3900        Args:
    3901            *expressions: the SQL code strings to parse.
    3902                If a `Group` instance is passed, this is used as-is.
    3903                If another `Expression` instance is passed, it will be wrapped in a `Group`.
    3904                If nothing is passed in then a group by is not applied to the expression
    3905            append: if `True`, add to any existing expressions.
    3906                Otherwise, this flattens all the `Group` expression into a single expression.
    3907            dialect: the dialect used to parse the input expression.
    3908            copy: if `False`, modify this expression instance in-place.
    3909            opts: other options to use to parse the input expressions.
    3910
    3911        Returns:
    3912            The modified Select expression.
    3913        """
    3914        if not expressions:
    3915            return self if not copy else self.copy()
    3916
    3917        return _apply_child_list_builder(
    3918            *expressions,
    3919            instance=self,
    3920            arg="group",
    3921            append=append,
    3922            copy=copy,
    3923            prefix="GROUP BY",
    3924            into=Group,
    3925            dialect=dialect,
    3926            **opts,
    3927        )

Set the GROUP BY expression.

###### Example:

>     >>> Select().from_("tbl").select("x", "COUNT(1)").group_by("x").sql()
>     'SELECT x, COUNT(1) FROM tbl GROUP BY x'

###### Arguments:

- *expressions: the SQL code strings to parse. If a `Group` instance is passed, this is used as-is. If another `Expression` instance is passed, it will be wrapped in a `Group`. If nothing is passed in then a group by is not applied to the expression
- append: if `True`, add to any existing expressions. Otherwise, this flattens all the `Group` expression into a single expression.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Select expression.

def sort_by( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    3929    def sort_by(
    3930        self,
    3931        *expressions: t.Optional[ExpOrStr],
    3932        append: bool = True,
    3933        dialect: DialectType = None,
    3934        copy: bool = True,
    3935        **opts,
    3936    ) -> Select:
    3937        """
    3938        Set the SORT BY expression.
    3939
    3940        Example:
    3941            >>> Select().from_("tbl").select("x").sort_by("x DESC").sql(dialect="hive")
    3942            'SELECT x FROM tbl SORT BY x DESC'
    3943
    3944        Args:
    3945            *expressions: the SQL code strings to parse.
    3946                If a `Group` instance is passed, this is used as-is.
    3947                If another `Expression` instance is passed, it will be wrapped in a `SORT`.
    3948            append: if `True`, add to any existing expressions.
    3949                Otherwise, this flattens all the `Order` expression into a single expression.
    3950            dialect: the dialect used to parse the input expression.
    3951            copy: if `False`, modify this expression instance in-place.
    3952            opts: other options to use to parse the input expressions.
    3953
    3954        Returns:
    3955            The modified Select expression.
    3956        """
    3957        return _apply_child_list_builder(
    3958            *expressions,
    3959            instance=self,
    3960            arg="sort",
    3961            append=append,
    3962            copy=copy,
    3963            prefix="SORT BY",
    3964            into=Sort,
    3965            dialect=dialect,
    3966            **opts,
    3967        )

Set the SORT BY expression.

###### Example:

>     >>> Select().from_("tbl").select("x").sort_by("x DESC").sql(dialect="hive")
>     'SELECT x FROM tbl SORT BY x DESC'

###### Arguments:

- *expressions: the SQL code strings to parse. If a `Group` instance is passed, this is used as-is. If another `Expression` instance is passed, it will be wrapped in a `SORT`.
- append: if `True`, add to any existing expressions. Otherwise, this flattens all the `Order` expression into a single expression.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Select expression.

def cluster_by( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    3969    def cluster_by(
    3970        self,
    3971        *expressions: t.Optional[ExpOrStr],
    3972        append: bool = True,
    3973        dialect: DialectType = None,
    3974        copy: bool = True,
    3975        **opts,
    3976    ) -> Select:
    3977        """
    3978        Set the CLUSTER BY expression.
    3979
    3980        Example:
    3981            >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql(dialect="hive")
    3982            'SELECT x FROM tbl CLUSTER BY x DESC'
    3983
    3984        Args:
    3985            *expressions: the SQL code strings to parse.
    3986                If a `Group` instance is passed, this is used as-is.
    3987                If another `Expression` instance is passed, it will be wrapped in a `Cluster`.
    3988            append: if `True`, add to any existing expressions.
    3989                Otherwise, this flattens all the `Order` expression into a single expression.
    3990            dialect: the dialect used to parse the input expression.
    3991            copy: if `False`, modify this expression instance in-place.
    3992            opts: other options to use to parse the input expressions.
    3993
    3994        Returns:
    3995            The modified Select expression.
    3996        """
    3997        return _apply_child_list_builder(
    3998            *expressions,
    3999            instance=self,
    4000            arg="cluster",
    4001            append=append,
    4002            copy=copy,
    4003            prefix="CLUSTER BY",
    4004            into=Cluster,
    4005            dialect=dialect,
    4006            **opts,
    4007        )

Set the CLUSTER BY expression.

###### Example:

>     >>> Select().from_("tbl").select("x").cluster_by("x DESC").sql(dialect="hive")
>     'SELECT x FROM tbl CLUSTER BY x DESC'

###### Arguments:

- *expressions: the SQL code strings to parse. If a `Group` instance is passed, this is used as-is. If another `Expression` instance is passed, it will be wrapped in a `Cluster`.
- append: if `True`, add to any existing expressions. Otherwise, this flattens all the `Order` expression into a single expression.
- dialect: the dialect used to parse the input expression.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Select expression.

def select( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    4009    def select(
    4010        self,
    4011        *expressions: t.Optional[ExpOrStr],
    4012        append: bool = True,
    4013        dialect: DialectType = None,
    4014        copy: bool = True,
    4015        **opts,
    4016    ) -> Select:
    4017        return _apply_list_builder(
    4018            *expressions,
    4019            instance=self,
    4020            arg="expressions",
    4021            append=append,
    4022            dialect=dialect,
    4023            into=Expression,
    4024            copy=copy,
    4025            **opts,
    4026        )

Append to or set the SELECT expressions.

###### Example:

>     >>> Select().select("x", "y").sql()
>     'SELECT x, y'

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is.
- append: if `True`, add to any existing expressions. Otherwise, this resets the expressions.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Query expression.

def lateral( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    4028    def lateral(
    4029        self,
    4030        *expressions: t.Optional[ExpOrStr],
    4031        append: bool = True,
    4032        dialect: DialectType = None,
    4033        copy: bool = True,
    4034        **opts,
    4035    ) -> Select:
    4036        """
    4037        Append to or set the LATERAL expressions.
    4038
    4039        Example:
    4040            >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()
    4041            'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'
    4042
    4043        Args:
    4044            *expressions: the SQL code strings to parse.
    4045                If an `Expression` instance is passed, it will be used as-is.
    4046            append: if `True`, add to any existing expressions.
    4047                Otherwise, this resets the expressions.
    4048            dialect: the dialect used to parse the input expressions.
    4049            copy: if `False`, modify this expression instance in-place.
    4050            opts: other options to use to parse the input expressions.
    4051
    4052        Returns:
    4053            The modified Select expression.
    4054        """
    4055        return _apply_list_builder(
    4056            *expressions,
    4057            instance=self,
    4058            arg="laterals",
    4059            append=append,
    4060            into=Lateral,
    4061            prefix="LATERAL VIEW",
    4062            dialect=dialect,
    4063            copy=copy,
    4064            **opts,
    4065        )

Append to or set the LATERAL expressions.

###### Example:

>     >>> Select().select("x").lateral("OUTER explode(y) tbl2 AS z").from_("tbl").sql()
>     'SELECT x FROM tbl LATERAL VIEW OUTER EXPLODE(y) tbl2 AS z'

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is.
- append: if `True`, add to any existing expressions. Otherwise, this resets the expressions.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Select expression.

def join( self, expression: Union[str, Expression], on: Union[str, Expression, NoneType] = None, using: Union[str, Expression, Collection[Union[str, Expression]], NoneType] = None, append: bool = True, join_type: Optional[str] = None, join_alias: Union[Identifier, str, NoneType] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    4067    def join(
    4068        self,
    4069        expression: ExpOrStr,
    4070        on: t.Optional[ExpOrStr] = None,
    4071        using: t.Optional[ExpOrStr | t.Collection[ExpOrStr]] = None,
    4072        append: bool = True,
    4073        join_type: t.Optional[str] = None,
    4074        join_alias: t.Optional[Identifier | str] = None,
    4075        dialect: DialectType = None,
    4076        copy: bool = True,
    4077        **opts,
    4078    ) -> Select:
    4079        """
    4080        Append to or set the JOIN expressions.
    4081
    4082        Example:
    4083            >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()
    4084            'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'
    4085
    4086            >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()
    4087            'SELECT 1 FROM a JOIN b USING (x, y, z)'
    4088
    4089            Use `join_type` to change the type of join:
    4090
    4091            >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()
    4092            'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'
    4093
    4094        Args:
    4095            expression: the SQL code string to parse.
    4096                If an `Expression` instance is passed, it will be used as-is.
    4097            on: optionally specify the join "on" criteria as a SQL string.
    4098                If an `Expression` instance is passed, it will be used as-is.
    4099            using: optionally specify the join "using" criteria as a SQL string.
    4100                If an `Expression` instance is passed, it will be used as-is.
    4101            append: if `True`, add to any existing expressions.
    4102                Otherwise, this resets the expressions.
    4103            join_type: if set, alter the parsed join type.
    4104            join_alias: an optional alias for the joined source.
    4105            dialect: the dialect used to parse the input expressions.
    4106            copy: if `False`, modify this expression instance in-place.
    4107            opts: other options to use to parse the input expressions.
    4108
    4109        Returns:
    4110            Select: the modified expression.
    4111        """
    4112        parse_args: t.Dict[str, t.Any] = {"dialect": dialect, **opts}
    4113
    4114        try:
    4115            expression = maybe_parse(expression, into=Join, prefix="JOIN", **parse_args)
    4116        except ParseError:
    4117            expression = maybe_parse(expression, into=(Join, Expression), **parse_args)
    4118
    4119        join = expression if isinstance(expression, Join) else Join(this=expression)
    4120
    4121        if isinstance(join.this, Select):
    4122            join.this.replace(join.this.subquery())
    4123
    4124        if join_type:
    4125            method: t.Optional[Token]
    4126            side: t.Optional[Token]
    4127            kind: t.Optional[Token]
    4128
    4129            method, side, kind = maybe_parse(join_type, into="JOIN_TYPE", **parse_args)  # type: ignore
    4130
    4131            if method:
    4132                join.set("method", method.text)
    4133            if side:
    4134                join.set("side", side.text)
    4135            if kind:
    4136                join.set("kind", kind.text)
    4137
    4138        if on:
    4139            on = and_(*ensure_list(on), dialect=dialect, copy=copy, **opts)
    4140            join.set("on", on)
    4141
    4142        if using:
    4143            join = _apply_list_builder(
    4144                *ensure_list(using),
    4145                instance=join,
    4146                arg="using",
    4147                append=append,
    4148                copy=copy,
    4149                into=Identifier,
    4150                **opts,
    4151            )
    4152
    4153        if join_alias:
    4154            join.set("this", alias_(join.this, join_alias, table=True))
    4155
    4156        return _apply_list_builder(
    4157            join,
    4158            instance=self,
    4159            arg="joins",
    4160            append=append,
    4161            copy=copy,
    4162            **opts,
    4163        )

Append to or set the JOIN expressions.

###### Example:

>     >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y").sql()
>     'SELECT * FROM tbl JOIN tbl2 ON tbl1.y = tbl2.y'

>     >>> Select().select("1").from_("a").join("b", using=["x", "y", "z"]).sql()
>     'SELECT 1 FROM a JOIN b USING (x, y, z)'

> Use `join_type` to change the type of join:

>     >>> Select().select("*").from_("tbl").join("tbl2", on="tbl1.y = tbl2.y", join_type="left outer").sql()
>     'SELECT * FROM tbl LEFT OUTER JOIN tbl2 ON tbl1.y = tbl2.y'

###### Arguments:

- expression: the SQL code string to parse. If an `Expression` instance is passed, it will be used as-is.
- on: optionally specify the join "on" criteria as a SQL string. If an `Expression` instance is passed, it will be used as-is.
- using: optionally specify the join "using" criteria as a SQL string. If an `Expression` instance is passed, it will be used as-is.
- append: if `True`, add to any existing expressions. Otherwise, this resets the expressions.
- join_type: if set, alter the parsed join type.
- join_alias: an optional alias for the joined source.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> Select: the modified expression.

def having( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    4165    def having(
    4166        self,
    4167        *expressions: t.Optional[ExpOrStr],
    4168        append: bool = True,
    4169        dialect: DialectType = None,
    4170        copy: bool = True,
    4171        **opts,
    4172    ) -> Select:
    4173        """
    4174        Append to or set the HAVING expressions.
    4175
    4176        Example:
    4177            >>> Select().select("x", "COUNT(y)").from_("tbl").group_by("x").having("COUNT(y) > 3").sql()
    4178            'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'
    4179
    4180        Args:
    4181            *expressions: the SQL code strings to parse.
    4182                If an `Expression` instance is passed, it will be used as-is.
    4183                Multiple expressions are combined with an AND operator.
    4184            append: if `True`, AND the new expressions to any existing expression.
    4185                Otherwise, this resets the expression.
    4186            dialect: the dialect used to parse the input expressions.
    4187            copy: if `False`, modify this expression instance in-place.
    4188            opts: other options to use to parse the input expressions.
    4189
    4190        Returns:
    4191            The modified Select expression.
    4192        """
    4193        return _apply_conjunction_builder(
    4194            *expressions,
    4195            instance=self,
    4196            arg="having",
    4197            append=append,
    4198            into=Having,
    4199            dialect=dialect,
    4200            copy=copy,
    4201            **opts,
    4202        )

Append to or set the HAVING expressions.

###### Example:

>     >>> Select().select("x", "COUNT(y)").from_("tbl").group_by("x").having("COUNT(y) > 3").sql()
>     'SELECT x, COUNT(y) FROM tbl GROUP BY x HAVING COUNT(y) > 3'

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is. Multiple expressions are combined with an AND operator.
- append: if `True`, AND the new expressions to any existing expression. Otherwise, this resets the expression.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Select expression.

def window( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    4204    def window(
    4205        self,
    4206        *expressions: t.Optional[ExpOrStr],
    4207        append: bool = True,
    4208        dialect: DialectType = None,
    4209        copy: bool = True,
    4210        **opts,
    4211    ) -> Select:
    4212        return _apply_list_builder(
    4213            *expressions,
    4214            instance=self,
    4215            arg="windows",
    4216            append=append,
    4217            into=Window,
    4218            dialect=dialect,
    4219            copy=copy,
    4220            **opts,
    4221        )

def qualify( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Select: View Source

    4223    def qualify(
    4224        self,
    4225        *expressions: t.Optional[ExpOrStr],
    4226        append: bool = True,
    4227        dialect: DialectType = None,
    4228        copy: bool = True,
    4229        **opts,
    4230    ) -> Select:
    4231        return _apply_conjunction_builder(
    4232            *expressions,
    4233            instance=self,
    4234            arg="qualify",
    4235            append=append,
    4236            into=Qualify,
    4237            dialect=dialect,
    4238            copy=copy,
    4239            **opts,
    4240        )

def distinct( self, *ons: Union[str, Expression, NoneType], distinct: bool = True, copy: bool = True) -> Select: View Source

    4242    def distinct(
    4243        self, *ons: t.Optional[ExpOrStr], distinct: bool = True, copy: bool = True
    4244    ) -> Select:
    4245        """
    4246        Set the OFFSET expression.
    4247
    4248        Example:
    4249            >>> Select().from_("tbl").select("x").distinct().sql()
    4250            'SELECT DISTINCT x FROM tbl'
    4251
    4252        Args:
    4253            ons: the expressions to distinct on
    4254            distinct: whether the Select should be distinct
    4255            copy: if `False`, modify this expression instance in-place.
    4256
    4257        Returns:
    4258            Select: the modified expression.
    4259        """
    4260        instance = maybe_copy(self, copy)
    4261        on = Tuple(expressions=[maybe_parse(on, copy=copy) for on in ons if on]) if ons else None
    4262        instance.set("distinct", Distinct(on=on) if distinct else None)
    4263        return instance

Set the OFFSET expression.

###### Example:

>     >>> Select().from_("tbl").select("x").distinct().sql()
>     'SELECT DISTINCT x FROM tbl'

###### Arguments:

- ons: the expressions to distinct on
- distinct: whether the Select should be distinct
- copy: if `False`, modify this expression instance in-place.

###### Returns:

> Select: the modified expression.

def ctas( self, table: Union[str, Expression], properties: Optional[Dict] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Create: View Source

    4265    def ctas(
    4266        self,
    4267        table: ExpOrStr,
    4268        properties: t.Optional[t.Dict] = None,
    4269        dialect: DialectType = None,
    4270        copy: bool = True,
    4271        **opts,
    4272    ) -> Create:
    4273        """
    4274        Convert this expression to a CREATE TABLE AS statement.
    4275
    4276        Example:
    4277            >>> Select().select("*").from_("tbl").ctas("x").sql()
    4278            'CREATE TABLE x AS SELECT * FROM tbl'
    4279
    4280        Args:
    4281            table: the SQL code string to parse as the table name.
    4282                If another `Expression` instance is passed, it will be used as-is.
    4283            properties: an optional mapping of table properties
    4284            dialect: the dialect used to parse the input table.
    4285            copy: if `False`, modify this expression instance in-place.
    4286            opts: other options to use to parse the input table.
    4287
    4288        Returns:
    4289            The new Create expression.
    4290        """
    4291        instance = maybe_copy(self, copy)
    4292        table_expression = maybe_parse(table, into=Table, dialect=dialect, **opts)
    4293
    4294        properties_expression = None
    4295        if properties:
    4296            properties_expression = Properties.from_dict(properties)
    4297
    4298        return Create(
    4299            this=table_expression,
    4300            kind="TABLE",
    4301            expression=instance,
    4302            properties=properties_expression,
    4303        )

Convert this expression to a CREATE TABLE AS statement.

###### Example:

>     >>> Select().select("*").from_("tbl").ctas("x").sql()
>     'CREATE TABLE x AS SELECT * FROM tbl'

###### Arguments:

- table: the SQL code string to parse as the table name. If another `Expression` instance is passed, it will be used as-is.
- properties: an optional mapping of table properties
- dialect: the dialect used to parse the input table.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input table.

###### Returns:

> The new Create expression.

def lock( self, update: bool = True, copy: bool = True) -> Select: View Source

    4305    def lock(self, update: bool = True, copy: bool = True) -> Select:
    4306        """
    4307        Set the locking read mode for this expression.
    4308
    4309        Examples:
    4310            >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")
    4311            "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"
    4312
    4313            >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")
    4314            "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"
    4315
    4316        Args:
    4317            update: if `True`, the locking type will be `FOR UPDATE`, else it will be `FOR SHARE`.
    4318            copy: if `False`, modify this expression instance in-place.
    4319
    4320        Returns:
    4321            The modified expression.
    4322        """
    4323        inst = maybe_copy(self, copy)
    4324        inst.set("locks", [Lock(update=update)])
    4325
    4326        return inst

Set the locking read mode for this expression.

###### Examples:

>     >>> Select().select("x").from_("tbl").where("x = 'a'").lock().sql("mysql")
>     "SELECT x FROM tbl WHERE x = 'a' FOR UPDATE"

>     >>> Select().select("x").from_("tbl").where("x = 'a'").lock(update=False).sql("mysql")
>     "SELECT x FROM tbl WHERE x = 'a' FOR SHARE"

###### Arguments:

- update: if `True`, the locking type will be `FOR UPDATE`, else it will be `FOR SHARE`.
- copy: if `False`, modify this expression instance in-place.

###### Returns:

> The modified expression.

def hint( self, *hints: Union[str, Expression], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True) -> Select: View Source

    4328    def hint(self, *hints: ExpOrStr, dialect: DialectType = None, copy: bool = True) -> Select:
    4329        """
    4330        Set hints for this expression.
    4331
    4332        Examples:
    4333            >>> Select().select("x").from_("tbl").hint("BROADCAST(y)").sql(dialect="spark")
    4334            'SELECT /*+ BROADCAST(y) */ x FROM tbl'
    4335
    4336        Args:
    4337            hints: The SQL code strings to parse as the hints.
    4338                If an `Expression` instance is passed, it will be used as-is.
    4339            dialect: The dialect used to parse the hints.
    4340            copy: If `False`, modify this expression instance in-place.
    4341
    4342        Returns:
    4343            The modified expression.
    4344        """
    4345        inst = maybe_copy(self, copy)
    4346        inst.set(
    4347            "hint", Hint(expressions=[maybe_parse(h, copy=copy, dialect=dialect) for h in hints])
    4348        )
    4349
    4350        return inst

Set hints for this expression.

###### Examples:

>     >>> Select().select("x").from_("tbl").hint("BROADCAST(y)").sql(dialect="spark")
>     'SELECT /*+ BROADCAST(y) */ x FROM tbl'

###### Arguments:

- hints: The SQL code strings to parse as the hints. If an `Expression` instance is passed, it will be used as-is.
- dialect: The dialect used to parse the hints.
- copy: If `False`, modify this expression instance in-place.

###### Returns:

> The modified expression.

named_selects: List[str] View Source

    4352    @property
    4353    def named_selects(self) -> t.List[str]:
    4354        selects = []
    4355
    4356        for e in self.expressions:
    4357            if e.alias_or_name:
    4358                selects.append(e.output_name)
    4359            elif isinstance(e, Aliases):
    4360                selects.extend([a.name for a in e.aliases])
    4361        return selects

Returns the output names of the query's projections.

is_star: bool View Source

    4363    @property
    4364    def is_star(self) -> bool:
    4365        return any(expression.is_star for expression in self.expressions)

Checks whether an expression is a star.

selects: List[Expression] View Source

    4367    @property
    4368    def selects(self) -> t.List[Expression]:
    4369        return self.expressions

Returns the query's projections.

key = 'select'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Query
  subquery
  limit
  offset
  order_by
  ctes
  where
  with_
  union
  intersect
  except_

UNWRAPPED_QUERIES = (<class 'Select'>, <class 'SetOperation'>)
class Subquery(DerivedTable, Query): View Source

    4375class Subquery(DerivedTable, Query):
    4376    arg_types = {
    4377        "this": True,
    4378        "alias": False,
    4379        "with": False,
    4380        **QUERY_MODIFIERS,
    4381    }
    4382
    4383    def unnest(self):
    4384        """Returns the first non subquery."""
    4385        expression = self
    4386        while isinstance(expression, Subquery):
    4387            expression = expression.this
    4388        return expression
    4389
    4390    def unwrap(self) -> Subquery:
    4391        expression = self
    4392        while expression.same_parent and expression.is_wrapper:
    4393            expression = t.cast(Subquery, expression.parent)
    4394        return expression
    4395
    4396    def select(
    4397        self,
    4398        *expressions: t.Optional[ExpOrStr],
    4399        append: bool = True,
    4400        dialect: DialectType = None,
    4401        copy: bool = True,
    4402        **opts,
    4403    ) -> Subquery:
    4404        this = maybe_copy(self, copy)
    4405        this.unnest().select(*expressions, append=append, dialect=dialect, copy=False, **opts)
    4406        return this
    4407
    4408    @property
    4409    def is_wrapper(self) -> bool:
    4410        """
    4411        Whether this Subquery acts as a simple wrapper around another expression.
    4412
    4413        SELECT * FROM (((SELECT * FROM t)))
    4414                      ^
    4415                      This corresponds to a "wrapper" Subquery node
    4416        """
    4417        return all(v is None for k, v in self.args.items() if k != "this")
    4418
    4419    @property
    4420    def is_star(self) -> bool:
    4421        return self.this.is_star
    4422
    4423    @property
    4424    def output_name(self) -> str:
    4425        return self.alias

arg_types = {'this': True, 'alias': False, 'with': False, 'match': False, 'laterals': False, 'joins': False, 'connect': False, 'pivots': False, 'prewhere': False, 'where': False, 'group': False, 'having': False, 'qualify': False, 'windows': False, 'distribute': False, 'sort': False, 'cluster': False, 'order': False, 'limit': False, 'offset': False, 'locks': False, 'sample': False, 'settings': False, 'format': False, 'options': False}
def unnest(self): View Source

    4383    def unnest(self):
    4384        """Returns the first non subquery."""
    4385        expression = self
    4386        while isinstance(expression, Subquery):
    4387            expression = expression.this
    4388        return expression

Returns the first non subquery.

def unwrap(self) -> Subquery: View Source

    4390    def unwrap(self) -> Subquery:
    4391        expression = self
    4392        while expression.same_parent and expression.is_wrapper:
    4393            expression = t.cast(Subquery, expression.parent)
    4394        return expression

def select( self, *expressions: Union[str, Expression, NoneType], append: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Subquery: View Source

    4396    def select(
    4397        self,
    4398        *expressions: t.Optional[ExpOrStr],
    4399        append: bool = True,
    4400        dialect: DialectType = None,
    4401        copy: bool = True,
    4402        **opts,
    4403    ) -> Subquery:
    4404        this = maybe_copy(self, copy)
    4405        this.unnest().select(*expressions, append=append, dialect=dialect, copy=False, **opts)
    4406        return this

Append to or set the SELECT expressions.

###### Example:

>     >>> Select().select("x", "y").sql()
>     'SELECT x, y'

###### Arguments:

- *expressions: the SQL code strings to parse. If an `Expression` instance is passed, it will be used as-is.
- append: if `True`, add to any existing expressions. Otherwise, this resets the expressions.
- dialect: the dialect used to parse the input expressions.
- copy: if `False`, modify this expression instance in-place.
- opts: other options to use to parse the input expressions.

###### Returns:

> The modified Query expression.

is_wrapper: bool View Source

    4408    @property
    4409    def is_wrapper(self) -> bool:
    4410        """
    4411        Whether this Subquery acts as a simple wrapper around another expression.
    4412
    4413        SELECT * FROM (((SELECT * FROM t)))
    4414                      ^
    4415                      This corresponds to a "wrapper" Subquery node
    4416        """
    4417        return all(v is None for k, v in self.args.items() if k != "this")

Whether this Subquery acts as a simple wrapper around another expression.

SELECT * FROM (((SELECT * FROM t))) ^ This corresponds to a "wrapper" Subquery node

is_star: bool View Source

    4419    @property
    4420    def is_star(self) -> bool:
    4421        return self.this.is_star

Checks whether an expression is a star.

output_name: str View Source

    4423    @property
    4424    def output_name(self) -> str:
    4425        return self.alias

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

key = 'subquery'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DerivedTable
  selects
  named_selects
Query
  subquery
  limit
  offset
  order_by
  ctes
  where
  with_
  union
  intersect
  except_

class TableSample(Expression): View Source

    4428class TableSample(Expression):
    4429    arg_types = {
    4430        "expressions": False,
    4431        "method": False,
    4432        "bucket_numerator": False,
    4433        "bucket_denominator": False,
    4434        "bucket_field": False,
    4435        "percent": False,
    4436        "rows": False,
    4437        "size": False,
    4438        "seed": False,
    4439    }

arg_types = {'expressions': False, 'method': False, 'bucket_numerator': False, 'bucket_denominator': False, 'bucket_field': False, 'percent': False, 'rows': False, 'size': False, 'seed': False}
key = 'tablesample'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Tag(Expression): View Source

    4442class Tag(Expression):
    4443    """Tags are used for generating arbitrary sql like SELECT <span>x</span>."""
    4444
    4445    arg_types = {
    4446        "this": False,
    4447        "prefix": False,
    4448        "postfix": False,
    4449    }

Tags are used for generating arbitrary sql like SELECT x.

arg_types = {'this': False, 'prefix': False, 'postfix': False}
key = 'tag'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Pivot(Expression): View Source

    4454class Pivot(Expression):
    4455    arg_types = {
    4456        "this": False,
    4457        "alias": False,
    4458        "expressions": False,
    4459        "fields": False,
    4460        "unpivot": False,
    4461        "using": False,
    4462        "group": False,
    4463        "columns": False,
    4464        "include_nulls": False,
    4465        "default_on_null": False,
    4466        "into": False,
    4467    }
    4468
    4469    @property
    4470    def unpivot(self) -> bool:
    4471        return bool(self.args.get("unpivot"))
    4472
    4473    @property
    4474    def fields(self) -> t.List[Expression]:
    4475        return self.args.get("fields", [])

arg_types = {'this': False, 'alias': False, 'expressions': False, 'fields': False, 'unpivot': False, 'using': False, 'group': False, 'columns': False, 'include_nulls': False, 'default_on_null': False, 'into': False}
unpivot: bool View Source

    4469    @property
    4470    def unpivot(self) -> bool:
    4471        return bool(self.args.get("unpivot"))

fields: List[Expression] View Source

    4473    @property
    4474    def fields(self) -> t.List[Expression]:
    4475        return self.args.get("fields", [])

key = 'pivot'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class UnpivotColumns(Expression): View Source

    4480class UnpivotColumns(Expression):
    4481    arg_types = {"this": True, "expressions": True}

arg_types = {'this': True, 'expressions': True}
key = 'unpivotcolumns'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Window(Condition): View Source

    4484class Window(Condition):
    4485    arg_types = {
    4486        "this": True,
    4487        "partition_by": False,
    4488        "order": False,
    4489        "spec": False,
    4490        "alias": False,
    4491        "over": False,
    4492        "first": False,
    4493    }

arg_types = {'this': True, 'partition_by': False, 'order': False, 'spec': False, 'alias': False, 'over': False, 'first': False}
key = 'window'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class WindowSpec(Expression): View Source

    4496class WindowSpec(Expression):
    4497    arg_types = {
    4498        "kind": False,
    4499        "start": False,
    4500        "start_side": False,
    4501        "end": False,
    4502        "end_side": False,
    4503        "exclude": False,
    4504    }

arg_types = {'kind': False, 'start': False, 'start_side': False, 'end': False, 'end_side': False, 'exclude': False}
key = 'windowspec'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PreWhere(Expression): View Source

    4507class PreWhere(Expression):
    4508    pass

key = 'prewhere'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Where(Expression): View Source

    4511class Where(Expression):
    4512    pass

key = 'where'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Star(Expression): View Source

    4515class Star(Expression):
    4516    arg_types = {"except": False, "replace": False, "rename": False}
    4517
    4518    @property
    4519    def name(self) -> str:
    4520        return "*"
    4521
    4522    @property
    4523    def output_name(self) -> str:
    4524        return self.name

arg_types = {'except': False, 'replace': False, 'rename': False}
name: str View Source

    4518    @property
    4519    def name(self) -> str:
    4520        return "*"

output_name: str View Source

    4522    @property
    4523    def output_name(self) -> str:
    4524        return self.name

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

key = 'star'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Parameter(Condition): View Source

    4527class Parameter(Condition):
    4528    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'parameter'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class SessionParameter(Condition): View Source

    4531class SessionParameter(Condition):
    4532    arg_types = {"this": True, "kind": False}

arg_types = {'this': True, 'kind': False}
key = 'sessionparameter'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Placeholder(Condition): View Source

    4537class Placeholder(Condition):
    4538    arg_types = {"this": False, "kind": False, "widget": False, "jdbc": False}
    4539
    4540    @property
    4541    def name(self) -> str:
    4542        return self.this or "?"

arg_types = {'this': False, 'kind': False, 'widget': False, 'jdbc': False}
name: str View Source

    4540    @property
    4541    def name(self) -> str:
    4542        return self.this or "?"

key = 'placeholder'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Null(Condition): View Source

    4545class Null(Condition):
    4546    arg_types: t.Dict[str, t.Any] = {}
    4547
    4548    @property
    4549    def name(self) -> str:
    4550        return "NULL"
    4551
    4552    def to_py(self) -> Lit[None]:
    4553        return None

arg_types: Dict[str, Any] = {}
name: str View Source

    4548    @property
    4549    def name(self) -> str:
    4550        return "NULL"

def to_py(self) -> Literal[None]: View Source

    4552    def to_py(self) -> Lit[None]:
    4553        return None

Returns a Python object equivalent of the SQL node.

key = 'null'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  is_int
  is_star
  alias
  alias_column_names
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Boolean(Condition): View Source

    4556class Boolean(Condition):
    4557    def to_py(self) -> bool:
    4558        return self.this

def to_py(self) -> bool: View Source

    4557    def to_py(self) -> bool:
    4558        return self.this

Returns a Python object equivalent of the SQL node.

key = 'boolean'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DataTypeParam(Expression): View Source

    4561class DataTypeParam(Expression):
    4562    arg_types = {"this": True, "expression": False}
    4563
    4564    @property
    4565    def name(self) -> str:
    4566        return self.this.name

arg_types = {'this': True, 'expression': False}
name: str View Source

    4564    @property
    4565    def name(self) -> str:
    4566        return self.this.name

key = 'datatypeparam'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DataType(Expression): View Source

    4571class DataType(Expression):
    4572    arg_types = {
    4573        "this": True,
    4574        "expressions": False,
    4575        "nested": False,
    4576        "values": False,
    4577        "prefix": False,
    4578        "kind": False,
    4579        "nullable": False,
    4580    }
    4581
    4582    class Type(AutoName):
    4583        ARRAY = auto()
    4584        AGGREGATEFUNCTION = auto()
    4585        SIMPLEAGGREGATEFUNCTION = auto()
    4586        BIGDECIMAL = auto()
    4587        BIGINT = auto()
    4588        BIGSERIAL = auto()
    4589        BINARY = auto()
    4590        BIT = auto()
    4591        BLOB = auto()
    4592        BOOLEAN = auto()
    4593        BPCHAR = auto()
    4594        CHAR = auto()
    4595        DATE = auto()
    4596        DATE32 = auto()
    4597        DATEMULTIRANGE = auto()
    4598        DATERANGE = auto()
    4599        DATETIME = auto()
    4600        DATETIME2 = auto()
    4601        DATETIME64 = auto()
    4602        DECIMAL = auto()
    4603        DECIMAL32 = auto()
    4604        DECIMAL64 = auto()
    4605        DECIMAL128 = auto()
    4606        DECIMAL256 = auto()
    4607        DOUBLE = auto()
    4608        DYNAMIC = auto()
    4609        ENUM = auto()
    4610        ENUM8 = auto()
    4611        ENUM16 = auto()
    4612        FIXEDSTRING = auto()
    4613        FLOAT = auto()
    4614        GEOGRAPHY = auto()
    4615        GEOGRAPHYPOINT = auto()
    4616        GEOMETRY = auto()
    4617        POINT = auto()
    4618        RING = auto()
    4619        LINESTRING = auto()
    4620        MULTILINESTRING = auto()
    4621        POLYGON = auto()
    4622        MULTIPOLYGON = auto()
    4623        HLLSKETCH = auto()
    4624        HSTORE = auto()
    4625        IMAGE = auto()
    4626        INET = auto()
    4627        INT = auto()
    4628        INT128 = auto()
    4629        INT256 = auto()
    4630        INT4MULTIRANGE = auto()
    4631        INT4RANGE = auto()
    4632        INT8MULTIRANGE = auto()
    4633        INT8RANGE = auto()
    4634        INTERVAL = auto()
    4635        IPADDRESS = auto()
    4636        IPPREFIX = auto()
    4637        IPV4 = auto()
    4638        IPV6 = auto()
    4639        JSON = auto()
    4640        JSONB = auto()
    4641        LIST = auto()
    4642        LONGBLOB = auto()
    4643        LONGTEXT = auto()
    4644        LOWCARDINALITY = auto()
    4645        MAP = auto()
    4646        MEDIUMBLOB = auto()
    4647        MEDIUMINT = auto()
    4648        MEDIUMTEXT = auto()
    4649        MONEY = auto()
    4650        NAME = auto()
    4651        NCHAR = auto()
    4652        NESTED = auto()
    4653        NOTHING = auto()
    4654        NULL = auto()
    4655        NUMMULTIRANGE = auto()
    4656        NUMRANGE = auto()
    4657        NVARCHAR = auto()
    4658        OBJECT = auto()
    4659        RANGE = auto()
    4660        ROWVERSION = auto()
    4661        SERIAL = auto()
    4662        SET = auto()
    4663        SMALLDATETIME = auto()
    4664        SMALLINT = auto()
    4665        SMALLMONEY = auto()
    4666        SMALLSERIAL = auto()
    4667        STRUCT = auto()
    4668        SUPER = auto()
    4669        TEXT = auto()
    4670        TINYBLOB = auto()
    4671        TINYTEXT = auto()
    4672        TIME = auto()
    4673        TIMETZ = auto()
    4674        TIMESTAMP = auto()
    4675        TIMESTAMPNTZ = auto()
    4676        TIMESTAMPLTZ = auto()
    4677        TIMESTAMPTZ = auto()
    4678        TIMESTAMP_S = auto()
    4679        TIMESTAMP_MS = auto()
    4680        TIMESTAMP_NS = auto()
    4681        TINYINT = auto()
    4682        TSMULTIRANGE = auto()
    4683        TSRANGE = auto()
    4684        TSTZMULTIRANGE = auto()
    4685        TSTZRANGE = auto()
    4686        UBIGINT = auto()
    4687        UINT = auto()
    4688        UINT128 = auto()
    4689        UINT256 = auto()
    4690        UMEDIUMINT = auto()
    4691        UDECIMAL = auto()
    4692        UDOUBLE = auto()
    4693        UNION = auto()
    4694        UNKNOWN = auto()  # Sentinel value, useful for type annotation
    4695        USERDEFINED = "USER-DEFINED"
    4696        USMALLINT = auto()
    4697        UTINYINT = auto()
    4698        UUID = auto()
    4699        VARBINARY = auto()
    4700        VARCHAR = auto()
    4701        VARIANT = auto()
    4702        VECTOR = auto()
    4703        XML = auto()
    4704        YEAR = auto()
    4705        TDIGEST = auto()
    4706
    4707    STRUCT_TYPES = {
    4708        Type.NESTED,
    4709        Type.OBJECT,
    4710        Type.STRUCT,
    4711        Type.UNION,
    4712    }
    4713
    4714    ARRAY_TYPES = {
    4715        Type.ARRAY,
    4716        Type.LIST,
    4717    }
    4718
    4719    NESTED_TYPES = {
    4720        *STRUCT_TYPES,
    4721        *ARRAY_TYPES,
    4722        Type.MAP,
    4723    }
    4724
    4725    TEXT_TYPES = {
    4726        Type.CHAR,
    4727        Type.NCHAR,
    4728        Type.NVARCHAR,
    4729        Type.TEXT,
    4730        Type.VARCHAR,
    4731        Type.NAME,
    4732    }
    4733
    4734    SIGNED_INTEGER_TYPES = {
    4735        Type.BIGINT,
    4736        Type.INT,
    4737        Type.INT128,
    4738        Type.INT256,
    4739        Type.MEDIUMINT,
    4740        Type.SMALLINT,
    4741        Type.TINYINT,
    4742    }
    4743
    4744    UNSIGNED_INTEGER_TYPES = {
    4745        Type.UBIGINT,
    4746        Type.UINT,
    4747        Type.UINT128,
    4748        Type.UINT256,
    4749        Type.UMEDIUMINT,
    4750        Type.USMALLINT,
    4751        Type.UTINYINT,
    4752    }
    4753
    4754    INTEGER_TYPES = {
    4755        *SIGNED_INTEGER_TYPES,
    4756        *UNSIGNED_INTEGER_TYPES,
    4757        Type.BIT,
    4758    }
    4759
    4760    FLOAT_TYPES = {
    4761        Type.DOUBLE,
    4762        Type.FLOAT,
    4763    }
    4764
    4765    REAL_TYPES = {
    4766        *FLOAT_TYPES,
    4767        Type.BIGDECIMAL,
    4768        Type.DECIMAL,
    4769        Type.DECIMAL32,
    4770        Type.DECIMAL64,
    4771        Type.DECIMAL128,
    4772        Type.DECIMAL256,
    4773        Type.MONEY,
    4774        Type.SMALLMONEY,
    4775        Type.UDECIMAL,
    4776        Type.UDOUBLE,
    4777    }
    4778
    4779    NUMERIC_TYPES = {
    4780        *INTEGER_TYPES,
    4781        *REAL_TYPES,
    4782    }
    4783
    4784    TEMPORAL_TYPES = {
    4785        Type.DATE,
    4786        Type.DATE32,
    4787        Type.DATETIME,
    4788        Type.DATETIME2,
    4789        Type.DATETIME64,
    4790        Type.SMALLDATETIME,
    4791        Type.TIME,
    4792        Type.TIMESTAMP,
    4793        Type.TIMESTAMPNTZ,
    4794        Type.TIMESTAMPLTZ,
    4795        Type.TIMESTAMPTZ,
    4796        Type.TIMESTAMP_MS,
    4797        Type.TIMESTAMP_NS,
    4798        Type.TIMESTAMP_S,
    4799        Type.TIMETZ,
    4800    }
    4801
    4802    @classmethod
    4803    def build(
    4804        cls,
    4805        dtype: DATA_TYPE,
    4806        dialect: DialectType = None,
    4807        udt: bool = False,
    4808        copy: bool = True,
    4809        **kwargs,
    4810    ) -> DataType:
    4811        """
    4812        Constructs a DataType object.
    4813
    4814        Args:
    4815            dtype: the data type of interest.
    4816            dialect: the dialect to use for parsing `dtype`, in case it's a string.
    4817            udt: when set to True, `dtype` will be used as-is if it can't be parsed into a
    4818                DataType, thus creating a user-defined type.
    4819            copy: whether to copy the data type.
    4820            kwargs: additional arguments to pass in the constructor of DataType.
    4821
    4822        Returns:
    4823            The constructed DataType object.
    4824        """
    4825        from sqlglot import parse_one
    4826
    4827        if isinstance(dtype, str):
    4828            if dtype.upper() == "UNKNOWN":
    4829                return DataType(this=DataType.Type.UNKNOWN, **kwargs)
    4830
    4831            try:
    4832                data_type_exp = parse_one(
    4833                    dtype, read=dialect, into=DataType, error_level=ErrorLevel.IGNORE
    4834                )
    4835            except ParseError:
    4836                if udt:
    4837                    return DataType(this=DataType.Type.USERDEFINED, kind=dtype, **kwargs)
    4838                raise
    4839        elif isinstance(dtype, (Identifier, Dot)) and udt:
    4840            return DataType(this=DataType.Type.USERDEFINED, kind=dtype, **kwargs)
    4841        elif isinstance(dtype, DataType.Type):
    4842            data_type_exp = DataType(this=dtype)
    4843        elif isinstance(dtype, DataType):
    4844            return maybe_copy(dtype, copy)
    4845        else:
    4846            raise ValueError(f"Invalid data type: {type(dtype)}. Expected str or DataType.Type")
    4847
    4848        return DataType(**{**data_type_exp.args, **kwargs})
    4849
    4850    def is_type(self, *dtypes: DATA_TYPE, check_nullable: bool = False) -> bool:
    4851        """
    4852        Checks whether this DataType matches one of the provided data types. Nested types or precision
    4853        will be compared using "structural equivalence" semantics, so e.g. array<int> != array<float>.
    4854
    4855        Args:
    4856            dtypes: the data types to compare this DataType to.
    4857            check_nullable: whether to take the NULLABLE type constructor into account for the comparison.
    4858                If false, it means that NULLABLE<INT> is equivalent to INT.
    4859
    4860        Returns:
    4861            True, if and only if there is a type in `dtypes` which is equal to this DataType.
    4862        """
    4863        self_is_nullable = self.args.get("nullable")
    4864        for dtype in dtypes:
    4865            other_type = DataType.build(dtype, copy=False, udt=True)
    4866            other_is_nullable = other_type.args.get("nullable")
    4867            if (
    4868                other_type.expressions
    4869                or (check_nullable and (self_is_nullable or other_is_nullable))
    4870                or self.this == DataType.Type.USERDEFINED
    4871                or other_type.this == DataType.Type.USERDEFINED
    4872            ):
    4873                matches = self == other_type
    4874            else:
    4875                matches = self.this == other_type.this
    4876
    4877            if matches:
    4878                return True
    4879        return False

arg_types = {'this': True, 'expressions': False, 'nested': False, 'values': False, 'prefix': False, 'kind': False, 'nullable': False}
STRUCT_TYPES = {<Type.STRUCT: 'STRUCT'>, <Type.UNION: 'UNION'>, <Type.OBJECT: 'OBJECT'>, <Type.NESTED: 'NESTED'>}
ARRAY_TYPES = {<Type.LIST: 'LIST'>, <Type.ARRAY: 'ARRAY'>}
NESTED_TYPES = {<Type.LIST: 'LIST'>, <Type.UNION: 'UNION'>, <Type.ARRAY: 'ARRAY'>, <Type.STRUCT: 'STRUCT'>, <Type.MAP: 'MAP'>, <Type.OBJECT: 'OBJECT'>, <Type.NESTED: 'NESTED'>}
TEXT_TYPES = {<Type.NAME: 'NAME'>, <Type.VARCHAR: 'VARCHAR'>, <Type.NVARCHAR: 'NVARCHAR'>, <Type.NCHAR: 'NCHAR'>, <Type.TEXT: 'TEXT'>, <Type.CHAR: 'CHAR'>}
SIGNED_INTEGER_TYPES = {<Type.INT: 'INT'>, <Type.INT256: 'INT256'>, <Type.TINYINT: 'TINYINT'>, <Type.MEDIUMINT: 'MEDIUMINT'>, <Type.SMALLINT: 'SMALLINT'>, <Type.BIGINT: 'BIGINT'>, <Type.INT128: 'INT128'>}
UNSIGNED_INTEGER_TYPES = {<Type.USMALLINT: 'USMALLINT'>, <Type.UINT256: 'UINT256'>, <Type.UMEDIUMINT: 'UMEDIUMINT'>, <Type.UINT: 'UINT'>, <Type.UINT128: 'UINT128'>, <Type.UBIGINT: 'UBIGINT'>, <Type.UTINYINT: 'UTINYINT'>}
INTEGER_TYPES = {<Type.USMALLINT: 'USMALLINT'>, <Type.UINT256: 'UINT256'>, <Type.UMEDIUMINT: 'UMEDIUMINT'>, <Type.INT: 'INT'>, <Type.INT256: 'INT256'>, <Type.TINYINT: 'TINYINT'>, <Type.UINT: 'UINT'>, <Type.UINT128: 'UINT128'>, <Type.MEDIUMINT: 'MEDIUMINT'>, <Type.SMALLINT: 'SMALLINT'>, <Type.BIT: 'BIT'>, <Type.BIGINT: 'BIGINT'>, <Type.INT128: 'INT128'>, <Type.UTINYINT: 'UTINYINT'>, <Type.UBIGINT: 'UBIGINT'>}
FLOAT_TYPES = {<Type.DOUBLE: 'DOUBLE'>, <Type.FLOAT: 'FLOAT'>}
REAL_TYPES = {<Type.MONEY: 'MONEY'>, <Type.FLOAT: 'FLOAT'>, <Type.DECIMAL64: 'DECIMAL64'>, <Type.BIGDECIMAL: 'BIGDECIMAL'>, <Type.DOUBLE: 'DOUBLE'>, <Type.UDOUBLE: 'UDOUBLE'>, <Type.UDECIMAL: 'UDECIMAL'>, <Type.SMALLMONEY: 'SMALLMONEY'>, <Type.DECIMAL128: 'DECIMAL128'>, <Type.DECIMAL256: 'DECIMAL256'>, <Type.DECIMAL32: 'DECIMAL32'>, <Type.DECIMAL: 'DECIMAL'>}
NUMERIC_TYPES = {<Type.USMALLINT: 'USMALLINT'>, <Type.UINT256: 'UINT256'>, <Type.UMEDIUMINT: 'UMEDIUMINT'>, <Type.INT: 'INT'>, <Type.MONEY: 'MONEY'>, <Type.BIGDECIMAL: 'BIGDECIMAL'>, <Type.DOUBLE: 'DOUBLE'>, <Type.SMALLMONEY: 'SMALLMONEY'>, <Type.SMALLINT: 'SMALLINT'>, <Type.BIT: 'BIT'>, <Type.DECIMAL128: 'DECIMAL128'>, <Type.UTINYINT: 'UTINYINT'>, <Type.INT256: 'INT256'>, <Type.FLOAT: 'FLOAT'>, <Type.DECIMAL64: 'DECIMAL64'>, <Type.UDOUBLE: 'UDOUBLE'>, <Type.TINYINT: 'TINYINT'>, <Type.UINT: 'UINT'>, <Type.UDECIMAL: 'UDECIMAL'>, <Type.UINT128: 'UINT128'>, <Type.DECIMAL256: 'DECIMAL256'>, <Type.MEDIUMINT: 'MEDIUMINT'>, <Type.BIGINT: 'BIGINT'>, <Type.INT128: 'INT128'>, <Type.DECIMAL32: 'DECIMAL32'>, <Type.DECIMAL: 'DECIMAL'>, <Type.UBIGINT: 'UBIGINT'>}
TEMPORAL_TYPES = {<Type.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>, <Type.TIMESTAMP_MS: 'TIMESTAMP_MS'>, <Type.DATETIME: 'DATETIME'>, <Type.TIMETZ: 'TIMETZ'>, <Type.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>, <Type.TIMESTAMPTZ: 'TIMESTAMPTZ'>, <Type.TIME: 'TIME'>, <Type.DATETIME2: 'DATETIME2'>, <Type.TIMESTAMP: 'TIMESTAMP'>, <Type.DATE32: 'DATE32'>, <Type.TIMESTAMP_NS: 'TIMESTAMP_NS'>, <Type.TIMESTAMP_S: 'TIMESTAMP_S'>, <Type.DATE: 'DATE'>, <Type.SMALLDATETIME: 'SMALLDATETIME'>, <Type.DATETIME64: 'DATETIME64'>}
@classmethod
def build( cls, dtype: Union[str, Identifier, Dot, DataType, DataType.Type], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, udt: bool = False, copy: bool = True, **kwargs) -> DataType: View Source

    4802    @classmethod
    4803    def build(
    4804        cls,
    4805        dtype: DATA_TYPE,
    4806        dialect: DialectType = None,
    4807        udt: bool = False,
    4808        copy: bool = True,
    4809        **kwargs,
    4810    ) -> DataType:
    4811        """
    4812        Constructs a DataType object.
    4813
    4814        Args:
    4815            dtype: the data type of interest.
    4816            dialect: the dialect to use for parsing `dtype`, in case it's a string.
    4817            udt: when set to True, `dtype` will be used as-is if it can't be parsed into a
    4818                DataType, thus creating a user-defined type.
    4819            copy: whether to copy the data type.
    4820            kwargs: additional arguments to pass in the constructor of DataType.
    4821
    4822        Returns:
    4823            The constructed DataType object.
    4824        """
    4825        from sqlglot import parse_one
    4826
    4827        if isinstance(dtype, str):
    4828            if dtype.upper() == "UNKNOWN":
    4829                return DataType(this=DataType.Type.UNKNOWN, **kwargs)
    4830
    4831            try:
    4832                data_type_exp = parse_one(
    4833                    dtype, read=dialect, into=DataType, error_level=ErrorLevel.IGNORE
    4834                )
    4835            except ParseError:
    4836                if udt:
    4837                    return DataType(this=DataType.Type.USERDEFINED, kind=dtype, **kwargs)
    4838                raise
    4839        elif isinstance(dtype, (Identifier, Dot)) and udt:
    4840            return DataType(this=DataType.Type.USERDEFINED, kind=dtype, **kwargs)
    4841        elif isinstance(dtype, DataType.Type):
    4842            data_type_exp = DataType(this=dtype)
    4843        elif isinstance(dtype, DataType):
    4844            return maybe_copy(dtype, copy)
    4845        else:
    4846            raise ValueError(f"Invalid data type: {type(dtype)}. Expected str or DataType.Type")
    4847
    4848        return DataType(**{**data_type_exp.args, **kwargs})

Constructs a DataType object.

###### Arguments:

- dtype: the data type of interest.
- dialect: the dialect to use for parsing `dtype`, in case it's a string.
- udt: when set to True, `dtype` will be used as-is if it can't be parsed into a DataType, thus creating a user-defined type.
- copy: whether to copy the data type.
- kwargs: additional arguments to pass in the constructor of DataType.

###### Returns:

> The constructed DataType object.

def is_type( self, *dtypes: Union[str, Identifier, Dot, DataType, DataType.Type], check_nullable: bool = False) -> bool: View Source

    4850    def is_type(self, *dtypes: DATA_TYPE, check_nullable: bool = False) -> bool:
    4851        """
    4852        Checks whether this DataType matches one of the provided data types. Nested types or precision
    4853        will be compared using "structural equivalence" semantics, so e.g. array<int> != array<float>.
    4854
    4855        Args:
    4856            dtypes: the data types to compare this DataType to.
    4857            check_nullable: whether to take the NULLABLE type constructor into account for the comparison.
    4858                If false, it means that NULLABLE<INT> is equivalent to INT.
    4859
    4860        Returns:
    4861            True, if and only if there is a type in `dtypes` which is equal to this DataType.
    4862        """
    4863        self_is_nullable = self.args.get("nullable")
    4864        for dtype in dtypes:
    4865            other_type = DataType.build(dtype, copy=False, udt=True)
    4866            other_is_nullable = other_type.args.get("nullable")
    4867            if (
    4868                other_type.expressions
    4869                or (check_nullable and (self_is_nullable or other_is_nullable))
    4870                or self.this == DataType.Type.USERDEFINED
    4871                or other_type.this == DataType.Type.USERDEFINED
    4872            ):
    4873                matches = self == other_type
    4874            else:
    4875                matches = self.this == other_type.this
    4876
    4877            if matches:
    4878                return True
    4879        return False

Checks whether this DataType matches one of the provided data types. Nested types or precision will be compared using "structural equivalence" semantics, so e.g. array != array.

###### Arguments:

- dtypes: the data types to compare this DataType to.
- check_nullable: whether to take the NULLABLE type constructor into account for the comparison. If false, it means that NULLABLE is equivalent to INT.

###### Returns:

> True, if and only if there is a type in `dtypes` which is equal to this DataType.

key = 'datatype'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DataType.Type(sqlglot.helper.AutoName): View Source

    4582    class Type(AutoName):
    4583        ARRAY = auto()
    4584        AGGREGATEFUNCTION = auto()
    4585        SIMPLEAGGREGATEFUNCTION = auto()
    4586        BIGDECIMAL = auto()
    4587        BIGINT = auto()
    4588        BIGSERIAL = auto()
    4589        BINARY = auto()
    4590        BIT = auto()
    4591        BLOB = auto()
    4592        BOOLEAN = auto()
    4593        BPCHAR = auto()
    4594        CHAR = auto()
    4595        DATE = auto()
    4596        DATE32 = auto()
    4597        DATEMULTIRANGE = auto()
    4598        DATERANGE = auto()
    4599        DATETIME = auto()
    4600        DATETIME2 = auto()
    4601        DATETIME64 = auto()
    4602        DECIMAL = auto()
    4603        DECIMAL32 = auto()
    4604        DECIMAL64 = auto()
    4605        DECIMAL128 = auto()
    4606        DECIMAL256 = auto()
    4607        DOUBLE = auto()
    4608        DYNAMIC = auto()
    4609        ENUM = auto()
    4610        ENUM8 = auto()
    4611        ENUM16 = auto()
    4612        FIXEDSTRING = auto()
    4613        FLOAT = auto()
    4614        GEOGRAPHY = auto()
    4615        GEOGRAPHYPOINT = auto()
    4616        GEOMETRY = auto()
    4617        POINT = auto()
    4618        RING = auto()
    4619        LINESTRING = auto()
    4620        MULTILINESTRING = auto()
    4621        POLYGON = auto()
    4622        MULTIPOLYGON = auto()
    4623        HLLSKETCH = auto()
    4624        HSTORE = auto()
    4625        IMAGE = auto()
    4626        INET = auto()
    4627        INT = auto()
    4628        INT128 = auto()
    4629        INT256 = auto()
    4630        INT4MULTIRANGE = auto()
    4631        INT4RANGE = auto()
    4632        INT8MULTIRANGE = auto()
    4633        INT8RANGE = auto()
    4634        INTERVAL = auto()
    4635        IPADDRESS = auto()
    4636        IPPREFIX = auto()
    4637        IPV4 = auto()
    4638        IPV6 = auto()
    4639        JSON = auto()
    4640        JSONB = auto()
    4641        LIST = auto()
    4642        LONGBLOB = auto()
    4643        LONGTEXT = auto()
    4644        LOWCARDINALITY = auto()
    4645        MAP = auto()
    4646        MEDIUMBLOB = auto()
    4647        MEDIUMINT = auto()
    4648        MEDIUMTEXT = auto()
    4649        MONEY = auto()
    4650        NAME = auto()
    4651        NCHAR = auto()
    4652        NESTED = auto()
    4653        NOTHING = auto()
    4654        NULL = auto()
    4655        NUMMULTIRANGE = auto()
    4656        NUMRANGE = auto()
    4657        NVARCHAR = auto()
    4658        OBJECT = auto()
    4659        RANGE = auto()
    4660        ROWVERSION = auto()
    4661        SERIAL = auto()
    4662        SET = auto()
    4663        SMALLDATETIME = auto()
    4664        SMALLINT = auto()
    4665        SMALLMONEY = auto()
    4666        SMALLSERIAL = auto()
    4667        STRUCT = auto()
    4668        SUPER = auto()
    4669        TEXT = auto()
    4670        TINYBLOB = auto()
    4671        TINYTEXT = auto()
    4672        TIME = auto()
    4673        TIMETZ = auto()
    4674        TIMESTAMP = auto()
    4675        TIMESTAMPNTZ = auto()
    4676        TIMESTAMPLTZ = auto()
    4677        TIMESTAMPTZ = auto()
    4678        TIMESTAMP_S = auto()
    4679        TIMESTAMP_MS = auto()
    4680        TIMESTAMP_NS = auto()
    4681        TINYINT = auto()
    4682        TSMULTIRANGE = auto()
    4683        TSRANGE = auto()
    4684        TSTZMULTIRANGE = auto()
    4685        TSTZRANGE = auto()
    4686        UBIGINT = auto()
    4687        UINT = auto()
    4688        UINT128 = auto()
    4689        UINT256 = auto()
    4690        UMEDIUMINT = auto()
    4691        UDECIMAL = auto()
    4692        UDOUBLE = auto()
    4693        UNION = auto()
    4694        UNKNOWN = auto()  # Sentinel value, useful for type annotation
    4695        USERDEFINED = "USER-DEFINED"
    4696        USMALLINT = auto()
    4697        UTINYINT = auto()
    4698        UUID = auto()
    4699        VARBINARY = auto()
    4700        VARCHAR = auto()
    4701        VARIANT = auto()
    4702        VECTOR = auto()
    4703        XML = auto()
    4704        YEAR = auto()
    4705        TDIGEST = auto()

An enumeration.

ARRAY = <Type.ARRAY: 'ARRAY'>
AGGREGATEFUNCTION = <Type.AGGREGATEFUNCTION: 'AGGREGATEFUNCTION'>
SIMPLEAGGREGATEFUNCTION = <Type.SIMPLEAGGREGATEFUNCTION: 'SIMPLEAGGREGATEFUNCTION'>
BIGDECIMAL = <Type.BIGDECIMAL: 'BIGDECIMAL'>
BIGINT = <Type.BIGINT: 'BIGINT'>
BIGSERIAL = <Type.BIGSERIAL: 'BIGSERIAL'>
BINARY = <Type.BINARY: 'BINARY'>
BIT = <Type.BIT: 'BIT'>
BLOB = <Type.BLOB: 'BLOB'>
BOOLEAN = <Type.BOOLEAN: 'BOOLEAN'>
BPCHAR = <Type.BPCHAR: 'BPCHAR'>
CHAR = <Type.CHAR: 'CHAR'>
DATE = <Type.DATE: 'DATE'>
DATE32 = <Type.DATE32: 'DATE32'>
DATEMULTIRANGE = <Type.DATEMULTIRANGE: 'DATEMULTIRANGE'>
DATERANGE = <Type.DATERANGE: 'DATERANGE'>
DATETIME = <Type.DATETIME: 'DATETIME'>
DATETIME2 = <Type.DATETIME2: 'DATETIME2'>
DATETIME64 = <Type.DATETIME64: 'DATETIME64'>
DECIMAL = <Type.DECIMAL: 'DECIMAL'>
DECIMAL32 = <Type.DECIMAL32: 'DECIMAL32'>
DECIMAL64 = <Type.DECIMAL64: 'DECIMAL64'>
DECIMAL128 = <Type.DECIMAL128: 'DECIMAL128'>
DECIMAL256 = <Type.DECIMAL256: 'DECIMAL256'>
DOUBLE = <Type.DOUBLE: 'DOUBLE'>
DYNAMIC = <Type.DYNAMIC: 'DYNAMIC'>
ENUM = <Type.ENUM: 'ENUM'>
ENUM8 = <Type.ENUM8: 'ENUM8'>
ENUM16 = <Type.ENUM16: 'ENUM16'>
FIXEDSTRING = <Type.FIXEDSTRING: 'FIXEDSTRING'>
FLOAT = <Type.FLOAT: 'FLOAT'>
GEOGRAPHY = <Type.GEOGRAPHY: 'GEOGRAPHY'>
GEOGRAPHYPOINT = <Type.GEOGRAPHYPOINT: 'GEOGRAPHYPOINT'>
GEOMETRY = <Type.GEOMETRY: 'GEOMETRY'>
POINT = <Type.POINT: 'POINT'>
RING = <Type.RING: 'RING'>
LINESTRING = <Type.LINESTRING: 'LINESTRING'>
MULTILINESTRING = <Type.MULTILINESTRING: 'MULTILINESTRING'>
POLYGON = <Type.POLYGON: 'POLYGON'>
MULTIPOLYGON = <Type.MULTIPOLYGON: 'MULTIPOLYGON'>
HLLSKETCH = <Type.HLLSKETCH: 'HLLSKETCH'>
HSTORE = <Type.HSTORE: 'HSTORE'>
IMAGE = <Type.IMAGE: 'IMAGE'>
INET = <Type.INET: 'INET'>
INT = <Type.INT: 'INT'>
INT128 = <Type.INT128: 'INT128'>
INT256 = <Type.INT256: 'INT256'>
INT4MULTIRANGE = <Type.INT4MULTIRANGE: 'INT4MULTIRANGE'>
INT4RANGE = <Type.INT4RANGE: 'INT4RANGE'>
INT8MULTIRANGE = <Type.INT8MULTIRANGE: 'INT8MULTIRANGE'>
INT8RANGE = <Type.INT8RANGE: 'INT8RANGE'>
INTERVAL = <Type.INTERVAL: 'INTERVAL'>
IPADDRESS = <Type.IPADDRESS: 'IPADDRESS'>
IPPREFIX = <Type.IPPREFIX: 'IPPREFIX'>
IPV4 = <Type.IPV4: 'IPV4'>
IPV6 = <Type.IPV6: 'IPV6'>
JSON = <Type.JSON: 'JSON'>
JSONB = <Type.JSONB: 'JSONB'>
LIST = <Type.LIST: 'LIST'>
LONGBLOB = <Type.LONGBLOB: 'LONGBLOB'>
LONGTEXT = <Type.LONGTEXT: 'LONGTEXT'>
LOWCARDINALITY = <Type.LOWCARDINALITY: 'LOWCARDINALITY'>
MAP = <Type.MAP: 'MAP'>
MEDIUMBLOB = <Type.MEDIUMBLOB: 'MEDIUMBLOB'>
MEDIUMINT = <Type.MEDIUMINT: 'MEDIUMINT'>
MEDIUMTEXT = <Type.MEDIUMTEXT: 'MEDIUMTEXT'>
MONEY = <Type.MONEY: 'MONEY'>
NAME = <Type.NAME: 'NAME'>
NCHAR = <Type.NCHAR: 'NCHAR'>
NESTED = <Type.NESTED: 'NESTED'>
NOTHING = <Type.NOTHING: 'NOTHING'>
NULL = <Type.NULL: 'NULL'>
NUMMULTIRANGE = <Type.NUMMULTIRANGE: 'NUMMULTIRANGE'>
NUMRANGE = <Type.NUMRANGE: 'NUMRANGE'>
NVARCHAR = <Type.NVARCHAR: 'NVARCHAR'>
OBJECT = <Type.OBJECT: 'OBJECT'>
RANGE = <Type.RANGE: 'RANGE'>
ROWVERSION = <Type.ROWVERSION: 'ROWVERSION'>
SERIAL = <Type.SERIAL: 'SERIAL'>
SET = <Type.SET: 'SET'>
SMALLDATETIME = <Type.SMALLDATETIME: 'SMALLDATETIME'>
SMALLINT = <Type.SMALLINT: 'SMALLINT'>
SMALLMONEY = <Type.SMALLMONEY: 'SMALLMONEY'>
SMALLSERIAL = <Type.SMALLSERIAL: 'SMALLSERIAL'>
STRUCT = <Type.STRUCT: 'STRUCT'>
SUPER = <Type.SUPER: 'SUPER'>
TEXT = <Type.TEXT: 'TEXT'>
TINYBLOB = <Type.TINYBLOB: 'TINYBLOB'>
TINYTEXT = <Type.TINYTEXT: 'TINYTEXT'>
TIME = <Type.TIME: 'TIME'>
TIMETZ = <Type.TIMETZ: 'TIMETZ'>
TIMESTAMP = <Type.TIMESTAMP: 'TIMESTAMP'>
TIMESTAMPNTZ = <Type.TIMESTAMPNTZ: 'TIMESTAMPNTZ'>
TIMESTAMPLTZ = <Type.TIMESTAMPLTZ: 'TIMESTAMPLTZ'>
TIMESTAMPTZ = <Type.TIMESTAMPTZ: 'TIMESTAMPTZ'>
TIMESTAMP_S = <Type.TIMESTAMP_S: 'TIMESTAMP_S'>
TIMESTAMP_MS = <Type.TIMESTAMP_MS: 'TIMESTAMP_MS'>
TIMESTAMP_NS = <Type.TIMESTAMP_NS: 'TIMESTAMP_NS'>
TINYINT = <Type.TINYINT: 'TINYINT'>
TSMULTIRANGE = <Type.TSMULTIRANGE: 'TSMULTIRANGE'>
TSRANGE = <Type.TSRANGE: 'TSRANGE'>
TSTZMULTIRANGE = <Type.TSTZMULTIRANGE: 'TSTZMULTIRANGE'>
TSTZRANGE = <Type.TSTZRANGE: 'TSTZRANGE'>
UBIGINT = <Type.UBIGINT: 'UBIGINT'>
UINT = <Type.UINT: 'UINT'>
UINT128 = <Type.UINT128: 'UINT128'>
UINT256 = <Type.UINT256: 'UINT256'>
UMEDIUMINT = <Type.UMEDIUMINT: 'UMEDIUMINT'>
UDECIMAL = <Type.UDECIMAL: 'UDECIMAL'>
UDOUBLE = <Type.UDOUBLE: 'UDOUBLE'>
UNION = <Type.UNION: 'UNION'>
UNKNOWN = <Type.UNKNOWN: 'UNKNOWN'>
USERDEFINED = <Type.USERDEFINED: 'USER-DEFINED'>
USMALLINT = <Type.USMALLINT: 'USMALLINT'>
UTINYINT = <Type.UTINYINT: 'UTINYINT'>
UUID = <Type.UUID: 'UUID'>
VARBINARY = <Type.VARBINARY: 'VARBINARY'>
VARCHAR = <Type.VARCHAR: 'VARCHAR'>
VARIANT = <Type.VARIANT: 'VARIANT'>
VECTOR = <Type.VECTOR: 'VECTOR'>
XML = <Type.XML: 'XML'>
YEAR = <Type.YEAR: 'YEAR'>
TDIGEST = <Type.TDIGEST: 'TDIGEST'>
class PseudoType(DataType): View Source

    4883class PseudoType(DataType):
    4884    arg_types = {"this": True}

arg_types = {'this': True}
key = 'pseudotype'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DataType
  Type
  STRUCT_TYPES
  ARRAY_TYPES
  NESTED_TYPES
  TEXT_TYPES
  SIGNED_INTEGER_TYPES
  UNSIGNED_INTEGER_TYPES
  INTEGER_TYPES
  FLOAT_TYPES
  REAL_TYPES
  NUMERIC_TYPES
  TEMPORAL_TYPES
  build
  is_type

class ObjectIdentifier(DataType): View Source

    4888class ObjectIdentifier(DataType):
    4889    arg_types = {"this": True}

arg_types = {'this': True}
key = 'objectidentifier'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DataType
  Type
  STRUCT_TYPES
  ARRAY_TYPES
  NESTED_TYPES
  TEXT_TYPES
  SIGNED_INTEGER_TYPES
  UNSIGNED_INTEGER_TYPES
  INTEGER_TYPES
  FLOAT_TYPES
  REAL_TYPES
  NUMERIC_TYPES
  TEMPORAL_TYPES
  build
  is_type

class SubqueryPredicate(Predicate): View Source

    4893class SubqueryPredicate(Predicate):
    4894    pass

key = 'subquerypredicate'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class All(SubqueryPredicate): View Source

    4897class All(SubqueryPredicate):
    4898    pass

key = 'all'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Any(SubqueryPredicate): View Source

    4901class Any(SubqueryPredicate):
    4902    pass

key = 'any'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Command(Expression): View Source

    4907class Command(Expression):
    4908    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'command'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Transaction(Expression): View Source

    4911class Transaction(Expression):
    4912    arg_types = {"this": False, "modes": False, "mark": False}

arg_types = {'this': False, 'modes': False, 'mark': False}
key = 'transaction'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Commit(Expression): View Source

    4915class Commit(Expression):
    4916    arg_types = {"chain": False, "this": False, "durability": False}

arg_types = {'chain': False, 'this': False, 'durability': False}
key = 'commit'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Rollback(Expression): View Source

    4919class Rollback(Expression):
    4920    arg_types = {"savepoint": False, "this": False}

arg_types = {'savepoint': False, 'this': False}
key = 'rollback'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Alter(Expression): View Source

    4923class Alter(Expression):
    4924    arg_types = {
    4925        "this": False,
    4926        "kind": True,
    4927        "actions": True,
    4928        "exists": False,
    4929        "only": False,
    4930        "options": False,
    4931        "cluster": False,
    4932        "not_valid": False,
    4933        "check": False,
    4934    }
    4935
    4936    @property
    4937    def kind(self) -> t.Optional[str]:
    4938        kind = self.args.get("kind")
    4939        return kind and kind.upper()
    4940
    4941    @property
    4942    def actions(self) -> t.List[Expression]:
    4943        return self.args.get("actions") or []

arg_types = {'this': False, 'kind': True, 'actions': True, 'exists': False, 'only': False, 'options': False, 'cluster': False, 'not_valid': False, 'check': False}
kind: Optional[str] View Source

    4936    @property
    4937    def kind(self) -> t.Optional[str]:
    4938        kind = self.args.get("kind")
    4939        return kind and kind.upper()

actions: List[Expression] View Source

    4941    @property
    4942    def actions(self) -> t.List[Expression]:
    4943        return self.args.get("actions") or []

key = 'alter'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AlterSession(Expression): View Source

    4946class AlterSession(Expression):
    4947    arg_types = {"expressions": True, "unset": False}

arg_types = {'expressions': True, 'unset': False}
key = 'altersession'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Analyze(Expression): View Source

    4950class Analyze(Expression):
    4951    arg_types = {
    4952        "kind": False,
    4953        "this": False,
    4954        "options": False,
    4955        "mode": False,
    4956        "partition": False,
    4957        "expression": False,
    4958        "properties": False,
    4959    }

arg_types = {'kind': False, 'this': False, 'options': False, 'mode': False, 'partition': False, 'expression': False, 'properties': False}
key = 'analyze'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AnalyzeStatistics(Expression): View Source

    4962class AnalyzeStatistics(Expression):
    4963    arg_types = {
    4964        "kind": True,
    4965        "option": False,
    4966        "this": False,
    4967        "expressions": False,
    4968    }

arg_types = {'kind': True, 'option': False, 'this': False, 'expressions': False}
key = 'analyzestatistics'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AnalyzeHistogram(Expression): View Source

    4971class AnalyzeHistogram(Expression):
    4972    arg_types = {
    4973        "this": True,
    4974        "expressions": True,
    4975        "expression": False,
    4976        "update_options": False,
    4977    }

arg_types = {'this': True, 'expressions': True, 'expression': False, 'update_options': False}
key = 'analyzehistogram'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AnalyzeSample(Expression): View Source

    4980class AnalyzeSample(Expression):
    4981    arg_types = {"kind": True, "sample": True}

arg_types = {'kind': True, 'sample': True}
key = 'analyzesample'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AnalyzeListChainedRows(Expression): View Source

    4984class AnalyzeListChainedRows(Expression):
    4985    arg_types = {"expression": False}

arg_types = {'expression': False}
key = 'analyzelistchainedrows'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AnalyzeDelete(Expression): View Source

    4988class AnalyzeDelete(Expression):
    4989    arg_types = {"kind": False}

arg_types = {'kind': False}
key = 'analyzedelete'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AnalyzeWith(Expression): View Source

    4992class AnalyzeWith(Expression):
    4993    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'analyzewith'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AnalyzeValidate(Expression): View Source

    4996class AnalyzeValidate(Expression):
    4997    arg_types = {
    4998        "kind": True,
    4999        "this": False,
    5000        "expression": False,
    5001    }

arg_types = {'kind': True, 'this': False, 'expression': False}
key = 'analyzevalidate'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AnalyzeColumns(Expression): View Source

    5004class AnalyzeColumns(Expression):
    5005    pass

key = 'analyzecolumns'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class UsingData(Expression): View Source

    5008class UsingData(Expression):
    5009    pass

key = 'usingdata'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AddConstraint(Expression): View Source

    5012class AddConstraint(Expression):
    5013    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'addconstraint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AddPartition(Expression): View Source

    5016class AddPartition(Expression):
    5017    arg_types = {"this": True, "exists": False, "location": False}

arg_types = {'this': True, 'exists': False, 'location': False}
key = 'addpartition'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AttachOption(Expression): View Source

    5020class AttachOption(Expression):
    5021    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'attachoption'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DropPartition(Expression): View Source

    5024class DropPartition(Expression):
    5025    arg_types = {"expressions": True, "exists": False}

arg_types = {'expressions': True, 'exists': False}
key = 'droppartition'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ReplacePartition(Expression): View Source

    5029class ReplacePartition(Expression):
    5030    arg_types = {"expression": True, "source": True}

arg_types = {'expression': True, 'source': True}
key = 'replacepartition'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Binary(Condition): View Source

    5034class Binary(Condition):
    5035    arg_types = {"this": True, "expression": True}
    5036
    5037    @property
    5038    def left(self) -> Expression:
    5039        return self.this
    5040
    5041    @property
    5042    def right(self) -> Expression:
    5043        return self.expression

arg_types = {'this': True, 'expression': True}
left: Expression View Source

    5037    @property
    5038    def left(self) -> Expression:
    5039        return self.this

right: Expression View Source

    5041    @property
    5042    def right(self) -> Expression:
    5043        return self.expression

key = 'binary'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Add(Binary): View Source

    5046class Add(Binary):
    5047    pass

key = 'add'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Connector(Binary): View Source

    5050class Connector(Binary):
    5051    pass

key = 'connector'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class BitwiseAnd(Binary): View Source

    5054class BitwiseAnd(Binary):
    5055    pass

key = 'bitwiseand'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class BitwiseLeftShift(Binary): View Source

    5058class BitwiseLeftShift(Binary):
    5059    pass

key = 'bitwiseleftshift'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class BitwiseOr(Binary): View Source

    5062class BitwiseOr(Binary):
    5063    pass

key = 'bitwiseor'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class BitwiseRightShift(Binary): View Source

    5066class BitwiseRightShift(Binary):
    5067    pass

key = 'bitwiserightshift'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class BitwiseXor(Binary): View Source

    5070class BitwiseXor(Binary):
    5071    pass

key = 'bitwisexor'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Div(Binary): View Source

    5074class Div(Binary):
    5075    arg_types = {"this": True, "expression": True, "typed": False, "safe": False}

arg_types = {'this': True, 'expression': True, 'typed': False, 'safe': False}
key = 'div'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right

class Overlaps(Binary): View Source

    5078class Overlaps(Binary):
    5079    pass

key = 'overlaps'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Dot(Binary): View Source

    5082class Dot(Binary):
    5083    @property
    5084    def is_star(self) -> bool:
    5085        return self.expression.is_star
    5086
    5087    @property
    5088    def name(self) -> str:
    5089        return self.expression.name
    5090
    5091    @property
    5092    def output_name(self) -> str:
    5093        return self.name
    5094
    5095    @classmethod
    5096    def build(self, expressions: t.Sequence[Expression]) -> Dot:
    5097        """Build a Dot object with a sequence of expressions."""
    5098        if len(expressions) < 2:
    5099            raise ValueError("Dot requires >= 2 expressions.")
    5100
    5101        return t.cast(Dot, reduce(lambda x, y: Dot(this=x, expression=y), expressions))
    5102
    5103    @property
    5104    def parts(self) -> t.List[Expression]:
    5105        """Return the parts of a table / column in order catalog, db, table."""
    5106        this, *parts = self.flatten()
    5107
    5108        parts.reverse()
    5109
    5110        for arg in COLUMN_PARTS:
    5111            part = this.args.get(arg)
    5112
    5113            if isinstance(part, Expression):
    5114                parts.append(part)
    5115
    5116        parts.reverse()
    5117        return parts

is_star: bool View Source

    5083    @property
    5084    def is_star(self) -> bool:
    5085        return self.expression.is_star

Checks whether an expression is a star.

name: str View Source

    5087    @property
    5088    def name(self) -> str:
    5089        return self.expression.name

output_name: str View Source

    5091    @property
    5092    def output_name(self) -> str:
    5093        return self.name

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

@classmethod
def build( self, expressions: Sequence[Expression]) -> Dot: View Source

    5095    @classmethod
    5096    def build(self, expressions: t.Sequence[Expression]) -> Dot:
    5097        """Build a Dot object with a sequence of expressions."""
    5098        if len(expressions) < 2:
    5099            raise ValueError("Dot requires >= 2 expressions.")
    5100
    5101        return t.cast(Dot, reduce(lambda x, y: Dot(this=x, expression=y), expressions))

Build a Dot object with a sequence of expressions.

parts: List[Expression] View Source

    5103    @property
    5104    def parts(self) -> t.List[Expression]:
    5105        """Return the parts of a table / column in order catalog, db, table."""
    5106        this, *parts = self.flatten()
    5107
    5108        parts.reverse()
    5109
    5110        for arg in COLUMN_PARTS:
    5111            part = this.args.get(arg)
    5112
    5113            if isinstance(part, Expression):
    5114                parts.append(part)
    5115
    5116        parts.reverse()
    5117        return parts

Return the parts of a table / column in order catalog, db, table.

key = 'dot'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  alias
  alias_column_names
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

DATA_TYPE = typing.Union[str, Identifier, Dot, DataType, DataType.Type]
class DPipe(Binary): View Source

    5123class DPipe(Binary):
    5124    arg_types = {"this": True, "expression": True, "safe": False}

arg_types = {'this': True, 'expression': True, 'safe': False}
key = 'dpipe'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right

class EQ(Binary, Predicate): View Source

    5127class EQ(Binary, Predicate):
    5128    pass

key = 'eq'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class NullSafeEQ(Binary, Predicate): View Source

    5131class NullSafeEQ(Binary, Predicate):
    5132    pass

key = 'nullsafeeq'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class NullSafeNEQ(Binary, Predicate): View Source

    5135class NullSafeNEQ(Binary, Predicate):
    5136    pass

key = 'nullsafeneq'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class PropertyEQ(Binary): View Source

    5140class PropertyEQ(Binary):
    5141    pass

key = 'propertyeq'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Distance(Binary): View Source

    5144class Distance(Binary):
    5145    pass

key = 'distance'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Escape(Binary): View Source

    5148class Escape(Binary):
    5149    pass

key = 'escape'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Glob(Binary, Predicate): View Source

    5152class Glob(Binary, Predicate):
    5153    pass

key = 'glob'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class GT(Binary, Predicate): View Source

    5156class GT(Binary, Predicate):
    5157    pass

key = 'gt'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class GTE(Binary, Predicate): View Source

    5160class GTE(Binary, Predicate):
    5161    pass

key = 'gte'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class ILike(Binary, Predicate): View Source

    5164class ILike(Binary, Predicate):
    5165    pass

key = 'ilike'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class IntDiv(Binary): View Source

    5168class IntDiv(Binary):
    5169    pass

key = 'intdiv'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Is(Binary, Predicate): View Source

    5172class Is(Binary, Predicate):
    5173    pass

key = 'is'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Kwarg(Binary): View Source

    5176class Kwarg(Binary):
    5177    """Kwarg in special functions like func(kwarg => y)."""

Kwarg in special functions like func(kwarg => y).

key = 'kwarg'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Like(Binary, Predicate): View Source

    5180class Like(Binary, Predicate):
    5181    pass

key = 'like'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class LT(Binary, Predicate): View Source

    5184class LT(Binary, Predicate):
    5185    pass

key = 'lt'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class LTE(Binary, Predicate): View Source

    5188class LTE(Binary, Predicate):
    5189    pass

key = 'lte'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Mod(Binary): View Source

    5192class Mod(Binary):
    5193    pass

key = 'mod'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Mul(Binary): View Source

    5196class Mul(Binary):
    5197    pass

key = 'mul'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class NEQ(Binary, Predicate): View Source

    5200class NEQ(Binary, Predicate):
    5201    pass

key = 'neq'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Operator(Binary): View Source

    5205class Operator(Binary):
    5206    arg_types = {"this": True, "operator": True, "expression": True}

arg_types = {'this': True, 'operator': True, 'expression': True}
key = 'operator'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right

class SimilarTo(Binary, Predicate): View Source

    5209class SimilarTo(Binary, Predicate):
    5210    pass

key = 'similarto'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Slice(Binary): View Source

    5213class Slice(Binary):
    5214    arg_types = {"this": False, "expression": False}

arg_types = {'this': False, 'expression': False}
key = 'slice'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right

class Sub(Binary): View Source

    5217class Sub(Binary):
    5218    pass

key = 'sub'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right

class Unary(Condition): View Source

    5223class Unary(Condition):
    5224    pass

key = 'unary'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class BitwiseNot(Unary): View Source

    5227class BitwiseNot(Unary):
    5228    pass

key = 'bitwisenot'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Not(Unary): View Source

    5231class Not(Unary):
    5232    pass

key = 'not'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Paren(Unary): View Source

    5235class Paren(Unary):
    5236    @property
    5237    def output_name(self) -> str:
    5238        return self.this.name

output_name: str View Source

    5236    @property
    5237    def output_name(self) -> str:
    5238        return self.this.name

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

key = 'paren'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Neg(Unary): View Source

    5241class Neg(Unary):
    5242    def to_py(self) -> int | Decimal:
    5243        if self.is_number:
    5244            return self.this.to_py() * -1
    5245        return super().to_py()

def to_py(self) -> int | decimal.Decimal: View Source

    5242    def to_py(self) -> int | Decimal:
    5243        if self.is_number:
    5244            return self.this.to_py() * -1
    5245        return super().to_py()

Returns a Python object equivalent of the SQL node.

key = 'neg'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Alias(Expression): View Source

    5248class Alias(Expression):
    5249    arg_types = {"this": True, "alias": False}
    5250
    5251    @property
    5252    def output_name(self) -> str:
    5253        return self.alias

arg_types = {'this': True, 'alias': False}
output_name: str View Source

    5251    @property
    5252    def output_name(self) -> str:
    5253        return self.alias

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

key = 'alias'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class PivotAlias(Alias): View Source

    5258class PivotAlias(Alias):
    5259    pass

key = 'pivotalias'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Alias
  arg_types
  output_name

class PivotAny(Expression): View Source

    5264class PivotAny(Expression):
    5265    arg_types = {"this": False}

arg_types = {'this': False}
key = 'pivotany'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Aliases(Expression): View Source

    5268class Aliases(Expression):
    5269    arg_types = {"this": True, "expressions": True}
    5270
    5271    @property
    5272    def aliases(self):
    5273        return self.expressions

arg_types = {'this': True, 'expressions': True}
aliases View Source

    5271    @property
    5272    def aliases(self):
    5273        return self.expressions

key = 'aliases'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AtIndex(Expression): View Source

    5277class AtIndex(Expression):
    5278    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'atindex'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class AtTimeZone(Expression): View Source

    5281class AtTimeZone(Expression):
    5282    arg_types = {"this": True, "zone": True}

arg_types = {'this': True, 'zone': True}
key = 'attimezone'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class FromTimeZone(Expression): View Source

    5285class FromTimeZone(Expression):
    5286    arg_types = {"this": True, "zone": True}

arg_types = {'this': True, 'zone': True}
key = 'fromtimezone'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class FormatPhrase(Expression): View Source

    5289class FormatPhrase(Expression):
    5290    """Format override for a column in Teradata.
    5291    Can be expanded to additional dialects as needed
    5292
    5293    https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/SQL-Data-Types-and-Literals/Data-Type-Formats-and-Format-Phrases/FORMAT
    5294    """
    5295
    5296    arg_types = {"this": True, "format": True}

Format override for a column in Teradata. Can be expanded to additional dialects as needed

https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/SQL-Data-Types-and-Literals/Data-Type-Formats-and-Format-Phrases/FORMAT

arg_types = {'this': True, 'format': True}
key = 'formatphrase'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Between(Predicate): View Source

    5299class Between(Predicate):
    5300    arg_types = {"this": True, "low": True, "high": True, "symmetric": False}

arg_types = {'this': True, 'low': True, 'high': True, 'symmetric': False}
key = 'between'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Bracket(Condition): View Source

    5303class Bracket(Condition):
    5304    # https://cloud.google.com/bigquery/docs/reference/standard-sql/operators#array_subscript_operator
    5305    arg_types = {
    5306        "this": True,
    5307        "expressions": True,
    5308        "offset": False,
    5309        "safe": False,
    5310        "returns_list_for_maps": False,
    5311    }
    5312
    5313    @property
    5314    def output_name(self) -> str:
    5315        if len(self.expressions) == 1:
    5316            return self.expressions[0].output_name
    5317
    5318        return super().output_name

arg_types = {'this': True, 'expressions': True, 'offset': False, 'safe': False, 'returns_list_for_maps': False}
output_name: str View Source

    5313    @property
    5314    def output_name(self) -> str:
    5315        if len(self.expressions) == 1:
    5316            return self.expressions[0].output_name
    5317
    5318        return super().output_name

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

key = 'bracket'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Distinct(Expression): View Source

    5321class Distinct(Expression):
    5322    arg_types = {"expressions": False, "on": False}

arg_types = {'expressions': False, 'on': False}
key = 'distinct'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class In(Predicate): View Source

    5325class In(Predicate):
    5326    arg_types = {
    5327        "this": True,
    5328        "expressions": False,
    5329        "query": False,
    5330        "unnest": False,
    5331        "field": False,
    5332        "is_global": False,
    5333    }

arg_types = {'this': True, 'expressions': False, 'query': False, 'unnest': False, 'field': False, 'is_global': False}
key = 'in'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class ForIn(Expression): View Source

    5337class ForIn(Expression):
    5338    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'forin'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TimeUnit(Expression): View Source

    5341class TimeUnit(Expression):
    5342    """Automatically converts unit arg into a var."""
    5343
    5344    arg_types = {"unit": False}
    5345
    5346    UNABBREVIATED_UNIT_NAME = {
    5347        "D": "DAY",
    5348        "H": "HOUR",
    5349        "M": "MINUTE",
    5350        "MS": "MILLISECOND",
    5351        "NS": "NANOSECOND",
    5352        "Q": "QUARTER",
    5353        "S": "SECOND",
    5354        "US": "MICROSECOND",
    5355        "W": "WEEK",
    5356        "Y": "YEAR",
    5357    }
    5358
    5359    VAR_LIKE = (Column, Literal, Var)
    5360
    5361    def __init__(self, **args):
    5362        unit = args.get("unit")
    5363        if type(unit) in self.VAR_LIKE:
    5364            args["unit"] = Var(
    5365                this=(self.UNABBREVIATED_UNIT_NAME.get(unit.name) or unit.name).upper()
    5366            )
    5367        elif isinstance(unit, Week):
    5368            unit.set("this", Var(this=unit.this.name.upper()))
    5369
    5370        super().__init__(**args)
    5371
    5372    @property
    5373    def unit(self) -> t.Optional[Var | IntervalSpan]:
    5374        return self.args.get("unit")

Automatically converts unit arg into a var.

TimeUnit(**args) View Source

    5361    def __init__(self, **args):
    5362        unit = args.get("unit")
    5363        if type(unit) in self.VAR_LIKE:
    5364            args["unit"] = Var(
    5365                this=(self.UNABBREVIATED_UNIT_NAME.get(unit.name) or unit.name).upper()
    5366            )
    5367        elif isinstance(unit, Week):
    5368            unit.set("this", Var(this=unit.this.name.upper()))
    5369
    5370        super().__init__(**args)

arg_types = {'unit': False}
UNABBREVIATED_UNIT_NAME = {'D': 'DAY', 'H': 'HOUR', 'M': 'MINUTE', 'MS': 'MILLISECOND', 'NS': 'NANOSECOND', 'Q': 'QUARTER', 'S': 'SECOND', 'US': 'MICROSECOND', 'W': 'WEEK', 'Y': 'YEAR'}
VAR_LIKE = (<class 'Column'>, <class 'Literal'>, <class 'Var'>)
unit: Union[Var, IntervalSpan, NoneType] View Source

    5372    @property
    5373    def unit(self) -> t.Optional[Var | IntervalSpan]:
    5374        return self.args.get("unit")

key = 'timeunit'

##### Inherited Members

Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class IntervalOp(TimeUnit): View Source

    5377class IntervalOp(TimeUnit):
    5378    arg_types = {"unit": False, "expression": True}
    5379
    5380    def interval(self):
    5381        return Interval(
    5382            this=self.expression.copy(),
    5383            unit=self.unit.copy() if self.unit else None,
    5384        )

arg_types = {'unit': False, 'expression': True}
def interval(self): View Source

    5380    def interval(self):
    5381        return Interval(
    5382            this=self.expression.copy(),
    5383            unit=self.unit.copy() if self.unit else None,
    5384        )

key = 'intervalop'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class IntervalSpan(DataType): View Source

    5390class IntervalSpan(DataType):
    5391    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'intervalspan'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DataType
  Type
  STRUCT_TYPES
  ARRAY_TYPES
  NESTED_TYPES
  TEXT_TYPES
  SIGNED_INTEGER_TYPES
  UNSIGNED_INTEGER_TYPES
  INTEGER_TYPES
  FLOAT_TYPES
  REAL_TYPES
  NUMERIC_TYPES
  TEMPORAL_TYPES
  build
  is_type

class Interval(TimeUnit): View Source

    5394class Interval(TimeUnit):
    5395    arg_types = {"this": False, "unit": False}

arg_types = {'this': False, 'unit': False}
key = 'interval'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class IgnoreNulls(Expression): View Source

    5398class IgnoreNulls(Expression):
    5399    pass

key = 'ignorenulls'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class RespectNulls(Expression): View Source

    5402class RespectNulls(Expression):
    5403    pass

key = 'respectnulls'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class HavingMax(Expression): View Source

    5407class HavingMax(Expression):
    5408    arg_types = {"this": True, "expression": True, "max": True}

arg_types = {'this': True, 'expression': True, 'max': True}
key = 'havingmax'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Func(Condition): View Source

    5412class Func(Condition):
    5413    """
    5414    The base class for all function expressions.
    5415
    5416    Attributes:
    5417        is_var_len_args (bool): if set to True the last argument defined in arg_types will be
    5418            treated as a variable length argument and the argument's value will be stored as a list.
    5419        _sql_names (list): the SQL name (1st item in the list) and aliases (subsequent items) for this
    5420            function expression. These values are used to map this node to a name during parsing as
    5421            well as to provide the function's name during SQL string generation. By default the SQL
    5422            name is set to the expression's class name transformed to snake case.
    5423    """
    5424
    5425    is_var_len_args = False
    5426
    5427    @classmethod
    5428    def from_arg_list(cls, args):
    5429        if cls.is_var_len_args:
    5430            all_arg_keys = list(cls.arg_types)
    5431            # If this function supports variable length argument treat the last argument as such.
    5432            non_var_len_arg_keys = all_arg_keys[:-1] if cls.is_var_len_args else all_arg_keys
    5433            num_non_var = len(non_var_len_arg_keys)
    5434
    5435            args_dict = {arg_key: arg for arg, arg_key in zip(args, non_var_len_arg_keys)}
    5436            args_dict[all_arg_keys[-1]] = args[num_non_var:]
    5437        else:
    5438            args_dict = {arg_key: arg for arg, arg_key in zip(args, cls.arg_types)}
    5439
    5440        return cls(**args_dict)
    5441
    5442    @classmethod
    5443    def sql_names(cls):
    5444        if cls is Func:
    5445            raise NotImplementedError(
    5446                "SQL name is only supported by concrete function implementations"
    5447            )
    5448        if "_sql_names" not in cls.__dict__:
    5449            cls._sql_names = [camel_to_snake_case(cls.__name__)]
    5450        return cls._sql_names
    5451
    5452    @classmethod
    5453    def sql_name(cls):
    5454        sql_names = cls.sql_names()
    5455        assert sql_names, f"Expected non-empty 'sql_names' for Func: {cls.__name__}."
    5456        return sql_names[0]
    5457
    5458    @classmethod
    5459    def default_parser_mappings(cls):
    5460        return {name: cls.from_arg_list for name in cls.sql_names()}

The base class for all function expressions.

###### Attributes:

- is_var_len_args (bool): if set to True the last argument defined in arg_types will be treated as a variable length argument and the argument's value will be stored as a list.
- _sql_names (list): the SQL name (1st item in the list) and aliases (subsequent items) for this function expression. These values are used to map this node to a name during parsing as well as to provide the function's name during SQL string generation. By default the SQL name is set to the expression's class name transformed to snake case.

is_var_len_args = False
@classmethod
def from_arg_list(cls, args): View Source

    5427    @classmethod
    5428    def from_arg_list(cls, args):
    5429        if cls.is_var_len_args:
    5430            all_arg_keys = list(cls.arg_types)
    5431            # If this function supports variable length argument treat the last argument as such.
    5432            non_var_len_arg_keys = all_arg_keys[:-1] if cls.is_var_len_args else all_arg_keys
    5433            num_non_var = len(non_var_len_arg_keys)
    5434
    5435            args_dict = {arg_key: arg for arg, arg_key in zip(args, non_var_len_arg_keys)}
    5436            args_dict[all_arg_keys[-1]] = args[num_non_var:]
    5437        else:
    5438            args_dict = {arg_key: arg for arg, arg_key in zip(args, cls.arg_types)}
    5439
    5440        return cls(**args_dict)

@classmethod
def sql_names(cls): View Source

    5442    @classmethod
    5443    def sql_names(cls):
    5444        if cls is Func:
    5445            raise NotImplementedError(
    5446                "SQL name is only supported by concrete function implementations"
    5447            )
    5448        if "_sql_names" not in cls.__dict__:
    5449            cls._sql_names = [camel_to_snake_case(cls.__name__)]
    5450        return cls._sql_names

@classmethod
def sql_name(cls): View Source

    5452    @classmethod
    5453    def sql_name(cls):
    5454        sql_names = cls.sql_names()
    5455        assert sql_names, f"Expected non-empty 'sql_names' for Func: {cls.__name__}."
    5456        return sql_names[0]

@classmethod
def default_parser_mappings(cls): View Source

    5458    @classmethod
    5459    def default_parser_mappings(cls):
    5460        return {name: cls.from_arg_list for name in cls.sql_names()}

key = 'func'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Typeof(Func): View Source

    5463class Typeof(Func):
    5464    pass

key = 'typeof'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Acos(Func): View Source

    5467class Acos(Func):
    5468    pass

key = 'acos'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Acosh(Func): View Source

    5471class Acosh(Func):
    5472    pass

key = 'acosh'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Asin(Func): View Source

    5475class Asin(Func):
    5476    pass

key = 'asin'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Asinh(Func): View Source

    5479class Asinh(Func):
    5480    pass

key = 'asinh'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Atan(Func): View Source

    5483class Atan(Func):
    5484    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'atan'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Atanh(Func): View Source

    5487class Atanh(Func):
    5488    pass

key = 'atanh'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Atan2(Func): View Source

    5491class Atan2(Func):
    5492    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'atan2'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Cot(Func): View Source

    5495class Cot(Func):
    5496    pass

key = 'cot'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Coth(Func): View Source

    5499class Coth(Func):
    5500    pass

key = 'coth'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Csc(Func): View Source

    5503class Csc(Func):
    5504    pass

key = 'csc'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Csch(Func): View Source

    5507class Csch(Func):
    5508    pass

key = 'csch'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Sec(Func): View Source

    5511class Sec(Func):
    5512    pass

key = 'sec'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Sech(Func): View Source

    5515class Sech(Func):
    5516    pass

key = 'sech'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Sin(Func): View Source

    5519class Sin(Func):
    5520    pass

key = 'sin'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Sinh(Func): View Source

    5523class Sinh(Func):
    5524    pass

key = 'sinh'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CosineDistance(Func): View Source

    5527class CosineDistance(Func):
    5528    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'cosinedistance'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class EuclideanDistance(Func): View Source

    5531class EuclideanDistance(Func):
    5532    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'euclideandistance'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class AggFunc(Func): View Source

    5535class AggFunc(Func):
    5536    pass

key = 'aggfunc'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class BitwiseAndAgg(AggFunc): View Source

    5539class BitwiseAndAgg(AggFunc):
    5540    pass

key = 'bitwiseandagg'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class BitwiseOrAgg(AggFunc): View Source

    5543class BitwiseOrAgg(AggFunc):
    5544    pass

key = 'bitwiseoragg'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class BitwiseXorAgg(AggFunc): View Source

    5547class BitwiseXorAgg(AggFunc):
    5548    pass

key = 'bitwisexoragg'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class BitwiseCountAgg(AggFunc): View Source

    5551class BitwiseCountAgg(AggFunc):
    5552    pass

key = 'bitwisecountagg'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ByteLength(Func): View Source

    5555class ByteLength(Func):
    5556    pass

key = 'bytelength'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONBool(Func): View Source

    5560class JSONBool(Func):
    5561    pass

key = 'jsonbool'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayRemove(Func): View Source

    5564class ArrayRemove(Func):
    5565    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'arrayremove'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ParameterizedAgg(AggFunc): View Source

    5568class ParameterizedAgg(AggFunc):
    5569    arg_types = {"this": True, "expressions": True, "params": True}

arg_types = {'this': True, 'expressions': True, 'params': True}
key = 'parameterizedagg'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Abs(Func): View Source

    5572class Abs(Func):
    5573    pass

key = 'abs'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArgMax(AggFunc): View Source

    5576class ArgMax(AggFunc):
    5577    arg_types = {"this": True, "expression": True, "count": False}
    5578    _sql_names = ["ARG_MAX", "ARGMAX", "MAX_BY"]

arg_types = {'this': True, 'expression': True, 'count': False}
key = 'argmax'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArgMin(AggFunc): View Source

    5581class ArgMin(AggFunc):
    5582    arg_types = {"this": True, "expression": True, "count": False}
    5583    _sql_names = ["ARG_MIN", "ARGMIN", "MIN_BY"]

arg_types = {'this': True, 'expression': True, 'count': False}
key = 'argmin'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ApproxTopK(AggFunc): View Source

    5586class ApproxTopK(AggFunc):
    5587    arg_types = {"this": True, "expression": False, "counters": False}

arg_types = {'this': True, 'expression': False, 'counters': False}
key = 'approxtopk'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ApproxTopSum(AggFunc): View Source

    5590class ApproxTopSum(AggFunc):
    5591    arg_types = {"this": True, "expression": True, "count": True}

arg_types = {'this': True, 'expression': True, 'count': True}
key = 'approxtopsum'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ApproxQuantiles(AggFunc): View Source

    5594class ApproxQuantiles(AggFunc):
    5595    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'approxquantiles'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class FarmFingerprint(Func): View Source

    5598class FarmFingerprint(Func):
    5599    arg_types = {"expressions": True}
    5600    is_var_len_args = True
    5601    _sql_names = ["FARM_FINGERPRINT", "FARMFINGERPRINT64"]

arg_types = {'expressions': True}
is_var_len_args = True
key = 'farmfingerprint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Flatten(Func): View Source

    5604class Flatten(Func):
    5605    pass

key = 'flatten'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Float64(Func): View Source

    5608class Float64(Func):
    5609    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'float64'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Transform(Func): View Source

    5613class Transform(Func):
    5614    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'transform'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Translate(Func): View Source

    5617class Translate(Func):
    5618    arg_types = {"this": True, "from": True, "to": True}

arg_types = {'this': True, 'from': True, 'to': True}
key = 'translate'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Grouping(AggFunc): View Source

    5621class Grouping(AggFunc):
    5622    arg_types = {"expressions": True}
    5623    is_var_len_args = True

arg_types = {'expressions': True}
is_var_len_args = True
key = 'grouping'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Anonymous(Func): View Source

    5626class Anonymous(Func):
    5627    arg_types = {"this": True, "expressions": False}
    5628    is_var_len_args = True
    5629
    5630    @property
    5631    def name(self) -> str:
    5632        return self.this if isinstance(self.this, str) else self.this.name

arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
name: str View Source

    5630    @property
    5631    def name(self) -> str:
    5632        return self.this if isinstance(self.this, str) else self.this.name

key = 'anonymous'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class AnonymousAggFunc(AggFunc): View Source

    5635class AnonymousAggFunc(AggFunc):
    5636    arg_types = {"this": True, "expressions": False}
    5637    is_var_len_args = True

arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
key = 'anonymousaggfunc'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CombinedAggFunc(AnonymousAggFunc): View Source

    5641class CombinedAggFunc(AnonymousAggFunc):
    5642    arg_types = {"this": True, "expressions": False}

arg_types = {'this': True, 'expressions': False}
key = 'combinedaggfunc'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
AnonymousAggFunc
  is_var_len_args
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CombinedParameterizedAgg(ParameterizedAgg): View Source

    5645class CombinedParameterizedAgg(ParameterizedAgg):
    5646    arg_types = {"this": True, "expressions": True, "params": True}

arg_types = {'this': True, 'expressions': True, 'params': True}
key = 'combinedparameterizedagg'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Hll(AggFunc): View Source

    5651class Hll(AggFunc):
    5652    arg_types = {"this": True, "expressions": False}
    5653    is_var_len_args = True

arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
key = 'hll'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ApproxDistinct(AggFunc): View Source

    5656class ApproxDistinct(AggFunc):
    5657    arg_types = {"this": True, "accuracy": False}
    5658    _sql_names = ["APPROX_DISTINCT", "APPROX_COUNT_DISTINCT"]

arg_types = {'this': True, 'accuracy': False}
key = 'approxdistinct'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Apply(Func): View Source

    5661class Apply(Func):
    5662    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'apply'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Array(Func): View Source

    5665class Array(Func):
    5666    arg_types = {"expressions": False, "bracket_notation": False}
    5667    is_var_len_args = True

arg_types = {'expressions': False, 'bracket_notation': False}
is_var_len_args = True
key = 'array'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Ascii(Func): View Source

    5670class Ascii(Func):
    5671    pass

key = 'ascii'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ToArray(Func): View Source

    5675class ToArray(Func):
    5676    pass

key = 'toarray'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class List(Func): View Source

    5680class List(Func):
    5681    arg_types = {"expressions": False}
    5682    is_var_len_args = True

arg_types = {'expressions': False}
is_var_len_args = True
key = 'list'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Pad(Func): View Source

    5686class Pad(Func):
    5687    arg_types = {"this": True, "expression": True, "fill_pattern": False, "is_left": True}

arg_types = {'this': True, 'expression': True, 'fill_pattern': False, 'is_left': True}
key = 'pad'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ToChar(Func): View Source

    5692class ToChar(Func):
    5693    arg_types = {
    5694        "this": True,
    5695        "format": False,
    5696        "nlsparam": False,
    5697        "is_numeric": False,
    5698    }

arg_types = {'this': True, 'format': False, 'nlsparam': False, 'is_numeric': False}
key = 'tochar'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ToCodePoints(Func): View Source

    5701class ToCodePoints(Func):
    5702    pass

key = 'tocodepoints'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ToNumber(Func): View Source

    5707class ToNumber(Func):
    5708    arg_types = {
    5709        "this": True,
    5710        "format": False,
    5711        "nlsparam": False,
    5712        "precision": False,
    5713        "scale": False,
    5714    }

arg_types = {'this': True, 'format': False, 'nlsparam': False, 'precision': False, 'scale': False}
key = 'tonumber'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ToDouble(Func): View Source

    5718class ToDouble(Func):
    5719    arg_types = {
    5720        "this": True,
    5721        "format": False,
    5722    }

arg_types = {'this': True, 'format': False}
key = 'todouble'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CodePointsToBytes(Func): View Source

    5725class CodePointsToBytes(Func):
    5726    pass

key = 'codepointstobytes'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Columns(Func): View Source

    5729class Columns(Func):
    5730    arg_types = {"this": True, "unpack": False}

arg_types = {'this': True, 'unpack': False}
key = 'columns'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Convert(Func): View Source

    5734class Convert(Func):
    5735    arg_types = {"this": True, "expression": True, "style": False}

arg_types = {'this': True, 'expression': True, 'style': False}
key = 'convert'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ConvertToCharset(Func): View Source

    5739class ConvertToCharset(Func):
    5740    arg_types = {"this": True, "dest": True, "source": False}

arg_types = {'this': True, 'dest': True, 'source': False}
key = 'converttocharset'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ConvertTimezone(Func): View Source

    5743class ConvertTimezone(Func):
    5744    arg_types = {
    5745        "source_tz": False,
    5746        "target_tz": True,
    5747        "timestamp": True,
    5748        "options": False,
    5749    }

arg_types = {'source_tz': False, 'target_tz': True, 'timestamp': True, 'options': False}
key = 'converttimezone'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CodePointsToString(Func): View Source

    5752class CodePointsToString(Func):
    5753    pass

key = 'codepointstostring'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class GenerateSeries(Func): View Source

    5756class GenerateSeries(Func):
    5757    arg_types = {"start": True, "end": True, "step": False, "is_end_exclusive": False}

arg_types = {'start': True, 'end': True, 'step': False, 'is_end_exclusive': False}
key = 'generateseries'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ExplodingGenerateSeries(GenerateSeries): View Source

    5763class ExplodingGenerateSeries(GenerateSeries):
    5764    pass

key = 'explodinggenerateseries'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
GenerateSeries
  arg_types
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayAgg(AggFunc): View Source

    5767class ArrayAgg(AggFunc):
    5768    arg_types = {"this": True, "nulls_excluded": False}

arg_types = {'this': True, 'nulls_excluded': False}
key = 'arrayagg'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayUniqueAgg(AggFunc): View Source

    5771class ArrayUniqueAgg(AggFunc):
    5772    pass

key = 'arrayuniqueagg'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class AIAgg(AggFunc): View Source

    5775class AIAgg(AggFunc):
    5776    arg_types = {"this": True, "expression": True}
    5777    _sql_names = ["AI_AGG"]

arg_types = {'this': True, 'expression': True}
key = 'aiagg'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class AISummarizeAgg(AggFunc): View Source

    5780class AISummarizeAgg(AggFunc):
    5781    _sql_names = ["AI_SUMMARIZE_AGG"]

key = 'aisummarizeagg'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class AIClassify(Func): View Source

    5784class AIClassify(Func):
    5785    arg_types = {"this": True, "categories": True, "config": False}
    5786    _sql_names = ["AI_CLASSIFY"]

arg_types = {'this': True, 'categories': True, 'config': False}
key = 'aiclassify'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayAll(Func): View Source

    5789class ArrayAll(Func):
    5790    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'arrayall'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayAny(Func): View Source

    5794class ArrayAny(Func):
    5795    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'arrayany'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayConcat(Func): View Source

    5798class ArrayConcat(Func):
    5799    _sql_names = ["ARRAY_CONCAT", "ARRAY_CAT"]
    5800    arg_types = {"this": True, "expressions": False}
    5801    is_var_len_args = True

arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
key = 'arrayconcat'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayConcatAgg(AggFunc): View Source

    5804class ArrayConcatAgg(AggFunc):
    5805    pass

key = 'arrayconcatagg'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayConstructCompact(Func): View Source

    5808class ArrayConstructCompact(Func):
    5809    arg_types = {"expressions": True}
    5810    is_var_len_args = True

arg_types = {'expressions': True}
is_var_len_args = True
key = 'arrayconstructcompact'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayContains(Binary, Func): View Source

    5813class ArrayContains(Binary, Func):
    5814    _sql_names = ["ARRAY_CONTAINS", "ARRAY_HAS"]

key = 'arraycontains'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayContainsAll(Binary, Func): View Source

    5817class ArrayContainsAll(Binary, Func):
    5818    _sql_names = ["ARRAY_CONTAINS_ALL", "ARRAY_HAS_ALL"]

key = 'arraycontainsall'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayFilter(Func): View Source

    5821class ArrayFilter(Func):
    5822    arg_types = {"this": True, "expression": True}
    5823    _sql_names = ["FILTER", "ARRAY_FILTER"]

arg_types = {'this': True, 'expression': True}
key = 'arrayfilter'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayFirst(Func): View Source

    5826class ArrayFirst(Func):
    5827    pass

key = 'arrayfirst'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayLast(Func): View Source

    5830class ArrayLast(Func):
    5831    pass

key = 'arraylast'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayReverse(Func): View Source

    5834class ArrayReverse(Func):
    5835    pass

key = 'arrayreverse'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArraySlice(Func): View Source

    5838class ArraySlice(Func):
    5839    arg_types = {"this": True, "start": True, "end": False, "step": False}

arg_types = {'this': True, 'start': True, 'end': False, 'step': False}
key = 'arrayslice'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayToString(Func): View Source

    5842class ArrayToString(Func):
    5843    arg_types = {"this": True, "expression": True, "null": False}
    5844    _sql_names = ["ARRAY_TO_STRING", "ARRAY_JOIN"]

arg_types = {'this': True, 'expression': True, 'null': False}
key = 'arraytostring'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayIntersect(Func): View Source

    5847class ArrayIntersect(Func):
    5848    arg_types = {"expressions": True}
    5849    is_var_len_args = True
    5850    _sql_names = ["ARRAY_INTERSECT", "ARRAY_INTERSECTION"]

arg_types = {'expressions': True}
is_var_len_args = True
key = 'arrayintersect'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StPoint(Func): View Source

    5853class StPoint(Func):
    5854    arg_types = {"this": True, "expression": True, "null": False}
    5855    _sql_names = ["ST_POINT", "ST_MAKEPOINT"]

arg_types = {'this': True, 'expression': True, 'null': False}
key = 'stpoint'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StDistance(Func): View Source

    5858class StDistance(Func):
    5859    arg_types = {"this": True, "expression": True, "use_spheroid": False}

arg_types = {'this': True, 'expression': True, 'use_spheroid': False}
key = 'stdistance'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class String(Func): View Source

    5863class String(Func):
    5864    arg_types = {"this": True, "zone": False}

arg_types = {'this': True, 'zone': False}
key = 'string'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StringToArray(Func): View Source

    5867class StringToArray(Func):
    5868    arg_types = {"this": True, "expression": False, "null": False}
    5869    _sql_names = ["STRING_TO_ARRAY", "SPLIT_BY_STRING", "STRTOK_TO_ARRAY"]

arg_types = {'this': True, 'expression': False, 'null': False}
key = 'stringtoarray'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayOverlaps(Binary, Func): View Source

    5872class ArrayOverlaps(Binary, Func):
    5873    pass

key = 'arrayoverlaps'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArraySize(Func): View Source

    5876class ArraySize(Func):
    5877    arg_types = {"this": True, "expression": False}
    5878    _sql_names = ["ARRAY_SIZE", "ARRAY_LENGTH"]

arg_types = {'this': True, 'expression': False}
key = 'arraysize'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArraySort(Func): View Source

    5881class ArraySort(Func):
    5882    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'arraysort'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArraySum(Func): View Source

    5885class ArraySum(Func):
    5886    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'arraysum'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ArrayUnionAgg(AggFunc): View Source

    5889class ArrayUnionAgg(AggFunc):
    5890    pass

key = 'arrayunionagg'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Avg(AggFunc): View Source

    5893class Avg(AggFunc):
    5894    pass

key = 'avg'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class AnyValue(AggFunc): View Source

    5897class AnyValue(AggFunc):
    5898    pass

key = 'anyvalue'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Lag(AggFunc): View Source

    5901class Lag(AggFunc):
    5902    arg_types = {"this": True, "offset": False, "default": False}

arg_types = {'this': True, 'offset': False, 'default': False}
key = 'lag'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Lead(AggFunc): View Source

    5905class Lead(AggFunc):
    5906    arg_types = {"this": True, "offset": False, "default": False}

arg_types = {'this': True, 'offset': False, 'default': False}
key = 'lead'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class First(AggFunc): View Source

    5911class First(AggFunc):
    5912    pass

key = 'first'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Last(AggFunc): View Source

    5915class Last(AggFunc):
    5916    pass

key = 'last'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class FirstValue(AggFunc): View Source

    5919class FirstValue(AggFunc):
    5920    pass

key = 'firstvalue'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class LastValue(AggFunc): View Source

    5923class LastValue(AggFunc):
    5924    pass

key = 'lastvalue'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class NthValue(AggFunc): View Source

    5927class NthValue(AggFunc):
    5928    arg_types = {"this": True, "offset": True}

arg_types = {'this': True, 'offset': True}
key = 'nthvalue'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Case(Func): View Source

    5931class Case(Func):
    5932    arg_types = {"this": False, "ifs": True, "default": False}
    5933
    5934    def when(self, condition: ExpOrStr, then: ExpOrStr, copy: bool = True, **opts) -> Case:
    5935        instance = maybe_copy(self, copy)
    5936        instance.append(
    5937            "ifs",
    5938            If(
    5939                this=maybe_parse(condition, copy=copy, **opts),
    5940                true=maybe_parse(then, copy=copy, **opts),
    5941            ),
    5942        )
    5943        return instance
    5944
    5945    def else_(self, condition: ExpOrStr, copy: bool = True, **opts) -> Case:
    5946        instance = maybe_copy(self, copy)
    5947        instance.set("default", maybe_parse(condition, copy=copy, **opts))
    5948        return instance

arg_types = {'this': False, 'ifs': True, 'default': False}
def when( self, condition: Union[str, Expression], then: Union[str, Expression], copy: bool = True, **opts) -> Case: View Source

    5934    def when(self, condition: ExpOrStr, then: ExpOrStr, copy: bool = True, **opts) -> Case:
    5935        instance = maybe_copy(self, copy)
    5936        instance.append(
    5937            "ifs",
    5938            If(
    5939                this=maybe_parse(condition, copy=copy, **opts),
    5940                true=maybe_parse(then, copy=copy, **opts),
    5941            ),
    5942        )
    5943        return instance

def else_( self, condition: Union[str, Expression], copy: bool = True, **opts) -> Case: View Source

    5945    def else_(self, condition: ExpOrStr, copy: bool = True, **opts) -> Case:
    5946        instance = maybe_copy(self, copy)
    5947        instance.set("default", maybe_parse(condition, copy=copy, **opts))
    5948        return instance

key = 'case'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Cast(Func): View Source

    5951class Cast(Func):
    5952    arg_types = {
    5953        "this": True,
    5954        "to": True,
    5955        "format": False,
    5956        "safe": False,
    5957        "action": False,
    5958        "default": False,
    5959    }
    5960
    5961    @property
    5962    def name(self) -> str:
    5963        return self.this.name
    5964
    5965    @property
    5966    def to(self) -> DataType:
    5967        return self.args["to"]
    5968
    5969    @property
    5970    def output_name(self) -> str:
    5971        return self.name
    5972
    5973    def is_type(self, *dtypes: DATA_TYPE) -> bool:
    5974        """
    5975        Checks whether this Cast's DataType matches one of the provided data types. Nested types
    5976        like arrays or structs will be compared using "structural equivalence" semantics, so e.g.
    5977        array<int> != array<float>.
    5978
    5979        Args:
    5980            dtypes: the data types to compare this Cast's DataType to.
    5981
    5982        Returns:
    5983            True, if and only if there is a type in `dtypes` which is equal to this Cast's DataType.
    5984        """
    5985        return self.to.is_type(*dtypes)

arg_types = {'this': True, 'to': True, 'format': False, 'safe': False, 'action': False, 'default': False}
name: str View Source

    5961    @property
    5962    def name(self) -> str:
    5963        return self.this.name

to: DataType View Source

    5965    @property
    5966    def to(self) -> DataType:
    5967        return self.args["to"]

output_name: str View Source

    5969    @property
    5970    def output_name(self) -> str:
    5971        return self.name

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

def is_type( self, *dtypes: Union[str, Identifier, Dot, DataType, DataType.Type]) -> bool: View Source

    5973    def is_type(self, *dtypes: DATA_TYPE) -> bool:
    5974        """
    5975        Checks whether this Cast's DataType matches one of the provided data types. Nested types
    5976        like arrays or structs will be compared using "structural equivalence" semantics, so e.g.
    5977        array<int> != array<float>.
    5978
    5979        Args:
    5980            dtypes: the data types to compare this Cast's DataType to.
    5981
    5982        Returns:
    5983            True, if and only if there is a type in `dtypes` which is equal to this Cast's DataType.
    5984        """
    5985        return self.to.is_type(*dtypes)

Checks whether this Cast's DataType matches one of the provided data types. Nested types like arrays or structs will be compared using "structural equivalence" semantics, so e.g. array != array.

###### Arguments:

- dtypes: the data types to compare this Cast's DataType to.

###### Returns:

> True, if and only if there is a type in `dtypes` which is equal to this Cast's DataType.

key = 'cast'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  alias_or_name
  type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TryCast(Cast): View Source

    5988class TryCast(Cast):
    5989    arg_types = {**Cast.arg_types, "requires_string": False}

arg_types = {'this': True, 'to': True, 'format': False, 'safe': False, 'action': False, 'default': False, 'requires_string': False}
key = 'trycast'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  alias_or_name
  type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Cast
  name
  to
  output_name
  is_type
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONCast(Cast): View Source

    5993class JSONCast(Cast):
    5994    pass

key = 'jsoncast'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  alias_or_name
  type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Cast
  arg_types
  name
  to
  output_name
  is_type
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JustifyDays(Func): View Source

    5997class JustifyDays(Func):
    5998    pass

key = 'justifydays'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JustifyHours(Func): View Source

    6001class JustifyHours(Func):
    6002    pass

key = 'justifyhours'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JustifyInterval(Func): View Source

    6005class JustifyInterval(Func):
    6006    pass

key = 'justifyinterval'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Try(Func): View Source

    6009class Try(Func):
    6010    pass

key = 'try'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CastToStrType(Func): View Source

    6013class CastToStrType(Func):
    6014    arg_types = {"this": True, "to": True}

arg_types = {'this': True, 'to': True}
key = 'casttostrtype'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TranslateCharacters(Expression): View Source

    6018class TranslateCharacters(Expression):
    6019    arg_types = {"this": True, "expression": True, "with_error": False}

arg_types = {'this': True, 'expression': True, 'with_error': False}
key = 'translatecharacters'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Collate(Binary, Func): View Source

    6022class Collate(Binary, Func):
    6023    pass

key = 'collate'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Ceil(Func): View Source

    6026class Ceil(Func):
    6027    arg_types = {"this": True, "decimals": False, "to": False}
    6028    _sql_names = ["CEIL", "CEILING"]

arg_types = {'this': True, 'decimals': False, 'to': False}
key = 'ceil'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Coalesce(Func): View Source

    6031class Coalesce(Func):
    6032    arg_types = {"this": True, "expressions": False, "is_nvl": False, "is_null": False}
    6033    is_var_len_args = True
    6034    _sql_names = ["COALESCE", "IFNULL", "NVL"]

arg_types = {'this': True, 'expressions': False, 'is_nvl': False, 'is_null': False}
is_var_len_args = True
key = 'coalesce'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Chr(Func): View Source

    6037class Chr(Func):
    6038    arg_types = {"expressions": True, "charset": False}
    6039    is_var_len_args = True
    6040    _sql_names = ["CHR", "CHAR"]

arg_types = {'expressions': True, 'charset': False}
is_var_len_args = True
key = 'chr'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Concat(Func): View Source

    6043class Concat(Func):
    6044    arg_types = {"expressions": True, "safe": False, "coalesce": False}
    6045    is_var_len_args = True

arg_types = {'expressions': True, 'safe': False, 'coalesce': False}
is_var_len_args = True
key = 'concat'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ConcatWs(Concat): View Source

    6048class ConcatWs(Concat):
    6049    _sql_names = ["CONCAT_WS"]

key = 'concatws'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Concat
  arg_types
  is_var_len_args
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Contains(Func): View Source

    6053class Contains(Func):
    6054    arg_types = {"this": True, "expression": True, "json_scope": False}

arg_types = {'this': True, 'expression': True, 'json_scope': False}
key = 'contains'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ConnectByRoot(Func): View Source

    6058class ConnectByRoot(Func):
    6059    pass

key = 'connectbyroot'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Count(AggFunc): View Source

    6062class Count(AggFunc):
    6063    arg_types = {"this": False, "expressions": False, "big_int": False}
    6064    is_var_len_args = True

arg_types = {'this': False, 'expressions': False, 'big_int': False}
is_var_len_args = True
key = 'count'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CountIf(AggFunc): View Source

    6067class CountIf(AggFunc):
    6068    _sql_names = ["COUNT_IF", "COUNTIF"]

key = 'countif'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Cbrt(Func): View Source

    6072class Cbrt(Func):
    6073    pass

key = 'cbrt'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CurrentDate(Func): View Source

    6076class CurrentDate(Func):
    6077    arg_types = {"this": False}

arg_types = {'this': False}
key = 'currentdate'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CurrentDatetime(Func): View Source

    6080class CurrentDatetime(Func):
    6081    arg_types = {"this": False}

arg_types = {'this': False}
key = 'currentdatetime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CurrentTime(Func): View Source

    6084class CurrentTime(Func):
    6085    arg_types = {"this": False}

arg_types = {'this': False}
key = 'currenttime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CurrentTimestamp(Func): View Source

    6088class CurrentTimestamp(Func):
    6089    arg_types = {"this": False, "sysdate": False}

arg_types = {'this': False, 'sysdate': False}
key = 'currenttimestamp'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CurrentTimestampLTZ(Func): View Source

    6092class CurrentTimestampLTZ(Func):
    6093    arg_types = {}

arg_types = {}
key = 'currenttimestampltz'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CurrentSchema(Func): View Source

    6096class CurrentSchema(Func):
    6097    arg_types = {"this": False}

arg_types = {'this': False}
key = 'currentschema'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CurrentUser(Func): View Source

    6100class CurrentUser(Func):
    6101    arg_types = {"this": False}

arg_types = {'this': False}
key = 'currentuser'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class UtcDate(Func): View Source

    6104class UtcDate(Func):
    6105    arg_types = {}

arg_types = {}
key = 'utcdate'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class UtcTime(Func): View Source

    6108class UtcTime(Func):
    6109    arg_types = {"this": False}

arg_types = {'this': False}
key = 'utctime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class UtcTimestamp(Func): View Source

    6112class UtcTimestamp(Func):
    6113    arg_types = {"this": False}

arg_types = {'this': False}
key = 'utctimestamp'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DateAdd(Func, IntervalOp): View Source

    6116class DateAdd(Func, IntervalOp):
    6117    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'dateadd'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
IntervalOp
  interval
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DateBin(Func, IntervalOp): View Source

    6120class DateBin(Func, IntervalOp):
    6121    arg_types = {"this": True, "expression": True, "unit": False, "zone": False, "origin": False}

arg_types = {'this': True, 'expression': True, 'unit': False, 'zone': False, 'origin': False}
key = 'datebin'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
IntervalOp
  interval
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DateSub(Func, IntervalOp): View Source

    6124class DateSub(Func, IntervalOp):
    6125    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'datesub'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
IntervalOp
  interval
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DateDiff(Func, TimeUnit): View Source

    6128class DateDiff(Func, TimeUnit):
    6129    _sql_names = ["DATEDIFF", "DATE_DIFF"]
    6130    arg_types = {"this": True, "expression": True, "unit": False, "zone": False}

arg_types = {'this': True, 'expression': True, 'unit': False, 'zone': False}
key = 'datediff'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DateTrunc(Func): View Source

    6133class DateTrunc(Func):
    6134    arg_types = {"unit": True, "this": True, "zone": False}
    6135
    6136    def __init__(self, **args):
    6137        # Across most dialects it's safe to unabbreviate the unit (e.g. 'Q' -> 'QUARTER') except Oracle
    6138        # https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/ROUND-and-TRUNC-Date-Functions.html
    6139        unabbreviate = args.pop("unabbreviate", True)
    6140
    6141        unit = args.get("unit")
    6142        if isinstance(unit, TimeUnit.VAR_LIKE):
    6143            unit_name = unit.name.upper()
    6144            if unabbreviate and unit_name in TimeUnit.UNABBREVIATED_UNIT_NAME:
    6145                unit_name = TimeUnit.UNABBREVIATED_UNIT_NAME[unit_name]
    6146
    6147            args["unit"] = Literal.string(unit_name)
    6148
    6149        super().__init__(**args)
    6150
    6151    @property
    6152    def unit(self) -> Expression:
    6153        return self.args["unit"]

DateTrunc(**args) View Source

    6136    def __init__(self, **args):
    6137        # Across most dialects it's safe to unabbreviate the unit (e.g. 'Q' -> 'QUARTER') except Oracle
    6138        # https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/ROUND-and-TRUNC-Date-Functions.html
    6139        unabbreviate = args.pop("unabbreviate", True)
    6140
    6141        unit = args.get("unit")
    6142        if isinstance(unit, TimeUnit.VAR_LIKE):
    6143            unit_name = unit.name.upper()
    6144            if unabbreviate and unit_name in TimeUnit.UNABBREVIATED_UNIT_NAME:
    6145                unit_name = TimeUnit.UNABBREVIATED_UNIT_NAME[unit_name]
    6146
    6147            args["unit"] = Literal.string(unit_name)
    6148
    6149        super().__init__(**args)

arg_types = {'unit': True, 'this': True, 'zone': False}
unit: Expression View Source

    6151    @property
    6152    def unit(self) -> Expression:
    6153        return self.args["unit"]

key = 'datetrunc'

##### Inherited Members

Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Datetime(Func): View Source

    6158class Datetime(Func):
    6159    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'datetime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DatetimeAdd(Func, IntervalOp): View Source

    6162class DatetimeAdd(Func, IntervalOp):
    6163    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'datetimeadd'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
IntervalOp
  interval
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DatetimeSub(Func, IntervalOp): View Source

    6166class DatetimeSub(Func, IntervalOp):
    6167    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'datetimesub'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
IntervalOp
  interval
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DatetimeDiff(Func, TimeUnit): View Source

    6170class DatetimeDiff(Func, TimeUnit):
    6171    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'datetimediff'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DatetimeTrunc(Func, TimeUnit): View Source

    6174class DatetimeTrunc(Func, TimeUnit):
    6175    arg_types = {"this": True, "unit": True, "zone": False}

arg_types = {'this': True, 'unit': True, 'zone': False}
key = 'datetimetrunc'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DateFromUnixDate(Func): View Source

    6178class DateFromUnixDate(Func):
    6179    pass

key = 'datefromunixdate'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DayOfWeek(Func): View Source

    6182class DayOfWeek(Func):
    6183    _sql_names = ["DAY_OF_WEEK", "DAYOFWEEK"]

key = 'dayofweek'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DayOfWeekIso(Func): View Source

    6188class DayOfWeekIso(Func):
    6189    _sql_names = ["DAYOFWEEK_ISO", "ISODOW"]

key = 'dayofweekiso'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DayOfMonth(Func): View Source

    6192class DayOfMonth(Func):
    6193    _sql_names = ["DAY_OF_MONTH", "DAYOFMONTH"]

key = 'dayofmonth'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DayOfYear(Func): View Source

    6196class DayOfYear(Func):
    6197    _sql_names = ["DAY_OF_YEAR", "DAYOFYEAR"]

key = 'dayofyear'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ToDays(Func): View Source

    6200class ToDays(Func):
    6201    pass

key = 'todays'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class WeekOfYear(Func): View Source

    6204class WeekOfYear(Func):
    6205    _sql_names = ["WEEK_OF_YEAR", "WEEKOFYEAR"]

key = 'weekofyear'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class MonthsBetween(Func): View Source

    6208class MonthsBetween(Func):
    6209    arg_types = {"this": True, "expression": True, "roundoff": False}

arg_types = {'this': True, 'expression': True, 'roundoff': False}
key = 'monthsbetween'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class MakeInterval(Func): View Source

    6212class MakeInterval(Func):
    6213    arg_types = {
    6214        "year": False,
    6215        "month": False,
    6216        "day": False,
    6217        "hour": False,
    6218        "minute": False,
    6219        "second": False,
    6220    }

arg_types = {'year': False, 'month': False, 'day': False, 'hour': False, 'minute': False, 'second': False}
key = 'makeinterval'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class LastDay(Func, TimeUnit): View Source

    6223class LastDay(Func, TimeUnit):
    6224    _sql_names = ["LAST_DAY", "LAST_DAY_OF_MONTH"]
    6225    arg_types = {"this": True, "unit": False}

arg_types = {'this': True, 'unit': False}
key = 'lastday'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class LaxBool(Func): View Source

    6228class LaxBool(Func):
    6229    pass

key = 'laxbool'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class LaxFloat64(Func): View Source

    6232class LaxFloat64(Func):
    6233    pass

key = 'laxfloat64'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class LaxInt64(Func): View Source

    6236class LaxInt64(Func):
    6237    pass

key = 'laxint64'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class LaxString(Func): View Source

    6240class LaxString(Func):
    6241    pass

key = 'laxstring'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Extract(Func): View Source

    6244class Extract(Func):
    6245    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'extract'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Exists(Func, SubqueryPredicate): View Source

    6248class Exists(Func, SubqueryPredicate):
    6249    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'exists'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Timestamp(Func): View Source

    6252class Timestamp(Func):
    6253    arg_types = {"this": False, "zone": False, "with_tz": False}

arg_types = {'this': False, 'zone': False, 'with_tz': False}
key = 'timestamp'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TimestampAdd(Func, TimeUnit): View Source

    6256class TimestampAdd(Func, TimeUnit):
    6257    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'timestampadd'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TimestampSub(Func, TimeUnit): View Source

    6260class TimestampSub(Func, TimeUnit):
    6261    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'timestampsub'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TimestampDiff(Func, TimeUnit): View Source

    6264class TimestampDiff(Func, TimeUnit):
    6265    _sql_names = ["TIMESTAMPDIFF", "TIMESTAMP_DIFF"]
    6266    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'timestampdiff'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TimestampTrunc(Func, TimeUnit): View Source

    6269class TimestampTrunc(Func, TimeUnit):
    6270    arg_types = {"this": True, "unit": True, "zone": False}

arg_types = {'this': True, 'unit': True, 'zone': False}
key = 'timestamptrunc'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TimeAdd(Func, TimeUnit): View Source

    6273class TimeAdd(Func, TimeUnit):
    6274    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'timeadd'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TimeSub(Func, TimeUnit): View Source

    6277class TimeSub(Func, TimeUnit):
    6278    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'timesub'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TimeDiff(Func, TimeUnit): View Source

    6281class TimeDiff(Func, TimeUnit):
    6282    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'timediff'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TimeTrunc(Func, TimeUnit): View Source

    6285class TimeTrunc(Func, TimeUnit):
    6286    arg_types = {"this": True, "unit": True, "zone": False}

arg_types = {'this': True, 'unit': True, 'zone': False}
key = 'timetrunc'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class DateFromParts(Func): View Source

    6289class DateFromParts(Func):
    6290    _sql_names = ["DATE_FROM_PARTS", "DATEFROMPARTS"]
    6291    arg_types = {"year": True, "month": True, "day": True}

arg_types = {'year': True, 'month': True, 'day': True}
key = 'datefromparts'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TimeFromParts(Func): View Source

    6294class TimeFromParts(Func):
    6295    _sql_names = ["TIME_FROM_PARTS", "TIMEFROMPARTS"]
    6296    arg_types = {
    6297        "hour": True,
    6298        "min": True,
    6299        "sec": True,
    6300        "nano": False,
    6301        "fractions": False,
    6302        "precision": False,
    6303    }

arg_types = {'hour': True, 'min': True, 'sec': True, 'nano': False, 'fractions': False, 'precision': False}
key = 'timefromparts'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DateStrToDate(Func): View Source

    6306class DateStrToDate(Func):
    6307    pass

key = 'datestrtodate'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DateToDateStr(Func): View Source

    6310class DateToDateStr(Func):
    6311    pass

key = 'datetodatestr'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DateToDi(Func): View Source

    6314class DateToDi(Func):
    6315    pass

key = 'datetodi'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Date(Func): View Source

    6319class Date(Func):
    6320    arg_types = {"this": False, "zone": False, "expressions": False}
    6321    is_var_len_args = True

arg_types = {'this': False, 'zone': False, 'expressions': False}
is_var_len_args = True
key = 'date'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Day(Func): View Source

    6324class Day(Func):
    6325    pass

key = 'day'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Decode(Func): View Source

    6328class Decode(Func):
    6329    arg_types = {"this": True, "charset": True, "replace": False}

arg_types = {'this': True, 'charset': True, 'replace': False}
key = 'decode'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DecodeCase(Func): View Source

    6332class DecodeCase(Func):
    6333    arg_types = {"expressions": True}
    6334    is_var_len_args = True

arg_types = {'expressions': True}
is_var_len_args = True
key = 'decodecase'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DenseRank(AggFunc): View Source

    6337class DenseRank(AggFunc):
    6338    arg_types = {"expressions": False}
    6339    is_var_len_args = True

arg_types = {'expressions': False}
is_var_len_args = True
key = 'denserank'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class DiToDate(Func): View Source

    6342class DiToDate(Func):
    6343    pass

key = 'ditodate'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Encode(Func): View Source

    6346class Encode(Func):
    6347    arg_types = {"this": True, "charset": True}

arg_types = {'this': True, 'charset': True}
key = 'encode'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Exp(Func): View Source

    6350class Exp(Func):
    6351    pass

key = 'exp'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Explode(Func, UDTF): View Source

    6355class Explode(Func, UDTF):
    6356    arg_types = {"this": True, "expressions": False}
    6357    is_var_len_args = True

arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
key = 'explode'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
UDTF
  selects
DerivedTable
  named_selects

class Inline(Func): View Source

    6361class Inline(Func):
    6362    pass

key = 'inline'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ExplodeOuter(Explode): View Source

    6365class ExplodeOuter(Explode):
    6366    pass

key = 'explodeouter'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Explode
  arg_types
  is_var_len_args
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
UDTF
  selects
DerivedTable
  named_selects

class Posexplode(Explode): View Source

    6369class Posexplode(Explode):
    6370    pass

key = 'posexplode'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Explode
  arg_types
  is_var_len_args
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
UDTF
  selects
DerivedTable
  named_selects

class PosexplodeOuter(Posexplode, ExplodeOuter): View Source

    6373class PosexplodeOuter(Posexplode, ExplodeOuter):
    6374    pass

key = 'posexplodeouter'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Explode
  arg_types
  is_var_len_args
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
UDTF
  selects
DerivedTable
  named_selects

class PositionalColumn(Expression): View Source

    6377class PositionalColumn(Expression):
    6378    pass

key = 'positionalcolumn'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Unnest(Func, UDTF): View Source

    6381class Unnest(Func, UDTF):
    6382    arg_types = {
    6383        "expressions": True,
    6384        "alias": False,
    6385        "offset": False,
    6386        "explode_array": False,
    6387    }
    6388
    6389    @property
    6390    def selects(self) -> t.List[Expression]:
    6391        columns = super().selects
    6392        offset = self.args.get("offset")
    6393        if offset:
    6394            columns = columns + [to_identifier("offset") if offset is True else offset]
    6395        return columns

arg_types = {'expressions': True, 'alias': False, 'offset': False, 'explode_array': False}
selects: List[Expression] View Source

    6389    @property
    6390    def selects(self) -> t.List[Expression]:
    6391        columns = super().selects
    6392        offset = self.args.get("offset")
    6393        if offset:
    6394            columns = columns + [to_identifier("offset") if offset is True else offset]
    6395        return columns

key = 'unnest'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
DerivedTable
  named_selects

class Floor(Func): View Source

    6398class Floor(Func):
    6399    arg_types = {"this": True, "decimals": False, "to": False}

arg_types = {'this': True, 'decimals': False, 'to': False}
key = 'floor'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class FromBase32(Func): View Source

    6402class FromBase32(Func):
    6403    pass

key = 'frombase32'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class FromBase64(Func): View Source

    6406class FromBase64(Func):
    6407    pass

key = 'frombase64'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ToBase32(Func): View Source

    6410class ToBase32(Func):
    6411    pass

key = 'tobase32'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ToBase64(Func): View Source

    6414class ToBase64(Func):
    6415    pass

key = 'tobase64'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Base64DecodeBinary(Func): View Source

    6419class Base64DecodeBinary(Func):
    6420    arg_types = {"this": True, "alphabet": False}

arg_types = {'this': True, 'alphabet': False}
key = 'base64decodebinary'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Base64DecodeString(Func): View Source

    6423class Base64DecodeString(Func):
    6424    arg_types = {"this": True, "alphabet": False}

arg_types = {'this': True, 'alphabet': False}
key = 'base64decodestring'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Base64Encode(Func): View Source

    6427class Base64Encode(Func):
    6428    arg_types = {"this": True, "max_line_length": False, "alphabet": False}

arg_types = {'this': True, 'max_line_length': False, 'alphabet': False}
key = 'base64encode'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class FromISO8601Timestamp(Func): View Source

    6432class FromISO8601Timestamp(Func):
    6433    _sql_names = ["FROM_ISO8601_TIMESTAMP"]

key = 'fromiso8601timestamp'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class GapFill(Func): View Source

    6436class GapFill(Func):
    6437    arg_types = {
    6438        "this": True,
    6439        "ts_column": True,
    6440        "bucket_width": True,
    6441        "partitioning_columns": False,
    6442        "value_columns": False,
    6443        "origin": False,
    6444        "ignore_nulls": False,
    6445    }

arg_types = {'this': True, 'ts_column': True, 'bucket_width': True, 'partitioning_columns': False, 'value_columns': False, 'origin': False, 'ignore_nulls': False}
key = 'gapfill'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class GenerateDateArray(Func): View Source

    6449class GenerateDateArray(Func):
    6450    arg_types = {"start": True, "end": True, "step": False}

arg_types = {'start': True, 'end': True, 'step': False}
key = 'generatedatearray'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class GenerateTimestampArray(Func): View Source

    6454class GenerateTimestampArray(Func):
    6455    arg_types = {"start": True, "end": True, "step": True}

arg_types = {'start': True, 'end': True, 'step': True}
key = 'generatetimestamparray'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class GetExtract(Func): View Source

    6459class GetExtract(Func):
    6460    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'getextract'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Greatest(Func): View Source

    6463class Greatest(Func):
    6464    arg_types = {"this": True, "expressions": False}
    6465    is_var_len_args = True

arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
key = 'greatest'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class OverflowTruncateBehavior(Expression): View Source

    6470class OverflowTruncateBehavior(Expression):
    6471    arg_types = {"this": False, "with_count": True}

arg_types = {'this': False, 'with_count': True}
key = 'overflowtruncatebehavior'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class GroupConcat(AggFunc): View Source

    6474class GroupConcat(AggFunc):
    6475    arg_types = {"this": True, "separator": False, "on_overflow": False}

arg_types = {'this': True, 'separator': False, 'on_overflow': False}
key = 'groupconcat'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Hex(Func): View Source

    6478class Hex(Func):
    6479    pass

key = 'hex'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class HexDecodeString(Func): View Source

    6483class HexDecodeString(Func):
    6484    pass

key = 'hexdecodestring'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class HexEncode(Func): View Source

    6487class HexEncode(Func):
    6488    arg_types = {"this": True, "case": False}

arg_types = {'this': True, 'case': False}
key = 'hexencode'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Compress(Func): View Source

    6493class Compress(Func):
    6494    arg_types = {"this": True, "method": False}

arg_types = {'this': True, 'method': False}
key = 'compress'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class LowerHex(Hex): View Source

    6497class LowerHex(Hex):
    6498    pass

key = 'lowerhex'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class And(Connector, Func): View Source

    6501class And(Connector, Func):
    6502    pass

key = 'and'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Or(Connector, Func): View Source

    6505class Or(Connector, Func):
    6506    pass

key = 'or'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Xor(Connector, Func): View Source

    6509class Xor(Connector, Func):
    6510    arg_types = {"this": False, "expression": False, "expressions": False}

arg_types = {'this': False, 'expression': False, 'expressions': False}
key = 'xor'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class If(Func): View Source

    6513class If(Func):
    6514    arg_types = {"this": True, "true": True, "false": False}
    6515    _sql_names = ["IF", "IIF"]

arg_types = {'this': True, 'true': True, 'false': False}
key = 'if'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Nullif(Func): View Source

    6518class Nullif(Func):
    6519    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'nullif'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Initcap(Func): View Source

    6522class Initcap(Func):
    6523    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'initcap'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class IsAscii(Func): View Source

    6526class IsAscii(Func):
    6527    pass

key = 'isascii'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class IsNan(Func): View Source

    6530class IsNan(Func):
    6531    _sql_names = ["IS_NAN", "ISNAN"]

key = 'isnan'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Int64(Func): View Source

    6535class Int64(Func):
    6536    pass

key = 'int64'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class IsInf(Func): View Source

    6539class IsInf(Func):
    6540    _sql_names = ["IS_INF", "ISINF"]

key = 'isinf'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSON(Expression): View Source

    6544class JSON(Expression):
    6545    arg_types = {"this": False, "with": False, "unique": False}

arg_types = {'this': False, 'with': False, 'unique': False}
key = 'json'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPath(Expression): View Source

    6548class JSONPath(Expression):
    6549    arg_types = {"expressions": True, "escape": False}
    6550
    6551    @property
    6552    def output_name(self) -> str:
    6553        last_segment = self.expressions[-1].this
    6554        return last_segment if isinstance(last_segment, str) else ""

arg_types = {'expressions': True, 'escape': False}
output_name: str View Source

    6551    @property
    6552    def output_name(self) -> str:
    6553        last_segment = self.expressions[-1].this
    6554        return last_segment if isinstance(last_segment, str) else ""

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

key = 'jsonpath'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPathPart(Expression): View Source

    6557class JSONPathPart(Expression):
    6558    arg_types = {}

arg_types = {}
key = 'jsonpathpart'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPathFilter(JSONPathPart): View Source

    6561class JSONPathFilter(JSONPathPart):
    6562    arg_types = {"this": True}

arg_types = {'this': True}
key = 'jsonpathfilter'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPathKey(JSONPathPart): View Source

    6565class JSONPathKey(JSONPathPart):
    6566    arg_types = {"this": True}

arg_types = {'this': True}
key = 'jsonpathkey'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPathRecursive(JSONPathPart): View Source

    6569class JSONPathRecursive(JSONPathPart):
    6570    arg_types = {"this": False}

arg_types = {'this': False}
key = 'jsonpathrecursive'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPathRoot(JSONPathPart): View Source

    6573class JSONPathRoot(JSONPathPart):
    6574    pass

key = 'jsonpathroot'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
JSONPathPart
  arg_types

class JSONPathScript(JSONPathPart): View Source

    6577class JSONPathScript(JSONPathPart):
    6578    arg_types = {"this": True}

arg_types = {'this': True}
key = 'jsonpathscript'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPathSlice(JSONPathPart): View Source

    6581class JSONPathSlice(JSONPathPart):
    6582    arg_types = {"start": False, "end": False, "step": False}

arg_types = {'start': False, 'end': False, 'step': False}
key = 'jsonpathslice'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPathSelector(JSONPathPart): View Source

    6585class JSONPathSelector(JSONPathPart):
    6586    arg_types = {"this": True}

arg_types = {'this': True}
key = 'jsonpathselector'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPathSubscript(JSONPathPart): View Source

    6589class JSONPathSubscript(JSONPathPart):
    6590    arg_types = {"this": True}

arg_types = {'this': True}
key = 'jsonpathsubscript'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPathUnion(JSONPathPart): View Source

    6593class JSONPathUnion(JSONPathPart):
    6594    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'jsonpathunion'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONPathWildcard(JSONPathPart): View Source

    6597class JSONPathWildcard(JSONPathPart):
    6598    pass

key = 'jsonpathwildcard'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
JSONPathPart
  arg_types

class FormatJson(Expression): View Source

    6601class FormatJson(Expression):
    6602    pass

key = 'formatjson'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Format(Func): View Source

    6605class Format(Func):
    6606    arg_types = {"this": True, "expressions": True}
    6607    is_var_len_args = True

arg_types = {'this': True, 'expressions': True}
is_var_len_args = True
key = 'format'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONKeyValue(Expression): View Source

    6610class JSONKeyValue(Expression):
    6611    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'jsonkeyvalue'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONKeysAtDepth(Func): View Source

    6615class JSONKeysAtDepth(Func):
    6616    arg_types = {"this": True, "expression": False, "mode": False}

arg_types = {'this': True, 'expression': False, 'mode': False}
key = 'jsonkeysatdepth'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONObject(Func): View Source

    6619class JSONObject(Func):
    6620    arg_types = {
    6621        "expressions": False,
    6622        "null_handling": False,
    6623        "unique_keys": False,
    6624        "return_type": False,
    6625        "encoding": False,
    6626    }

arg_types = {'expressions': False, 'null_handling': False, 'unique_keys': False, 'return_type': False, 'encoding': False}
key = 'jsonobject'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONObjectAgg(AggFunc): View Source

    6629class JSONObjectAgg(AggFunc):
    6630    arg_types = {
    6631        "expressions": False,
    6632        "null_handling": False,
    6633        "unique_keys": False,
    6634        "return_type": False,
    6635        "encoding": False,
    6636    }

arg_types = {'expressions': False, 'null_handling': False, 'unique_keys': False, 'return_type': False, 'encoding': False}
key = 'jsonobjectagg'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONBObjectAgg(AggFunc): View Source

    6640class JSONBObjectAgg(AggFunc):
    6641    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'jsonbobjectagg'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONArray(Func): View Source

    6645class JSONArray(Func):
    6646    arg_types = {
    6647        "expressions": False,
    6648        "null_handling": False,
    6649        "return_type": False,
    6650        "strict": False,
    6651    }

arg_types = {'expressions': False, 'null_handling': False, 'return_type': False, 'strict': False}
key = 'jsonarray'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONArrayAgg(Func): View Source

    6655class JSONArrayAgg(Func):
    6656    arg_types = {
    6657        "this": True,
    6658        "order": False,
    6659        "null_handling": False,
    6660        "return_type": False,
    6661        "strict": False,
    6662    }

arg_types = {'this': True, 'order': False, 'null_handling': False, 'return_type': False, 'strict': False}
key = 'jsonarrayagg'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONExists(Func): View Source

    6665class JSONExists(Func):
    6666    arg_types = {"this": True, "path": True, "passing": False, "on_condition": False}

arg_types = {'this': True, 'path': True, 'passing': False, 'on_condition': False}
key = 'jsonexists'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONColumnDef(Expression): View Source

    6671class JSONColumnDef(Expression):
    6672    arg_types = {"this": False, "kind": False, "path": False, "nested_schema": False}

arg_types = {'this': False, 'kind': False, 'path': False, 'nested_schema': False}
key = 'jsoncolumndef'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONSchema(Expression): View Source

    6675class JSONSchema(Expression):
    6676    arg_types = {"expressions": True}

arg_types = {'expressions': True}
key = 'jsonschema'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONSet(Func): View Source

    6679class JSONSet(Func):
    6680    arg_types = {"this": True, "expressions": True}
    6681    is_var_len_args = True
    6682    _sql_names = ["JSON_SET"]

arg_types = {'this': True, 'expressions': True}
is_var_len_args = True
key = 'jsonset'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONStripNulls(Func): View Source

    6686class JSONStripNulls(Func):
    6687    arg_types = {
    6688        "this": True,
    6689        "expression": False,
    6690        "include_arrays": False,
    6691        "remove_empty": False,
    6692    }
    6693    _sql_names = ["JSON_STRIP_NULLS"]

arg_types = {'this': True, 'expression': False, 'include_arrays': False, 'remove_empty': False}
key = 'jsonstripnulls'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONValue(Expression): View Source

    6697class JSONValue(Expression):
    6698    arg_types = {
    6699        "this": True,
    6700        "path": True,
    6701        "returning": False,
    6702        "on_condition": False,
    6703    }

arg_types = {'this': True, 'path': True, 'returning': False, 'on_condition': False}
key = 'jsonvalue'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONValueArray(Func): View Source

    6706class JSONValueArray(Func):
    6707    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'jsonvaluearray'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONRemove(Func): View Source

    6710class JSONRemove(Func):
    6711    arg_types = {"this": True, "expressions": True}
    6712    is_var_len_args = True
    6713    _sql_names = ["JSON_REMOVE"]

arg_types = {'this': True, 'expressions': True}
is_var_len_args = True
key = 'jsonremove'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONTable(Func): View Source

    6717class JSONTable(Func):
    6718    arg_types = {
    6719        "this": True,
    6720        "schema": True,
    6721        "path": False,
    6722        "error_handling": False,
    6723        "empty_handling": False,
    6724    }

arg_types = {'this': True, 'schema': True, 'path': False, 'error_handling': False, 'empty_handling': False}
key = 'jsontable'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONType(Func): View Source

    6729class JSONType(Func):
    6730    arg_types = {"this": True, "expression": False}
    6731    _sql_names = ["JSON_TYPE"]

arg_types = {'this': True, 'expression': False}
key = 'jsontype'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ObjectInsert(Func): View Source

    6735class ObjectInsert(Func):
    6736    arg_types = {
    6737        "this": True,
    6738        "key": True,
    6739        "value": True,
    6740        "update_flag": False,
    6741    }

arg_types = {'this': True, 'key': True, 'value': True, 'update_flag': False}
key = 'objectinsert'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class OpenJSONColumnDef(Expression): View Source

    6744class OpenJSONColumnDef(Expression):
    6745    arg_types = {"this": True, "kind": True, "path": False, "as_json": False}

arg_types = {'this': True, 'kind': True, 'path': False, 'as_json': False}
key = 'openjsoncolumndef'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class OpenJSON(Func): View Source

    6748class OpenJSON(Func):
    6749    arg_types = {"this": True, "path": False, "expressions": False}

arg_types = {'this': True, 'path': False, 'expressions': False}
key = 'openjson'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONBContains(Binary, Func): View Source

    6752class JSONBContains(Binary, Func):
    6753    _sql_names = ["JSONB_CONTAINS"]

key = 'jsonbcontains'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONBContainsAnyTopKeys(Binary, Func): View Source

    6757class JSONBContainsAnyTopKeys(Binary, Func):
    6758    pass

key = 'jsonbcontainsanytopkeys'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONBContainsAllTopKeys(Binary, Func): View Source

    6762class JSONBContainsAllTopKeys(Binary, Func):
    6763    pass

key = 'jsonbcontainsalltopkeys'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONBExists(Func): View Source

    6766class JSONBExists(Func):
    6767    arg_types = {"this": True, "path": True}
    6768    _sql_names = ["JSONB_EXISTS"]

arg_types = {'this': True, 'path': True}
key = 'jsonbexists'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONBDeleteAtPath(Binary, Func): View Source

    6772class JSONBDeleteAtPath(Binary, Func):
    6773    pass

key = 'jsonbdeleteatpath'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONExtract(Binary, Func): View Source

    6776class JSONExtract(Binary, Func):
    6777    arg_types = {
    6778        "this": True,
    6779        "expression": True,
    6780        "only_json_types": False,
    6781        "expressions": False,
    6782        "variant_extract": False,
    6783        "json_query": False,
    6784        "option": False,
    6785        "quote": False,
    6786        "on_condition": False,
    6787        "requires_json": False,
    6788    }
    6789    _sql_names = ["JSON_EXTRACT"]
    6790    is_var_len_args = True
    6791
    6792    @property
    6793    def output_name(self) -> str:
    6794        return self.expression.output_name if not self.expressions else ""

arg_types = {'this': True, 'expression': True, 'only_json_types': False, 'expressions': False, 'variant_extract': False, 'json_query': False, 'option': False, 'quote': False, 'on_condition': False, 'requires_json': False}
is_var_len_args = True
output_name: str View Source

    6792    @property
    6793    def output_name(self) -> str:
    6794        return self.expression.output_name if not self.expressions else ""

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

key = 'jsonextract'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONExtractQuote(Expression): View Source

    6798class JSONExtractQuote(Expression):
    6799    arg_types = {
    6800        "option": True,
    6801        "scalar": False,
    6802    }

arg_types = {'option': True, 'scalar': False}
key = 'jsonextractquote'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class JSONExtractArray(Func): View Source

    6805class JSONExtractArray(Func):
    6806    arg_types = {"this": True, "expression": False}
    6807    _sql_names = ["JSON_EXTRACT_ARRAY"]

arg_types = {'this': True, 'expression': False}
key = 'jsonextractarray'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONExtractScalar(Binary, Func): View Source

    6810class JSONExtractScalar(Binary, Func):
    6811    arg_types = {
    6812        "this": True,
    6813        "expression": True,
    6814        "only_json_types": False,
    6815        "expressions": False,
    6816        "json_type": False,
    6817    }
    6818    _sql_names = ["JSON_EXTRACT_SCALAR"]
    6819    is_var_len_args = True
    6820
    6821    @property
    6822    def output_name(self) -> str:
    6823        return self.expression.output_name

arg_types = {'this': True, 'expression': True, 'only_json_types': False, 'expressions': False, 'json_type': False}
is_var_len_args = True
output_name: str View Source

    6821    @property
    6822    def output_name(self) -> str:
    6823        return self.expression.output_name

Name of the output column if this expression is a selection.

If the Expression has no output name, an empty string is returned.

###### Example:

>     >>> from sqlglot import parse_one
>     >>> parse_one("SELECT a")sqlglot.expressions[0].output_name
>     'a'
>     >>> parse_one("SELECT b AS c")sqlglot.expressions[0].output_name
>     'c'
>     >>> parse_one("SELECT 1 + 2")sqlglot.expressions[0].output_name
>     ''

key = 'jsonextractscalar'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONBExtract(Binary, Func): View Source

    6826class JSONBExtract(Binary, Func):
    6827    _sql_names = ["JSONB_EXTRACT"]

key = 'jsonbextract'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONBExtractScalar(Binary, Func): View Source

    6830class JSONBExtractScalar(Binary, Func):
    6831    arg_types = {"this": True, "expression": True, "json_type": False}
    6832    _sql_names = ["JSONB_EXTRACT_SCALAR"]

arg_types = {'this': True, 'expression': True, 'json_type': False}
key = 'jsonbextractscalar'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONFormat(Func): View Source

    6835class JSONFormat(Func):
    6836    arg_types = {"this": False, "options": False, "is_json": False, "to_json": False}
    6837    _sql_names = ["JSON_FORMAT"]

arg_types = {'this': False, 'options': False, 'is_json': False, 'to_json': False}
key = 'jsonformat'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONArrayAppend(Func): View Source

    6840class JSONArrayAppend(Func):
    6841    arg_types = {"this": True, "expressions": True}
    6842    is_var_len_args = True
    6843    _sql_names = ["JSON_ARRAY_APPEND"]

arg_types = {'this': True, 'expressions': True}
is_var_len_args = True
key = 'jsonarrayappend'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONArrayContains(Binary, Predicate, Func): View Source

    6847class JSONArrayContains(Binary, Predicate, Func):
    6848    arg_types = {"this": True, "expression": True, "json_type": False}
    6849    _sql_names = ["JSON_ARRAY_CONTAINS"]

arg_types = {'this': True, 'expression': True, 'json_type': False}
key = 'jsonarraycontains'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class JSONArrayInsert(Func): View Source

    6852class JSONArrayInsert(Func):
    6853    arg_types = {"this": True, "expressions": True}
    6854    is_var_len_args = True
    6855    _sql_names = ["JSON_ARRAY_INSERT"]

arg_types = {'this': True, 'expressions': True}
is_var_len_args = True
key = 'jsonarrayinsert'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ParseBignumeric(Func): View Source

    6858class ParseBignumeric(Func):
    6859    pass

key = 'parsebignumeric'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ParseNumeric(Func): View Source

    6862class ParseNumeric(Func):
    6863    pass

key = 'parsenumeric'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ParseJSON(Func): View Source

    6866class ParseJSON(Func):
    6867    # BigQuery, Snowflake have PARSE_JSON, Presto has JSON_PARSE
    6868    # Snowflake also has TRY_PARSE_JSON, which is represented using `safe`
    6869    _sql_names = ["PARSE_JSON", "JSON_PARSE"]
    6870    arg_types = {"this": True, "expression": False, "safe": False}

arg_types = {'this': True, 'expression': False, 'safe': False}
key = 'parsejson'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ParseTime(Func): View Source

    6873class ParseTime(Func):
    6874    arg_types = {"this": True, "format": True}

arg_types = {'this': True, 'format': True}
key = 'parsetime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ParseDatetime(Func): View Source

    6877class ParseDatetime(Func):
    6878    arg_types = {"this": True, "format": False, "zone": False}

arg_types = {'this': True, 'format': False, 'zone': False}
key = 'parsedatetime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Least(Func): View Source

    6881class Least(Func):
    6882    arg_types = {"this": True, "expressions": False}
    6883    is_var_len_args = True

arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
key = 'least'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Left(Func): View Source

    6886class Left(Func):
    6887    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'left'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Right(Func): View Source

    6890class Right(Func):
    6891    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'right'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Reverse(Func): View Source

    6894class Reverse(Func):
    6895    pass

key = 'reverse'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Length(Func): View Source

    6898class Length(Func):
    6899    arg_types = {"this": True, "binary": False, "encoding": False}
    6900    _sql_names = ["LENGTH", "LEN", "CHAR_LENGTH", "CHARACTER_LENGTH"]

arg_types = {'this': True, 'binary': False, 'encoding': False}
key = 'length'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class BitLength(Func): View Source

    6903class BitLength(Func):
    6904    pass

key = 'bitlength'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Levenshtein(Func): View Source

    6907class Levenshtein(Func):
    6908    arg_types = {
    6909        "this": True,
    6910        "expression": False,
    6911        "ins_cost": False,
    6912        "del_cost": False,
    6913        "sub_cost": False,
    6914        "max_dist": False,
    6915    }

arg_types = {'this': True, 'expression': False, 'ins_cost': False, 'del_cost': False, 'sub_cost': False, 'max_dist': False}
key = 'levenshtein'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Ln(Func): View Source

    6918class Ln(Func):
    6919    pass

key = 'ln'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Log(Func): View Source

    6922class Log(Func):
    6923    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'log'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class LogicalOr(AggFunc): View Source

    6926class LogicalOr(AggFunc):
    6927    _sql_names = ["LOGICAL_OR", "BOOL_OR", "BOOLOR_AGG"]

key = 'logicalor'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class LogicalAnd(AggFunc): View Source

    6930class LogicalAnd(AggFunc):
    6931    _sql_names = ["LOGICAL_AND", "BOOL_AND", "BOOLAND_AGG"]

key = 'logicaland'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Lower(Func): View Source

    6934class Lower(Func):
    6935    _sql_names = ["LOWER", "LCASE"]

key = 'lower'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Map(Func): View Source

    6938class Map(Func):
    6939    arg_types = {"keys": False, "values": False}
    6940
    6941    @property
    6942    def keys(self) -> t.List[Expression]:
    6943        keys = self.args.get("keys")
    6944        return keys.expressions if keys else []
    6945
    6946    @property
    6947    def values(self) -> t.List[Expression]:
    6948        values = self.args.get("values")
    6949        return values.expressions if values else []

arg_types = {'keys': False, 'values': False}
keys: List[Expression] View Source

    6941    @property
    6942    def keys(self) -> t.List[Expression]:
    6943        keys = self.args.get("keys")
    6944        return keys.expressions if keys else []

values: List[Expression] View Source

    6946    @property
    6947    def values(self) -> t.List[Expression]:
    6948        values = self.args.get("values")
    6949        return values.expressions if values else []

key = 'map'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ToMap(Func): View Source

    6953class ToMap(Func):
    6954    pass

key = 'tomap'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class MapFromEntries(Func): View Source

    6957class MapFromEntries(Func):
    6958    pass

key = 'mapfromentries'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ScopeResolution(Expression): View Source

    6962class ScopeResolution(Expression):
    6963    arg_types = {"this": False, "expression": True}

arg_types = {'this': False, 'expression': True}
key = 'scoperesolution'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Stream(Expression): View Source

    6966class Stream(Expression):
    6967    pass

key = 'stream'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class StarMap(Func): View Source

    6970class StarMap(Func):
    6971    pass

key = 'starmap'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class VarMap(Func): View Source

    6974class VarMap(Func):
    6975    arg_types = {"keys": True, "values": True}
    6976    is_var_len_args = True
    6977
    6978    @property
    6979    def keys(self) -> t.List[Expression]:
    6980        return self.args["keys"].expressions
    6981
    6982    @property
    6983    def values(self) -> t.List[Expression]:
    6984        return self.args["values"].expressions

arg_types = {'keys': True, 'values': True}
is_var_len_args = True
keys: List[Expression] View Source

    6978    @property
    6979    def keys(self) -> t.List[Expression]:
    6980        return self.args["keys"].expressions

values: List[Expression] View Source

    6982    @property
    6983    def values(self) -> t.List[Expression]:
    6984        return self.args["values"].expressions

key = 'varmap'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class MatchAgainst(Func): View Source

    6988class MatchAgainst(Func):
    6989    arg_types = {"this": True, "expressions": True, "modifier": False}

arg_types = {'this': True, 'expressions': True, 'modifier': False}
key = 'matchagainst'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Max(AggFunc): View Source

    6992class Max(AggFunc):
    6993    arg_types = {"this": True, "expressions": False}
    6994    is_var_len_args = True

arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
key = 'max'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class MD5(Func): View Source

    6997class MD5(Func):
    6998    _sql_names = ["MD5"]

key = 'md5'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class MD5Digest(Func): View Source

    7002class MD5Digest(Func):
    7003    _sql_names = ["MD5_DIGEST"]

key = 'md5digest'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class MD5NumberLower64(Func): View Source

    7007class MD5NumberLower64(Func):
    7008    pass

key = 'md5numberlower64'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class MD5NumberUpper64(Func): View Source

    7012class MD5NumberUpper64(Func):
    7013    pass

key = 'md5numberupper64'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Median(AggFunc): View Source

    7016class Median(AggFunc):
    7017    pass

key = 'median'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Min(AggFunc): View Source

    7020class Min(AggFunc):
    7021    arg_types = {"this": True, "expressions": False}
    7022    is_var_len_args = True

arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
key = 'min'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Month(Func): View Source

    7025class Month(Func):
    7026    pass

key = 'month'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class AddMonths(Func): View Source

    7029class AddMonths(Func):
    7030    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'addmonths'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Nvl2(Func): View Source

    7033class Nvl2(Func):
    7034    arg_types = {"this": True, "true": True, "false": False}

arg_types = {'this': True, 'true': True, 'false': False}
key = 'nvl2'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Ntile(AggFunc): View Source

    7037class Ntile(AggFunc):
    7038    arg_types = {"this": False}

arg_types = {'this': False}
key = 'ntile'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Normalize(Func): View Source

    7041class Normalize(Func):
    7042    arg_types = {"this": True, "form": False, "is_casefold": False}

arg_types = {'this': True, 'form': False, 'is_casefold': False}
key = 'normalize'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Overlay(Func): View Source

    7045class Overlay(Func):
    7046    arg_types = {"this": True, "expression": True, "from": True, "for": False}

arg_types = {'this': True, 'expression': True, 'from': True, 'for': False}
key = 'overlay'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Predict(Func): View Source

    7050class Predict(Func):
    7051    arg_types = {"this": True, "expression": True, "params_struct": False}

arg_types = {'this': True, 'expression': True, 'params_struct': False}
key = 'predict'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class MLTranslate(Func): View Source

    7055class MLTranslate(Func):
    7056    arg_types = {"this": True, "expression": True, "params_struct": True}

arg_types = {'this': True, 'expression': True, 'params_struct': True}
key = 'mltranslate'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class FeaturesAtTime(Func): View Source

    7060class FeaturesAtTime(Func):
    7061    arg_types = {"this": True, "time": False, "num_rows": False, "ignore_feature_nulls": False}

arg_types = {'this': True, 'time': False, 'num_rows': False, 'ignore_feature_nulls': False}
key = 'featuresattime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class GenerateEmbedding(Func): View Source

    7065class GenerateEmbedding(Func):
    7066    arg_types = {"this": True, "expression": True, "params_struct": False, "is_text": False}

arg_types = {'this': True, 'expression': True, 'params_struct': False, 'is_text': False}
key = 'generateembedding'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class MLForecast(Func): View Source

    7069class MLForecast(Func):
    7070    arg_types = {"this": True, "expression": False, "params_struct": False}

arg_types = {'this': True, 'expression': False, 'params_struct': False}
key = 'mlforecast'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ModelAttribute(Expression): View Source

    7075class ModelAttribute(Expression):
    7076    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'modelattribute'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class VectorSearch(Func): View Source

    7080class VectorSearch(Func):
    7081    arg_types = {
    7082        "this": True,
    7083        "column_to_search": True,
    7084        "query_table": True,
    7085        "query_column_to_search": False,
    7086        "top_k": False,
    7087        "distance_type": False,
    7088        "options": False,
    7089    }

arg_types = {'this': True, 'column_to_search': True, 'query_table': True, 'query_column_to_search': False, 'top_k': False, 'distance_type': False, 'options': False}
key = 'vectorsearch'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Pow(Binary, Func): View Source

    7092class Pow(Binary, Func):
    7093    _sql_names = ["POWER", "POW"]

key = 'pow'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class PercentileCont(AggFunc): View Source

    7096class PercentileCont(AggFunc):
    7097    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'percentilecont'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class PercentileDisc(AggFunc): View Source

    7100class PercentileDisc(AggFunc):
    7101    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'percentiledisc'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class PercentRank(AggFunc): View Source

    7104class PercentRank(AggFunc):
    7105    arg_types = {"expressions": False}
    7106    is_var_len_args = True

arg_types = {'expressions': False}
is_var_len_args = True
key = 'percentrank'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Quantile(AggFunc): View Source

    7109class Quantile(AggFunc):
    7110    arg_types = {"this": True, "quantile": True}

arg_types = {'this': True, 'quantile': True}
key = 'quantile'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ApproxQuantile(Quantile): View Source

    7113class ApproxQuantile(Quantile):
    7114    arg_types = {
    7115        "this": True,
    7116        "quantile": True,
    7117        "accuracy": False,
    7118        "weight": False,
    7119        "error_tolerance": False,
    7120    }

arg_types = {'this': True, 'quantile': True, 'accuracy': False, 'weight': False, 'error_tolerance': False}
key = 'approxquantile'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Quarter(Func): View Source

    7123class Quarter(Func):
    7124    pass

key = 'quarter'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Rand(Func): View Source

    7129class Rand(Func):
    7130    _sql_names = ["RAND", "RANDOM"]
    7131    arg_types = {"this": False, "lower": False, "upper": False}

arg_types = {'this': False, 'lower': False, 'upper': False}
key = 'rand'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Randn(Func): View Source

    7134class Randn(Func):
    7135    arg_types = {"this": False}

arg_types = {'this': False}
key = 'randn'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class RangeN(Func): View Source

    7138class RangeN(Func):
    7139    arg_types = {"this": True, "expressions": True, "each": False}

arg_types = {'this': True, 'expressions': True, 'each': False}
key = 'rangen'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class RangeBucket(Func): View Source

    7142class RangeBucket(Func):
    7143    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'rangebucket'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Rank(AggFunc): View Source

    7146class Rank(AggFunc):
    7147    arg_types = {"expressions": False}
    7148    is_var_len_args = True

arg_types = {'expressions': False}
is_var_len_args = True
key = 'rank'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class ReadCSV(Func): View Source

    7151class ReadCSV(Func):
    7152    _sql_names = ["READ_CSV"]
    7153    is_var_len_args = True
    7154    arg_types = {"this": True, "expressions": False}

is_var_len_args = True
arg_types = {'this': True, 'expressions': False}
key = 'readcsv'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Reduce(Func): View Source

    7157class Reduce(Func):
    7158    arg_types = {"this": True, "initial": True, "merge": True, "finish": False}

arg_types = {'this': True, 'initial': True, 'merge': True, 'finish': False}
key = 'reduce'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class RegexpExtract(Func): View Source

    7161class RegexpExtract(Func):
    7162    arg_types = {
    7163        "this": True,
    7164        "expression": True,
    7165        "position": False,
    7166        "occurrence": False,
    7167        "parameters": False,
    7168        "group": False,
    7169    }

arg_types = {'this': True, 'expression': True, 'position': False, 'occurrence': False, 'parameters': False, 'group': False}
key = 'regexpextract'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class RegexpExtractAll(Func): View Source

    7172class RegexpExtractAll(Func):
    7173    arg_types = {
    7174        "this": True,
    7175        "expression": True,
    7176        "position": False,
    7177        "occurrence": False,
    7178        "parameters": False,
    7179        "group": False,
    7180    }

arg_types = {'this': True, 'expression': True, 'position': False, 'occurrence': False, 'parameters': False, 'group': False}
key = 'regexpextractall'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class RegexpReplace(Func): View Source

    7183class RegexpReplace(Func):
    7184    arg_types = {
    7185        "this": True,
    7186        "expression": True,
    7187        "replacement": False,
    7188        "position": False,
    7189        "occurrence": False,
    7190        "modifiers": False,
    7191    }

arg_types = {'this': True, 'expression': True, 'replacement': False, 'position': False, 'occurrence': False, 'modifiers': False}
key = 'regexpreplace'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class RegexpLike(Binary, Func): View Source

    7194class RegexpLike(Binary, Func):
    7195    arg_types = {"this": True, "expression": True, "flag": False}

arg_types = {'this': True, 'expression': True, 'flag': False}
key = 'regexplike'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class RegexpILike(Binary, Func): View Source

    7198class RegexpILike(Binary, Func):
    7199    arg_types = {"this": True, "expression": True, "flag": False}

arg_types = {'this': True, 'expression': True, 'flag': False}
key = 'regexpilike'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class RegexpInstr(Func): View Source

    7202class RegexpInstr(Func):
    7203    arg_types = {
    7204        "this": True,
    7205        "expression": True,
    7206        "position": False,
    7207        "occurrence": False,
    7208        "option": False,
    7209        "parameters": False,
    7210        "group": False,
    7211    }

arg_types = {'this': True, 'expression': True, 'position': False, 'occurrence': False, 'option': False, 'parameters': False, 'group': False}
key = 'regexpinstr'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class RegexpSplit(Func): View Source

    7216class RegexpSplit(Func):
    7217    arg_types = {"this": True, "expression": True, "limit": False}

arg_types = {'this': True, 'expression': True, 'limit': False}
key = 'regexpsplit'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Repeat(Func): View Source

    7220class Repeat(Func):
    7221    arg_types = {"this": True, "times": True}

arg_types = {'this': True, 'times': True}
key = 'repeat'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Replace(Func): View Source

    7225class Replace(Func):
    7226    arg_types = {"this": True, "expression": True, "replacement": False}

arg_types = {'this': True, 'expression': True, 'replacement': False}
key = 'replace'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Round(Func): View Source

    7231class Round(Func):
    7232    arg_types = {"this": True, "decimals": False, "truncate": False}

arg_types = {'this': True, 'decimals': False, 'truncate': False}
key = 'round'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class RowNumber(Func): View Source

    7235class RowNumber(Func):
    7236    arg_types = {"this": False}

arg_types = {'this': False}
key = 'rownumber'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SafeAdd(Func): View Source

    7239class SafeAdd(Func):
    7240    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'safeadd'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SafeDivide(Func): View Source

    7243class SafeDivide(Func):
    7244    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'safedivide'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SafeMultiply(Func): View Source

    7247class SafeMultiply(Func):
    7248    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'safemultiply'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SafeNegate(Func): View Source

    7251class SafeNegate(Func):
    7252    pass

key = 'safenegate'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SafeSubtract(Func): View Source

    7255class SafeSubtract(Func):
    7256    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'safesubtract'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SafeConvertBytesToString(Func): View Source

    7259class SafeConvertBytesToString(Func):
    7260    pass

key = 'safeconvertbytestostring'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SHA(Func): View Source

    7263class SHA(Func):
    7264    _sql_names = ["SHA", "SHA1"]

key = 'sha'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SHA2(Func): View Source

    7267class SHA2(Func):
    7268    _sql_names = ["SHA2"]
    7269    arg_types = {"this": True, "length": False}

arg_types = {'this': True, 'length': False}
key = 'sha2'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SHA1Digest(Func): View Source

    7273class SHA1Digest(Func):
    7274    pass

key = 'sha1digest'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SHA2Digest(Func): View Source

    7278class SHA2Digest(Func):
    7279    arg_types = {"this": True, "length": False}

arg_types = {'this': True, 'length': False}
key = 'sha2digest'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Sign(Func): View Source

    7282class Sign(Func):
    7283    _sql_names = ["SIGN", "SIGNUM"]

key = 'sign'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SortArray(Func): View Source

    7286class SortArray(Func):
    7287    arg_types = {"this": True, "asc": False, "nulls_first": False}

arg_types = {'this': True, 'asc': False, 'nulls_first': False}
key = 'sortarray'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Soundex(Func): View Source

    7290class Soundex(Func):
    7291    pass

key = 'soundex'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Split(Func): View Source

    7294class Split(Func):
    7295    arg_types = {"this": True, "expression": True, "limit": False}

arg_types = {'this': True, 'expression': True, 'limit': False}
key = 'split'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SplitPart(Func): View Source

    7299class SplitPart(Func):
    7300    arg_types = {"this": True, "delimiter": True, "part_index": True}

arg_types = {'this': True, 'delimiter': True, 'part_index': True}
key = 'splitpart'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Substring(Func): View Source

    7305class Substring(Func):
    7306    _sql_names = ["SUBSTRING", "SUBSTR"]
    7307    arg_types = {"this": True, "start": False, "length": False}

arg_types = {'this': True, 'start': False, 'length': False}
key = 'substring'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class SubstringIndex(Func): View Source

    7310class SubstringIndex(Func):
    7311    """
    7312    SUBSTRING_INDEX(str, delim, count)
    7313
    7314    *count* > 0  → left slice before the *count*-th delimiter
    7315    *count* < 0  → right slice after the |count|-th delimiter
    7316    """
    7317
    7318    arg_types = {"this": True, "delimiter": True, "count": True}

SUBSTRING_INDEX(str, delim, count)

count > 0 → left slice before the count-th delimiter count < 0 → right slice after the |count|-th delimiter

arg_types = {'this': True, 'delimiter': True, 'count': True}
key = 'substringindex'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StandardHash(Func): View Source

    7321class StandardHash(Func):
    7322    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'standardhash'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StartsWith(Func): View Source

    7325class StartsWith(Func):
    7326    _sql_names = ["STARTS_WITH", "STARTSWITH"]
    7327    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'startswith'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class EndsWith(Func): View Source

    7330class EndsWith(Func):
    7331    _sql_names = ["ENDS_WITH", "ENDSWITH"]
    7332    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'endswith'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StrPosition(Func): View Source

    7335class StrPosition(Func):
    7336    arg_types = {
    7337        "this": True,
    7338        "substr": True,
    7339        "position": False,
    7340        "occurrence": False,
    7341    }

arg_types = {'this': True, 'substr': True, 'position': False, 'occurrence': False}
key = 'strposition'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StrToDate(Func): View Source

    7344class StrToDate(Func):
    7345    arg_types = {"this": True, "format": False, "safe": False}

arg_types = {'this': True, 'format': False, 'safe': False}
key = 'strtodate'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StrToTime(Func): View Source

    7348class StrToTime(Func):
    7349    arg_types = {"this": True, "format": True, "zone": False, "safe": False}

arg_types = {'this': True, 'format': True, 'zone': False, 'safe': False}
key = 'strtotime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StrToUnix(Func): View Source

    7354class StrToUnix(Func):
    7355    arg_types = {"this": False, "format": False}

arg_types = {'this': False, 'format': False}
key = 'strtounix'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StrToMap(Func): View Source

    7360class StrToMap(Func):
    7361    arg_types = {
    7362        "this": True,
    7363        "pair_delim": False,
    7364        "key_value_delim": False,
    7365        "duplicate_resolution_callback": False,
    7366    }

arg_types = {'this': True, 'pair_delim': False, 'key_value_delim': False, 'duplicate_resolution_callback': False}
key = 'strtomap'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class NumberToStr(Func): View Source

    7369class NumberToStr(Func):
    7370    arg_types = {"this": True, "format": True, "culture": False}

arg_types = {'this': True, 'format': True, 'culture': False}
key = 'numbertostr'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class FromBase(Func): View Source

    7373class FromBase(Func):
    7374    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'frombase'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Space(Func): View Source

    7377class Space(Func):
    7378    """
    7379    SPACE(n) → string consisting of n blank characters
    7380    """
    7381
    7382    pass

SPACE(n) → string consisting of n blank characters

key = 'space'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Struct(Func): View Source

    7385class Struct(Func):
    7386    arg_types = {"expressions": False}
    7387    is_var_len_args = True

arg_types = {'expressions': False}
is_var_len_args = True
key = 'struct'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StructExtract(Func): View Source

    7390class StructExtract(Func):
    7391    arg_types = {"this": True, "expression": True}

arg_types = {'this': True, 'expression': True}
key = 'structextract'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Stuff(Func): View Source

    7396class Stuff(Func):
    7397    _sql_names = ["STUFF", "INSERT"]
    7398    arg_types = {"this": True, "start": True, "length": True, "expression": True}

arg_types = {'this': True, 'start': True, 'length': True, 'expression': True}
key = 'stuff'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Sum(AggFunc): View Source

    7401class Sum(AggFunc):
    7402    pass

key = 'sum'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Sqrt(Func): View Source

    7405class Sqrt(Func):
    7406    pass

key = 'sqrt'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Stddev(AggFunc): View Source

    7409class Stddev(AggFunc):
    7410    _sql_names = ["STDDEV", "STDEV"]

key = 'stddev'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StddevPop(AggFunc): View Source

    7413class StddevPop(AggFunc):
    7414    pass

key = 'stddevpop'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class StddevSamp(AggFunc): View Source

    7417class StddevSamp(AggFunc):
    7418    pass

key = 'stddevsamp'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Time(Func): View Source

    7422class Time(Func):
    7423    arg_types = {"this": False, "zone": False}

arg_types = {'this': False, 'zone': False}
key = 'time'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TimeToStr(Func): View Source

    7426class TimeToStr(Func):
    7427    arg_types = {"this": True, "format": True, "culture": False, "zone": False}

arg_types = {'this': True, 'format': True, 'culture': False, 'zone': False}
key = 'timetostr'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TimeToTimeStr(Func): View Source

    7430class TimeToTimeStr(Func):
    7431    pass

key = 'timetotimestr'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TimeToUnix(Func): View Source

    7434class TimeToUnix(Func):
    7435    pass

key = 'timetounix'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TimeStrToDate(Func): View Source

    7438class TimeStrToDate(Func):
    7439    pass

key = 'timestrtodate'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TimeStrToTime(Func): View Source

    7442class TimeStrToTime(Func):
    7443    arg_types = {"this": True, "zone": False}

arg_types = {'this': True, 'zone': False}
key = 'timestrtotime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TimeStrToUnix(Func): View Source

    7446class TimeStrToUnix(Func):
    7447    pass

key = 'timestrtounix'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Trim(Func): View Source

    7450class Trim(Func):
    7451    arg_types = {
    7452        "this": True,
    7453        "expression": False,
    7454        "position": False,
    7455        "collation": False,
    7456    }

arg_types = {'this': True, 'expression': False, 'position': False, 'collation': False}
key = 'trim'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TsOrDsAdd(Func, TimeUnit): View Source

    7459class TsOrDsAdd(Func, TimeUnit):
    7460    # return_type is used to correctly cast the arguments of this expression when transpiling it
    7461    arg_types = {"this": True, "expression": True, "unit": False, "return_type": False}
    7462
    7463    @property
    7464    def return_type(self) -> DataType:
    7465        return DataType.build(self.args.get("return_type") or DataType.Type.DATE)

arg_types = {'this': True, 'expression': True, 'unit': False, 'return_type': False}
return_type: DataType View Source

    7463    @property
    7464    def return_type(self) -> DataType:
    7465        return DataType.build(self.args.get("return_type") or DataType.Type.DATE)

key = 'tsordsadd'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TsOrDsDiff(Func, TimeUnit): View Source

    7468class TsOrDsDiff(Func, TimeUnit):
    7469    arg_types = {"this": True, "expression": True, "unit": False}

arg_types = {'this': True, 'expression': True, 'unit': False}
key = 'tsordsdiff'

##### Inherited Members

TimeUnit
  TimeUnit
  UNABBREVIATED_UNIT_NAME
  VAR_LIKE
  unit
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings
Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TsOrDsToDateStr(Func): View Source

    7472class TsOrDsToDateStr(Func):
    7473    pass

key = 'tsordstodatestr'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TsOrDsToDate(Func): View Source

    7476class TsOrDsToDate(Func):
    7477    arg_types = {"this": True, "format": False, "safe": False}

arg_types = {'this': True, 'format': False, 'safe': False}
key = 'tsordstodate'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TsOrDsToDatetime(Func): View Source

    7480class TsOrDsToDatetime(Func):
    7481    pass

key = 'tsordstodatetime'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TsOrDsToTime(Func): View Source

    7484class TsOrDsToTime(Func):
    7485    arg_types = {"this": True, "format": False, "safe": False}

arg_types = {'this': True, 'format': False, 'safe': False}
key = 'tsordstotime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TsOrDsToTimestamp(Func): View Source

    7488class TsOrDsToTimestamp(Func):
    7489    pass

key = 'tsordstotimestamp'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TsOrDiToDi(Func): View Source

    7492class TsOrDiToDi(Func):
    7493    pass

key = 'tsorditodi'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Unhex(Func): View Source

    7496class Unhex(Func):
    7497    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'unhex'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Unicode(Func): View Source

    7500class Unicode(Func):
    7501    pass

key = 'unicode'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class UnixDate(Func): View Source

    7505class UnixDate(Func):
    7506    pass

key = 'unixdate'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class UnixToStr(Func): View Source

    7509class UnixToStr(Func):
    7510    arg_types = {"this": True, "format": False}

arg_types = {'this': True, 'format': False}
key = 'unixtostr'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class UnixToTime(Func): View Source

    7515class UnixToTime(Func):
    7516    arg_types = {
    7517        "this": True,
    7518        "scale": False,
    7519        "zone": False,
    7520        "hours": False,
    7521        "minutes": False,
    7522        "format": False,
    7523    }
    7524
    7525    SECONDS = Literal.number(0)
    7526    DECIS = Literal.number(1)
    7527    CENTIS = Literal.number(2)
    7528    MILLIS = Literal.number(3)
    7529    DECIMILLIS = Literal.number(4)
    7530    CENTIMILLIS = Literal.number(5)
    7531    MICROS = Literal.number(6)
    7532    DECIMICROS = Literal.number(7)
    7533    CENTIMICROS = Literal.number(8)
    7534    NANOS = Literal.number(9)

arg_types = {'this': True, 'scale': False, 'zone': False, 'hours': False, 'minutes': False, 'format': False}
SECONDS = Literal(this=0, is_string=False)
DECIS = Literal(this=1, is_string=False)
CENTIS = Literal(this=2, is_string=False)
MILLIS = Literal(this=3, is_string=False)
DECIMILLIS = Literal(this=4, is_string=False)
CENTIMILLIS = Literal(this=5, is_string=False)
MICROS = Literal(this=6, is_string=False)
DECIMICROS = Literal(this=7, is_string=False)
CENTIMICROS = Literal(this=8, is_string=False)
NANOS = Literal(this=9, is_string=False)
key = 'unixtotime'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class UnixToTimeStr(Func): View Source

    7537class UnixToTimeStr(Func):
    7538    pass

key = 'unixtotimestr'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class UnixSeconds(Func): View Source

    7541class UnixSeconds(Func):
    7542    pass

key = 'unixseconds'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class UnixMicros(Func): View Source

    7545class UnixMicros(Func):
    7546    pass

key = 'unixmicros'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class UnixMillis(Func): View Source

    7549class UnixMillis(Func):
    7550    pass

key = 'unixmillis'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Uuid(Func): View Source

    7553class Uuid(Func):
    7554    _sql_names = ["UUID", "GEN_RANDOM_UUID", "GENERATE_UUID", "UUID_STRING"]
    7555
    7556    arg_types = {"this": False, "name": False}

arg_types = {'this': False, 'name': False}
key = 'uuid'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class TimestampFromParts(Func): View Source

    7559class TimestampFromParts(Func):
    7560    _sql_names = ["TIMESTAMP_FROM_PARTS", "TIMESTAMPFROMPARTS"]
    7561    arg_types = {
    7562        "year": True,
    7563        "month": True,
    7564        "day": True,
    7565        "hour": True,
    7566        "min": True,
    7567        "sec": True,
    7568        "nano": False,
    7569        "zone": False,
    7570        "milli": False,
    7571    }

arg_types = {'year': True, 'month': True, 'day': True, 'hour': True, 'min': True, 'sec': True, 'nano': False, 'zone': False, 'milli': False}
key = 'timestampfromparts'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Upper(Func): View Source

    7574class Upper(Func):
    7575    _sql_names = ["UPPER", "UCASE"]

key = 'upper'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Corr(Binary, AggFunc): View Source

    7578class Corr(Binary, AggFunc):
    7579    pass

key = 'corr'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CumeDist(AggFunc): View Source

    7583class CumeDist(AggFunc):
    7584    arg_types = {"expressions": False}
    7585    is_var_len_args = True

arg_types = {'expressions': False}
is_var_len_args = True
key = 'cumedist'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Variance(AggFunc): View Source

    7588class Variance(AggFunc):
    7589    _sql_names = ["VARIANCE", "VARIANCE_SAMP", "VAR_SAMP"]

key = 'variance'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class VariancePop(AggFunc): View Source

    7592class VariancePop(AggFunc):
    7593    _sql_names = ["VARIANCE_POP", "VAR_POP"]

key = 'variancepop'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CovarSamp(Binary, AggFunc): View Source

    7596class CovarSamp(Binary, AggFunc):
    7597    pass

key = 'covarsamp'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class CovarPop(Binary, AggFunc): View Source

    7600class CovarPop(Binary, AggFunc):
    7601    pass

key = 'covarpop'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Binary
  arg_types
  left
  right
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Week(Func): View Source

    7604class Week(Func):
    7605    arg_types = {"this": True, "mode": False}

arg_types = {'this': True, 'mode': False}
key = 'week'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class WeekStart(Expression): View Source

    7608class WeekStart(Expression):
    7609    pass

key = 'weekstart'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class XMLElement(Func): View Source

    7612class XMLElement(Func):
    7613    _sql_names = ["XMLELEMENT"]
    7614    arg_types = {"this": True, "expressions": False}

arg_types = {'this': True, 'expressions': False}
key = 'xmlelement'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class XMLTable(Func): View Source

    7617class XMLTable(Func):
    7618    arg_types = {
    7619        "this": True,
    7620        "namespaces": False,
    7621        "passing": False,
    7622        "columns": False,
    7623        "by_ref": False,
    7624    }

arg_types = {'this': True, 'namespaces': False, 'passing': False, 'columns': False, 'by_ref': False}
key = 'xmltable'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class XMLNamespace(Expression): View Source

    7627class XMLNamespace(Expression):
    7628    pass

key = 'xmlnamespace'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class XMLKeyValueOption(Expression): View Source

    7632class XMLKeyValueOption(Expression):
    7633    arg_types = {"this": True, "expression": False}

arg_types = {'this': True, 'expression': False}
key = 'xmlkeyvalueoption'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Year(Func): View Source

    7636class Year(Func):
    7637    pass

key = 'year'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Use(Expression): View Source

    7640class Use(Expression):
    7641    arg_types = {"this": False, "expressions": False, "kind": False}

arg_types = {'this': False, 'expressions': False, 'kind': False}
key = 'use'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Merge(DML): View Source

    7644class Merge(DML):
    7645    arg_types = {
    7646        "this": True,
    7647        "using": True,
    7648        "on": True,
    7649        "whens": True,
    7650        "with": False,
    7651        "returning": False,
    7652    }

arg_types = {'this': True, 'using': True, 'on': True, 'whens': True, 'with': False, 'returning': False}
key = 'merge'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
DML
  returning

class When(Expression): View Source

    7655class When(Expression):
    7656    arg_types = {"matched": True, "source": False, "condition": False, "then": True}

arg_types = {'matched': True, 'source': False, 'condition': False, 'then': True}
key = 'when'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class Whens(Expression): View Source

    7659class Whens(Expression):
    7660    """Wraps around one or more WHEN [NOT] MATCHED [...] clauses."""
    7661
    7662    arg_types = {"expressions": True}

Wraps around one or more WHEN [NOT] MATCHED [...] clauses.

arg_types = {'expressions': True}
key = 'whens'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class NextValueFor(Func): View Source

    7667class NextValueFor(Func):
    7668    arg_types = {"this": True, "order": False}

arg_types = {'this': True, 'order': False}
key = 'nextvaluefor'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc
Func
  is_var_len_args
  from_arg_list
  sql_names
  sql_name
  default_parser_mappings

class Semicolon(Expression): View Source

    7673class Semicolon(Expression):
    7674    arg_types = {}

arg_types = {}
key = 'semicolon'

##### Inherited Members

Expression
  Expression
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

class TableColumn(Expression): View Source

    7679class TableColumn(Expression):
    7680    pass

key = 'tablecolumn'

##### Inherited Members

Expression
  Expression
  arg_types
  args
  parent
  arg_key
  index
  comments
  hashable_args
  this
  expression
  expressions
  text
  is_string
  is_number
  to_py
  is_int
  is_star
  alias
  alias_column_names
  name
  alias_or_name
  output_name
  type
  is_type
  is_leaf
  meta
  copy
  add_comments
  pop_comments
  append
  set
  depth
  iter_expressions
  find
  find_all
  find_ancestor
  parent_select
  same_parent
  root
  walk
  dfs
  bfs
  unnest
  unalias
  unnest_operands
  flatten
  to_s
  sql
  transform
  replace
  pop
  assert_is
  error_messages
  dump
  load
  and_
  or_
  not_
  update_positions
  as_
  isin
  between
  is_
  like
  ilike
  eq
  neq
  rlike
  div
  asc
  desc

ALL_FUNCTIONS = [<class 'AIAgg'>, <class 'AIClassify'>, <class 'AISummarizeAgg'>, <class 'Abs'>, <class 'Acos'>, <class 'Acosh'>, <class 'AddMonths'>, <class 'And'>, <class 'AnonymousAggFunc'>, <class 'AnyValue'>, <class 'Apply'>, <class 'ApproxDistinct'>, <class 'ApproxQuantile'>, <class 'ApproxQuantiles'>, <class 'ApproxTopK'>, <class 'ApproxTopSum'>, <class 'ArgMax'>, <class 'ArgMin'>, <class 'Array'>, <class 'ArrayAgg'>, <class 'ArrayAll'>, <class 'ArrayAny'>, <class 'ArrayConcat'>, <class 'ArrayConcatAgg'>, <class 'ArrayConstructCompact'>, <class 'ArrayContains'>, <class 'ArrayContainsAll'>, <class 'ArrayFilter'>, <class 'ArrayFirst'>, <class 'ArrayIntersect'>, <class 'ArrayLast'>, <class 'ArrayOverlaps'>, <class 'ArrayRemove'>, <class 'ArrayReverse'>, <class 'ArraySize'>, <class 'ArraySlice'>, <class 'ArraySort'>, <class 'ArraySum'>, <class 'ArrayToString'>, <class 'ArrayUnionAgg'>, <class 'ArrayUniqueAgg'>, <class 'Ascii'>, <class 'Asin'>, <class 'Asinh'>, <class 'Atan'>, <class 'Atan2'>, <class 'Atanh'>, <class 'Avg'>, <class 'Base64DecodeBinary'>, <class 'Base64DecodeString'>, <class 'Base64Encode'>, <class 'BitLength'>, <class 'BitwiseAndAgg'>, <class 'BitwiseCountAgg'>, <class 'BitwiseOrAgg'>, <class 'BitwiseXorAgg'>, <class 'ByteLength'>, <class 'Case'>, <class 'Cast'>, <class 'CastToStrType'>, <class 'Cbrt'>, <class 'Ceil'>, <class 'Chr'>, <class 'Coalesce'>, <class 'CodePointsToBytes'>, <class 'CodePointsToString'>, <class 'Collate'>, <class 'Columns'>, <class 'CombinedAggFunc'>, <class 'CombinedParameterizedAgg'>, <class 'Compress'>, <class 'Concat'>, <class 'ConcatWs'>, <class 'ConnectByRoot'>, <class 'Contains'>, <class 'Convert'>, <class 'ConvertTimezone'>, <class 'ConvertToCharset'>, <class 'Corr'>, <class 'CosineDistance'>, <class 'Cot'>, <class 'Coth'>, <class 'Count'>, <class 'CountIf'>, <class 'CovarPop'>, <class 'CovarSamp'>, <class 'Csc'>, <class 'Csch'>, <class 'CumeDist'>, <class 'CurrentDate'>, <class 'CurrentDatetime'>, <class 'CurrentSchema'>, <class 'CurrentTime'>, <class 'CurrentTimestamp'>, <class 'CurrentTimestampLTZ'>, <class 'CurrentUser'>, <class 'Date'>, <class 'DateAdd'>, <class 'DateBin'>, <class 'DateDiff'>, <class 'DateFromParts'>, <class 'DateFromUnixDate'>, <class 'DateStrToDate'>, <class 'DateSub'>, <class 'DateToDateStr'>, <class 'DateToDi'>, <class 'DateTrunc'>, <class 'Datetime'>, <class 'DatetimeAdd'>, <class 'DatetimeDiff'>, <class 'DatetimeSub'>, <class 'DatetimeTrunc'>, <class 'Day'>, <class 'DayOfMonth'>, <class 'DayOfWeek'>, <class 'DayOfWeekIso'>, <class 'DayOfYear'>, <class 'Decode'>, <class 'DecodeCase'>, <class 'DenseRank'>, <class 'DiToDate'>, <class 'Encode'>, <class 'EndsWith'>, <class 'EuclideanDistance'>, <class 'Exists'>, <class 'Exp'>, <class 'Explode'>, <class 'ExplodeOuter'>, <class 'ExplodingGenerateSeries'>, <class 'Extract'>, <class 'FarmFingerprint'>, <class 'FeaturesAtTime'>, <class 'First'>, <class 'FirstValue'>, <class 'Flatten'>, <class 'Float64'>, <class 'Floor'>, <class 'Format'>, <class 'FromBase'>, <class 'FromBase32'>, <class 'FromBase64'>, <class 'FromISO8601Timestamp'>, <class 'GapFill'>, <class 'GenerateDateArray'>, <class 'GenerateEmbedding'>, <class 'GenerateSeries'>, <class 'GenerateTimestampArray'>, <class 'GetExtract'>, <class 'Greatest'>, <class 'GroupConcat'>, <class 'Grouping'>, <class 'Hex'>, <class 'HexDecodeString'>, <class 'HexEncode'>, <class 'Hll'>, <class 'If'>, <class 'Initcap'>, <class 'Inline'>, <class 'Int64'>, <class 'IsAscii'>, <class 'IsInf'>, <class 'IsNan'>, <class 'JSONArray'>, <class 'JSONArrayAgg'>, <class 'JSONArrayAppend'>, <class 'JSONArrayContains'>, <class 'JSONArrayInsert'>, <class 'JSONBContains'>, <class 'JSONBContainsAllTopKeys'>, <class 'JSONBContainsAnyTopKeys'>, <class 'JSONBDeleteAtPath'>, <class 'JSONBExists'>, <class 'JSONBExtract'>, <class 'JSONBExtractScalar'>, <class 'JSONBObjectAgg'>, <class 'JSONBool'>, <class 'JSONCast'>, <class 'JSONExists'>, <class 'JSONExtract'>, <class 'JSONExtractArray'>, <class 'JSONExtractScalar'>, <class 'JSONFormat'>, <class 'JSONKeysAtDepth'>, <class 'JSONObject'>, <class 'JSONObjectAgg'>, <class 'JSONRemove'>, <class 'JSONSet'>, <class 'JSONStripNulls'>, <class 'JSONTable'>, <class 'JSONType'>, <class 'JSONValueArray'>, <class 'JustifyDays'>, <class 'JustifyHours'>, <class 'JustifyInterval'>, <class 'Lag'>, <class 'Last'>, <class 'LastDay'>, <class 'LastValue'>, <class 'LaxBool'>, <class 'LaxFloat64'>, <class 'LaxInt64'>, <class 'LaxString'>, <class 'Lead'>, <class 'Least'>, <class 'Left'>, <class 'Length'>, <class 'Levenshtein'>, <class 'List'>, <class 'Ln'>, <class 'Log'>, <class 'LogicalAnd'>, <class 'LogicalOr'>, <class 'Lower'>, <class 'LowerHex'>, <class 'MD5'>, <class 'MD5Digest'>, <class 'MD5NumberLower64'>, <class 'MD5NumberUpper64'>, <class 'MLForecast'>, <class 'MLTranslate'>, <class 'MakeInterval'>, <class 'Map'>, <class 'MapFromEntries'>, <class 'MatchAgainst'>, <class 'Max'>, <class 'Median'>, <class 'Min'>, <class 'Month'>, <class 'MonthsBetween'>, <class 'NextValueFor'>, <class 'Normalize'>, <class 'NthValue'>, <class 'Ntile'>, <class 'Nullif'>, <class 'NumberToStr'>, <class 'Nvl2'>, <class 'ObjectInsert'>, <class 'OpenJSON'>, <class 'Or'>, <class 'Overlay'>, <class 'Pad'>, <class 'ParameterizedAgg'>, <class 'ParseBignumeric'>, <class 'ParseDatetime'>, <class 'ParseJSON'>, <class 'ParseNumeric'>, <class 'ParseTime'>, <class 'PercentRank'>, <class 'PercentileCont'>, <class 'PercentileDisc'>, <class 'Posexplode'>, <class 'PosexplodeOuter'>, <class 'Pow'>, <class 'Predict'>, <class 'Quantile'>, <class 'Quarter'>, <class 'Rand'>, <class 'Randn'>, <class 'RangeBucket'>, <class 'RangeN'>, <class 'Rank'>, <class 'ReadCSV'>, <class 'Reduce'>, <class 'RegexpExtract'>, <class 'RegexpExtractAll'>, <class 'RegexpILike'>, <class 'RegexpInstr'>, <class 'RegexpLike'>, <class 'RegexpReplace'>, <class 'RegexpSplit'>, <class 'Repeat'>, <class 'Replace'>, <class 'Reverse'>, <class 'Right'>, <class 'Round'>, <class 'RowNumber'>, <class 'SHA'>, <class 'SHA1Digest'>, <class 'SHA2'>, <class 'SHA2Digest'>, <class 'SafeAdd'>, <class 'SafeConvertBytesToString'>, <class 'SafeDivide'>, <class 'SafeMultiply'>, <class 'SafeNegate'>, <class 'SafeSubtract'>, <class 'Sec'>, <class 'Sech'>, <class 'Sign'>, <class 'Sin'>, <class 'Sinh'>, <class 'SortArray'>, <class 'Soundex'>, <class 'Space'>, <class 'Split'>, <class 'SplitPart'>, <class 'Sqrt'>, <class 'StDistance'>, <class 'StPoint'>, <class 'StandardHash'>, <class 'StarMap'>, <class 'StartsWith'>, <class 'Stddev'>, <class 'StddevPop'>, <class 'StddevSamp'>, <class 'StrPosition'>, <class 'StrToDate'>, <class 'StrToMap'>, <class 'StrToTime'>, <class 'StrToUnix'>, <class 'String'>, <class 'StringToArray'>, <class 'Struct'>, <class 'StructExtract'>, <class 'Stuff'>, <class 'Substring'>, <class 'SubstringIndex'>, <class 'Sum'>, <class 'Time'>, <class 'TimeAdd'>, <class 'TimeDiff'>, <class 'TimeFromParts'>, <class 'TimeStrToDate'>, <class 'TimeStrToTime'>, <class 'TimeStrToUnix'>, <class 'TimeSub'>, <class 'TimeToStr'>, <class 'TimeToTimeStr'>, <class 'TimeToUnix'>, <class 'TimeTrunc'>, <class 'Timestamp'>, <class 'TimestampAdd'>, <class 'TimestampDiff'>, <class 'TimestampFromParts'>, <class 'TimestampSub'>, <class 'TimestampTrunc'>, <class 'ToArray'>, <class 'ToBase32'>, <class 'ToBase64'>, <class 'ToChar'>, <class 'ToCodePoints'>, <class 'ToDays'>, <class 'ToDouble'>, <class 'ToMap'>, <class 'ToNumber'>, <class 'Transform'>, <class 'Translate'>, <class 'Trim'>, <class 'Try'>, <class 'TryCast'>, <class 'TsOrDiToDi'>, <class 'TsOrDsAdd'>, <class 'TsOrDsDiff'>, <class 'TsOrDsToDate'>, <class 'TsOrDsToDateStr'>, <class 'TsOrDsToDatetime'>, <class 'TsOrDsToTime'>, <class 'TsOrDsToTimestamp'>, <class 'Typeof'>, <class 'Unhex'>, <class 'Unicode'>, <class 'UnixDate'>, <class 'UnixMicros'>, <class 'UnixMillis'>, <class 'UnixSeconds'>, <class 'UnixToStr'>, <class 'UnixToTime'>, <class 'UnixToTimeStr'>, <class 'Unnest'>, <class 'Upper'>, <class 'UtcDate'>, <class 'UtcTime'>, <class 'UtcTimestamp'>, <class 'Uuid'>, <class 'VarMap'>, <class 'Variance'>, <class 'VariancePop'>, <class 'VectorSearch'>, <class 'Week'>, <class 'WeekOfYear'>, <class 'XMLElement'>, <class 'XMLTable'>, <class 'Xor'>, <class 'Year'>]
FUNCTION_BY_NAME = {'AI_AGG': <class 'AIAgg'>, 'AI_CLASSIFY': <class 'AIClassify'>, 'AI_SUMMARIZE_AGG': <class 'AISummarizeAgg'>, 'ABS': <class 'Abs'>, 'ACOS': <class 'Acos'>, 'ACOSH': <class 'Acosh'>, 'ADD_MONTHS': <class 'AddMonths'>, 'AND': <class 'And'>, 'ANONYMOUS_AGG_FUNC': <class 'AnonymousAggFunc'>, 'ANY_VALUE': <class 'AnyValue'>, 'APPLY': <class 'Apply'>, 'APPROX_DISTINCT': <class 'ApproxDistinct'>, 'APPROX_COUNT_DISTINCT': <class 'ApproxDistinct'>, 'APPROX_QUANTILE': <class 'ApproxQuantile'>, 'APPROX_QUANTILES': <class 'ApproxQuantiles'>, 'APPROX_TOP_K': <class 'ApproxTopK'>, 'APPROX_TOP_SUM': <class 'ApproxTopSum'>, 'ARG_MAX': <class 'ArgMax'>, 'ARGMAX': <class 'ArgMax'>, 'MAX_BY': <class 'ArgMax'>, 'ARG_MIN': <class 'ArgMin'>, 'ARGMIN': <class 'ArgMin'>, 'MIN_BY': <class 'ArgMin'>, 'ARRAY': <class 'Array'>, 'ARRAY_AGG': <class 'ArrayAgg'>, 'ARRAY_ALL': <class 'ArrayAll'>, 'ARRAY_ANY': <class 'ArrayAny'>, 'ARRAY_CONCAT': <class 'ArrayConcat'>, 'ARRAY_CAT': <class 'ArrayConcat'>, 'ARRAY_CONCAT_AGG': <class 'ArrayConcatAgg'>, 'ARRAY_CONSTRUCT_COMPACT': <class 'ArrayConstructCompact'>, 'ARRAY_CONTAINS': <class 'ArrayContains'>, 'ARRAY_HAS': <class 'ArrayContains'>, 'ARRAY_CONTAINS_ALL': <class 'ArrayContainsAll'>, 'ARRAY_HAS_ALL': <class 'ArrayContainsAll'>, 'FILTER': <class 'ArrayFilter'>, 'ARRAY_FILTER': <class 'ArrayFilter'>, 'ARRAY_FIRST': <class 'ArrayFirst'>, 'ARRAY_INTERSECT': <class 'ArrayIntersect'>, 'ARRAY_INTERSECTION': <class 'ArrayIntersect'>, 'ARRAY_LAST': <class 'ArrayLast'>, 'ARRAY_OVERLAPS': <class 'ArrayOverlaps'>, 'ARRAY_REMOVE': <class 'ArrayRemove'>, 'ARRAY_REVERSE': <class 'ArrayReverse'>, 'ARRAY_SIZE': <class 'ArraySize'>, 'ARRAY_LENGTH': <class 'ArraySize'>, 'ARRAY_SLICE': <class 'ArraySlice'>, 'ARRAY_SORT': <class 'ArraySort'>, 'ARRAY_SUM': <class 'ArraySum'>, 'ARRAY_TO_STRING': <class 'ArrayToString'>, 'ARRAY_JOIN': <class 'ArrayToString'>, 'ARRAY_UNION_AGG': <class 'ArrayUnionAgg'>, 'ARRAY_UNIQUE_AGG': <class 'ArrayUniqueAgg'>, 'ASCII': <class 'Ascii'>, 'ASIN': <class 'Asin'>, 'ASINH': <class 'Asinh'>, 'ATAN': <class 'Atan'>, 'ATAN2': <class 'Atan2'>, 'ATANH': <class 'Atanh'>, 'AVG': <class 'Avg'>, 'BASE64_DECODE_BINARY': <class 'Base64DecodeBinary'>, 'BASE64_DECODE_STRING': <class 'Base64DecodeString'>, 'BASE64_ENCODE': <class 'Base64Encode'>, 'BIT_LENGTH': <class 'BitLength'>, 'BITWISE_AND_AGG': <class 'BitwiseAndAgg'>, 'BITWISE_COUNT_AGG': <class 'BitwiseCountAgg'>, 'BITWISE_OR_AGG': <class 'BitwiseOrAgg'>, 'BITWISE_XOR_AGG': <class 'BitwiseXorAgg'>, 'BYTE_LENGTH': <class 'ByteLength'>, 'CASE': <class 'Case'>, 'CAST': <class 'Cast'>, 'CAST_TO_STR_TYPE': <class 'CastToStrType'>, 'CBRT': <class 'Cbrt'>, 'CEIL': <class 'Ceil'>, 'CEILING': <class 'Ceil'>, 'CHR': <class 'Chr'>, 'CHAR': <class 'Chr'>, 'COALESCE': <class 'Coalesce'>, 'IFNULL': <class 'Coalesce'>, 'NVL': <class 'Coalesce'>, 'CODE_POINTS_TO_BYTES': <class 'CodePointsToBytes'>, 'CODE_POINTS_TO_STRING': <class 'CodePointsToString'>, 'COLLATE': <class 'Collate'>, 'COLUMNS': <class 'Columns'>, 'COMBINED_AGG_FUNC': <class 'CombinedAggFunc'>, 'COMBINED_PARAMETERIZED_AGG': <class 'CombinedParameterizedAgg'>, 'COMPRESS': <class 'Compress'>, 'CONCAT': <class 'Concat'>, 'CONCAT_WS': <class 'ConcatWs'>, 'CONNECT_BY_ROOT': <class 'ConnectByRoot'>, 'CONTAINS': <class 'Contains'>, 'CONVERT': <class 'Convert'>, 'CONVERT_TIMEZONE': <class 'ConvertTimezone'>, 'CONVERT_TO_CHARSET': <class 'ConvertToCharset'>, 'CORR': <class 'Corr'>, 'COSINE_DISTANCE': <class 'CosineDistance'>, 'COT': <class 'Cot'>, 'COTH': <class 'Coth'>, 'COUNT': <class 'Count'>, 'COUNT_IF': <class 'CountIf'>, 'COUNTIF': <class 'CountIf'>, 'COVAR_POP': <class 'CovarPop'>, 'COVAR_SAMP': <class 'CovarSamp'>, 'CSC': <class 'Csc'>, 'CSCH': <class 'Csch'>, 'CUME_DIST': <class 'CumeDist'>, 'CURRENT_DATE': <class 'CurrentDate'>, 'CURRENT_DATETIME': <class 'CurrentDatetime'>, 'CURRENT_SCHEMA': <class 'CurrentSchema'>, 'CURRENT_TIME': <class 'CurrentTime'>, 'CURRENT_TIMESTAMP': <class 'CurrentTimestamp'>, 'CURRENT_TIMESTAMP_L_T_Z': <class 'CurrentTimestampLTZ'>, 'CURRENT_USER': <class 'CurrentUser'>, 'DATE': <class 'Date'>, 'DATE_ADD': <class 'DateAdd'>, 'DATE_BIN': <class 'DateBin'>, 'DATEDIFF': <class 'DateDiff'>, 'DATE_DIFF': <class 'DateDiff'>, 'DATE_FROM_PARTS': <class 'DateFromParts'>, 'DATEFROMPARTS': <class 'DateFromParts'>, 'DATE_FROM_UNIX_DATE': <class 'DateFromUnixDate'>, 'DATE_STR_TO_DATE': <class 'DateStrToDate'>, 'DATE_SUB': <class 'DateSub'>, 'DATE_TO_DATE_STR': <class 'DateToDateStr'>, 'DATE_TO_DI': <class 'DateToDi'>, 'DATE_TRUNC': <class 'DateTrunc'>, 'DATETIME': <class 'Datetime'>, 'DATETIME_ADD': <class 'DatetimeAdd'>, 'DATETIME_DIFF': <class 'DatetimeDiff'>, 'DATETIME_SUB': <class 'DatetimeSub'>, 'DATETIME_TRUNC': <class 'DatetimeTrunc'>, 'DAY': <class 'Day'>, 'DAY_OF_MONTH': <class 'DayOfMonth'>, 'DAYOFMONTH': <class 'DayOfMonth'>, 'DAY_OF_WEEK': <class 'DayOfWeek'>, 'DAYOFWEEK': <class 'DayOfWeek'>, 'DAYOFWEEK_ISO': <class 'DayOfWeekIso'>, 'ISODOW': <class 'DayOfWeekIso'>, 'DAY_OF_YEAR': <class 'DayOfYear'>, 'DAYOFYEAR': <class 'DayOfYear'>, 'DECODE': <class 'Decode'>, 'DECODE_CASE': <class 'DecodeCase'>, 'DENSE_RANK': <class 'DenseRank'>, 'DI_TO_DATE': <class 'DiToDate'>, 'ENCODE': <class 'Encode'>, 'ENDS_WITH': <class 'EndsWith'>, 'ENDSWITH': <class 'EndsWith'>, 'EUCLIDEAN_DISTANCE': <class 'EuclideanDistance'>, 'EXISTS': <class 'Exists'>, 'EXP': <class 'Exp'>, 'EXPLODE': <class 'Explode'>, 'EXPLODE_OUTER': <class 'ExplodeOuter'>, 'EXPLODING_GENERATE_SERIES': <class 'ExplodingGenerateSeries'>, 'EXTRACT': <class 'Extract'>, 'FARM_FINGERPRINT': <class 'FarmFingerprint'>, 'FARMFINGERPRINT64': <class 'FarmFingerprint'>, 'FEATURES_AT_TIME': <class 'FeaturesAtTime'>, 'FIRST': <class 'First'>, 'FIRST_VALUE': <class 'FirstValue'>, 'FLATTEN': <class 'Flatten'>, 'FLOAT64': <class 'Float64'>, 'FLOOR': <class 'Floor'>, 'FORMAT': <class 'Format'>, 'FROM_BASE': <class 'FromBase'>, 'FROM_BASE32': <class 'FromBase32'>, 'FROM_BASE64': <class 'FromBase64'>, 'FROM_ISO8601_TIMESTAMP': <class 'FromISO8601Timestamp'>, 'GAP_FILL': <class 'GapFill'>, 'GENERATE_DATE_ARRAY': <class 'GenerateDateArray'>, 'GENERATE_EMBEDDING': <class 'GenerateEmbedding'>, 'GENERATE_SERIES': <class 'GenerateSeries'>, 'GENERATE_TIMESTAMP_ARRAY': <class 'GenerateTimestampArray'>, 'GET_EXTRACT': <class 'GetExtract'>, 'GREATEST': <class 'Greatest'>, 'GROUP_CONCAT': <class 'GroupConcat'>, 'GROUPING': <class 'Grouping'>, 'HEX': <class 'Hex'>, 'HEX_DECODE_STRING': <class 'HexDecodeString'>, 'HEX_ENCODE': <class 'HexEncode'>, 'HLL': <class 'Hll'>, 'IF': <class 'If'>, 'IIF': <class 'If'>, 'INITCAP': <class 'Initcap'>, 'INLINE': <class 'Inline'>, 'INT64': <class 'Int64'>, 'IS_ASCII': <class 'IsAscii'>, 'IS_INF': <class 'IsInf'>, 'ISINF': <class 'IsInf'>, 'IS_NAN': <class 'IsNan'>, 'ISNAN': <class 'IsNan'>, 'J_S_O_N_ARRAY': <class 'JSONArray'>, 'J_S_O_N_ARRAY_AGG': <class 'JSONArrayAgg'>, 'JSON_ARRAY_APPEND': <class 'JSONArrayAppend'>, 'JSON_ARRAY_CONTAINS': <class 'JSONArrayContains'>, 'JSON_ARRAY_INSERT': <class 'JSONArrayInsert'>, 'JSONB_CONTAINS': <class 'JSONBContains'>, 'J_S_O_N_B_CONTAINS_ALL_TOP_KEYS': <class 'JSONBContainsAllTopKeys'>, 'J_S_O_N_B_CONTAINS_ANY_TOP_KEYS': <class 'JSONBContainsAnyTopKeys'>, 'J_S_O_N_B_DELETE_AT_PATH': <class 'JSONBDeleteAtPath'>, 'JSONB_EXISTS': <class 'JSONBExists'>, 'JSONB_EXTRACT': <class 'JSONBExtract'>, 'JSONB_EXTRACT_SCALAR': <class 'JSONBExtractScalar'>, 'J_S_O_N_B_OBJECT_AGG': <class 'JSONBObjectAgg'>, 'J_S_O_N_BOOL': <class 'JSONBool'>, 'J_S_O_N_CAST': <class 'JSONCast'>, 'J_S_O_N_EXISTS': <class 'JSONExists'>, 'JSON_EXTRACT': <class 'JSONExtract'>, 'JSON_EXTRACT_ARRAY': <class 'JSONExtractArray'>, 'JSON_EXTRACT_SCALAR': <class 'JSONExtractScalar'>, 'JSON_FORMAT': <class 'JSONFormat'>, 'J_S_O_N_KEYS_AT_DEPTH': <class 'JSONKeysAtDepth'>, 'J_S_O_N_OBJECT': <class 'JSONObject'>, 'J_S_O_N_OBJECT_AGG': <class 'JSONObjectAgg'>, 'JSON_REMOVE': <class 'JSONRemove'>, 'JSON_SET': <class 'JSONSet'>, 'JSON_STRIP_NULLS': <class 'JSONStripNulls'>, 'J_S_O_N_TABLE': <class 'JSONTable'>, 'JSON_TYPE': <class 'JSONType'>, 'J_S_O_N_VALUE_ARRAY': <class 'JSONValueArray'>, 'JUSTIFY_DAYS': <class 'JustifyDays'>, 'JUSTIFY_HOURS': <class 'JustifyHours'>, 'JUSTIFY_INTERVAL': <class 'JustifyInterval'>, 'LAG': <class 'Lag'>, 'LAST': <class 'Last'>, 'LAST_DAY': <class 'LastDay'>, 'LAST_DAY_OF_MONTH': <class 'LastDay'>, 'LAST_VALUE': <class 'LastValue'>, 'LAX_BOOL': <class 'LaxBool'>, 'LAX_FLOAT64': <class 'LaxFloat64'>, 'LAX_INT64': <class 'LaxInt64'>, 'LAX_STRING': <class 'LaxString'>, 'LEAD': <class 'Lead'>, 'LEAST': <class 'Least'>, 'LEFT': <class 'Left'>, 'LENGTH': <class 'Length'>, 'LEN': <class 'Length'>, 'CHAR_LENGTH': <class 'Length'>, 'CHARACTER_LENGTH': <class 'Length'>, 'LEVENSHTEIN': <class 'Levenshtein'>, 'LIST': <class 'List'>, 'LN': <class 'Ln'>, 'LOG': <class 'Log'>, 'LOGICAL_AND': <class 'LogicalAnd'>, 'BOOL_AND': <class 'LogicalAnd'>, 'BOOLAND_AGG': <class 'LogicalAnd'>, 'LOGICAL_OR': <class 'LogicalOr'>, 'BOOL_OR': <class 'LogicalOr'>, 'BOOLOR_AGG': <class 'LogicalOr'>, 'LOWER': <class 'Lower'>, 'LCASE': <class 'Lower'>, 'LOWER_HEX': <class 'LowerHex'>, 'MD5': <class 'MD5'>, 'MD5_DIGEST': <class 'MD5Digest'>, 'M_D5_NUMBER_LOWER64': <class 'MD5NumberLower64'>, 'M_D5_NUMBER_UPPER64': <class 'MD5NumberUpper64'>, 'M_L_FORECAST': <class 'MLForecast'>, 'M_L_TRANSLATE': <class 'MLTranslate'>, 'MAKE_INTERVAL': <class 'MakeInterval'>, 'MAP': <class 'Map'>, 'MAP_FROM_ENTRIES': <class 'MapFromEntries'>, 'MATCH_AGAINST': <class 'MatchAgainst'>, 'MAX': <class 'Max'>, 'MEDIAN': <class 'Median'>, 'MIN': <class 'Min'>, 'MONTH': <class 'Month'>, 'MONTHS_BETWEEN': <class 'MonthsBetween'>, 'NEXT_VALUE_FOR': <class 'NextValueFor'>, 'NORMALIZE': <class 'Normalize'>, 'NTH_VALUE': <class 'NthValue'>, 'NTILE': <class 'Ntile'>, 'NULLIF': <class 'Nullif'>, 'NUMBER_TO_STR': <class 'NumberToStr'>, 'NVL2': <class 'Nvl2'>, 'OBJECT_INSERT': <class 'ObjectInsert'>, 'OPEN_J_S_O_N': <class 'OpenJSON'>, 'OR': <class 'Or'>, 'OVERLAY': <class 'Overlay'>, 'PAD': <class 'Pad'>, 'PARAMETERIZED_AGG': <class 'ParameterizedAgg'>, 'PARSE_BIGNUMERIC': <class 'ParseBignumeric'>, 'PARSE_DATETIME': <class 'ParseDatetime'>, 'PARSE_JSON': <class 'ParseJSON'>, 'JSON_PARSE': <class 'ParseJSON'>, 'PARSE_NUMERIC': <class 'ParseNumeric'>, 'PARSE_TIME': <class 'ParseTime'>, 'PERCENT_RANK': <class 'PercentRank'>, 'PERCENTILE_CONT': <class 'PercentileCont'>, 'PERCENTILE_DISC': <class 'PercentileDisc'>, 'POSEXPLODE': <class 'Posexplode'>, 'POSEXPLODE_OUTER': <class 'PosexplodeOuter'>, 'POWER': <class 'Pow'>, 'POW': <class 'Pow'>, 'PREDICT': <class 'Predict'>, 'QUANTILE': <class 'Quantile'>, 'QUARTER': <class 'Quarter'>, 'RAND': <class 'Rand'>, 'RANDOM': <class 'Rand'>, 'RANDN': <class 'Randn'>, 'RANGE_BUCKET': <class 'RangeBucket'>, 'RANGE_N': <class 'RangeN'>, 'RANK': <class 'Rank'>, 'READ_CSV': <class 'ReadCSV'>, 'REDUCE': <class 'Reduce'>, 'REGEXP_EXTRACT': <class 'RegexpExtract'>, 'REGEXP_EXTRACT_ALL': <class 'RegexpExtractAll'>, 'REGEXP_I_LIKE': <class 'RegexpILike'>, 'REGEXP_INSTR': <class 'RegexpInstr'>, 'REGEXP_LIKE': <class 'RegexpLike'>, 'REGEXP_REPLACE': <class 'RegexpReplace'>, 'REGEXP_SPLIT': <class 'RegexpSplit'>, 'REPEAT': <class 'Repeat'>, 'REPLACE': <class 'Replace'>, 'REVERSE': <class 'Reverse'>, 'RIGHT': <class 'Right'>, 'ROUND': <class 'Round'>, 'ROW_NUMBER': <class 'RowNumber'>, 'SHA': <class 'SHA'>, 'SHA1': <class 'SHA'>, 'S_H_A1_DIGEST': <class 'SHA1Digest'>, 'SHA2': <class 'SHA2'>, 'S_H_A2_DIGEST': <class 'SHA2Digest'>, 'SAFE_ADD': <class 'SafeAdd'>, 'SAFE_CONVERT_BYTES_TO_STRING': <class 'SafeConvertBytesToString'>, 'SAFE_DIVIDE': <class 'SafeDivide'>, 'SAFE_MULTIPLY': <class 'SafeMultiply'>, 'SAFE_NEGATE': <class 'SafeNegate'>, 'SAFE_SUBTRACT': <class 'SafeSubtract'>, 'SEC': <class 'Sec'>, 'SECH': <class 'Sech'>, 'SIGN': <class 'Sign'>, 'SIGNUM': <class 'Sign'>, 'SIN': <class 'Sin'>, 'SINH': <class 'Sinh'>, 'SORT_ARRAY': <class 'SortArray'>, 'SOUNDEX': <class 'Soundex'>, 'SPACE': <class 'Space'>, 'SPLIT': <class 'Split'>, 'SPLIT_PART': <class 'SplitPart'>, 'SQRT': <class 'Sqrt'>, 'ST_DISTANCE': <class 'StDistance'>, 'ST_POINT': <class 'StPoint'>, 'ST_MAKEPOINT': <class 'StPoint'>, 'STANDARD_HASH': <class 'StandardHash'>, 'STAR_MAP': <class 'StarMap'>, 'STARTS_WITH': <class 'StartsWith'>, 'STARTSWITH': <class 'StartsWith'>, 'STDDEV': <class 'Stddev'>, 'STDEV': <class 'Stddev'>, 'STDDEV_POP': <class 'StddevPop'>, 'STDDEV_SAMP': <class 'StddevSamp'>, 'STR_POSITION': <class 'StrPosition'>, 'STR_TO_DATE': <class 'StrToDate'>, 'STR_TO_MAP': <class 'StrToMap'>, 'STR_TO_TIME': <class 'StrToTime'>, 'STR_TO_UNIX': <class 'StrToUnix'>, 'STRING': <class 'String'>, 'STRING_TO_ARRAY': <class 'StringToArray'>, 'SPLIT_BY_STRING': <class 'StringToArray'>, 'STRTOK_TO_ARRAY': <class 'StringToArray'>, 'STRUCT': <class 'Struct'>, 'STRUCT_EXTRACT': <class 'StructExtract'>, 'STUFF': <class 'Stuff'>, 'INSERT': <class 'Stuff'>, 'SUBSTRING': <class 'Substring'>, 'SUBSTR': <class 'Substring'>, 'SUBSTRING_INDEX': <class 'SubstringIndex'>, 'SUM': <class 'Sum'>, 'TIME': <class 'Time'>, 'TIME_ADD': <class 'TimeAdd'>, 'TIME_DIFF': <class 'TimeDiff'>, 'TIME_FROM_PARTS': <class 'TimeFromParts'>, 'TIMEFROMPARTS': <class 'TimeFromParts'>, 'TIME_STR_TO_DATE': <class 'TimeStrToDate'>, 'TIME_STR_TO_TIME': <class 'TimeStrToTime'>, 'TIME_STR_TO_UNIX': <class 'TimeStrToUnix'>, 'TIME_SUB': <class 'TimeSub'>, 'TIME_TO_STR': <class 'TimeToStr'>, 'TIME_TO_TIME_STR': <class 'TimeToTimeStr'>, 'TIME_TO_UNIX': <class 'TimeToUnix'>, 'TIME_TRUNC': <class 'TimeTrunc'>, 'TIMESTAMP': <class 'Timestamp'>, 'TIMESTAMP_ADD': <class 'TimestampAdd'>, 'TIMESTAMPDIFF': <class 'TimestampDiff'>, 'TIMESTAMP_DIFF': <class 'TimestampDiff'>, 'TIMESTAMP_FROM_PARTS': <class 'TimestampFromParts'>, 'TIMESTAMPFROMPARTS': <class 'TimestampFromParts'>, 'TIMESTAMP_SUB': <class 'TimestampSub'>, 'TIMESTAMP_TRUNC': <class 'TimestampTrunc'>, 'TO_ARRAY': <class 'ToArray'>, 'TO_BASE32': <class 'ToBase32'>, 'TO_BASE64': <class 'ToBase64'>, 'TO_CHAR': <class 'ToChar'>, 'TO_CODE_POINTS': <class 'ToCodePoints'>, 'TO_DAYS': <class 'ToDays'>, 'TO_DOUBLE': <class 'ToDouble'>, 'TO_MAP': <class 'ToMap'>, 'TO_NUMBER': <class 'ToNumber'>, 'TRANSFORM': <class 'Transform'>, 'TRANSLATE': <class 'Translate'>, 'TRIM': <class 'Trim'>, 'TRY': <class 'Try'>, 'TRY_CAST': <class 'TryCast'>, 'TS_OR_DI_TO_DI': <class 'TsOrDiToDi'>, 'TS_OR_DS_ADD': <class 'TsOrDsAdd'>, 'TS_OR_DS_DIFF': <class 'TsOrDsDiff'>, 'TS_OR_DS_TO_DATE': <class 'TsOrDsToDate'>, 'TS_OR_DS_TO_DATE_STR': <class 'TsOrDsToDateStr'>, 'TS_OR_DS_TO_DATETIME': <class 'TsOrDsToDatetime'>, 'TS_OR_DS_TO_TIME': <class 'TsOrDsToTime'>, 'TS_OR_DS_TO_TIMESTAMP': <class 'TsOrDsToTimestamp'>, 'TYPEOF': <class 'Typeof'>, 'UNHEX': <class 'Unhex'>, 'UNICODE': <class 'Unicode'>, 'UNIX_DATE': <class 'UnixDate'>, 'UNIX_MICROS': <class 'UnixMicros'>, 'UNIX_MILLIS': <class 'UnixMillis'>, 'UNIX_SECONDS': <class 'UnixSeconds'>, 'UNIX_TO_STR': <class 'UnixToStr'>, 'UNIX_TO_TIME': <class 'UnixToTime'>, 'UNIX_TO_TIME_STR': <class 'UnixToTimeStr'>, 'UNNEST': <class 'Unnest'>, 'UPPER': <class 'Upper'>, 'UCASE': <class 'Upper'>, 'UTC_DATE': <class 'UtcDate'>, 'UTC_TIME': <class 'UtcTime'>, 'UTC_TIMESTAMP': <class 'UtcTimestamp'>, 'UUID': <class 'Uuid'>, 'GEN_RANDOM_UUID': <class 'Uuid'>, 'GENERATE_UUID': <class 'Uuid'>, 'UUID_STRING': <class 'Uuid'>, 'VAR_MAP': <class 'VarMap'>, 'VARIANCE': <class 'Variance'>, 'VARIANCE_SAMP': <class 'Variance'>, 'VAR_SAMP': <class 'Variance'>, 'VARIANCE_POP': <class 'VariancePop'>, 'VAR_POP': <class 'VariancePop'>, 'VECTOR_SEARCH': <class 'VectorSearch'>, 'WEEK': <class 'Week'>, 'WEEK_OF_YEAR': <class 'WeekOfYear'>, 'WEEKOFYEAR': <class 'WeekOfYear'>, 'XMLELEMENT': <class 'XMLElement'>, 'X_M_L_TABLE': <class 'XMLTable'>, 'XOR': <class 'Xor'>, 'YEAR': <class 'Year'>}
JSON_PATH_PARTS = [<class 'JSONPathFilter'>, <class 'JSONPathKey'>, <class 'JSONPathRecursive'>, <class 'JSONPathRoot'>, <class 'JSONPathScript'>, <class 'JSONPathSelector'>, <class 'JSONPathSlice'>, <class 'JSONPathSubscript'>, <class 'JSONPathUnion'>, <class 'JSONPathWildcard'>]
PERCENTILES = (<class 'PercentileCont'>, <class 'PercentileDisc'>)
def maybe_parse( sql_or_expression: Union[str, Expression], *, into: Union[str, Type[Expression], Collection[Union[str, Type[Expression]]], NoneType] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, prefix: Optional[str] = None, copy: bool = False, **opts) -> Expression: View Source

    7720def maybe_parse(
    7721    sql_or_expression: ExpOrStr,
    7722    *,
    7723    into: t.Optional[IntoType] = None,
    7724    dialect: DialectType = None,
    7725    prefix: t.Optional[str] = None,
    7726    copy: bool = False,
    7727    **opts,
    7728) -> Expression:
    7729    """Gracefully handle a possible string or expression.
    7730
    7731    Example:
    7732        >>> maybe_parse("1")
    7733        Literal(this=1, is_string=False)
    7734        >>> maybe_parse(to_identifier("x"))
    7735        Identifier(this=x, quoted=False)
    7736
    7737    Args:
    7738        sql_or_expression: the SQL code string or an expression
    7739        into: the SQLGlot Expression to parse into
    7740        dialect: the dialect used to parse the input expressions (in the case that an
    7741            input expression is a SQL string).
    7742        prefix: a string to prefix the sql with before it gets parsed
    7743            (automatically includes a space)
    7744        copy: whether to copy the expression.
    7745        **opts: other options to use to parse the input expressions (again, in the case
    7746            that an input expression is a SQL string).
    7747
    7748    Returns:
    7749        Expression: the parsed or given expression.
    7750    """
    7751    if isinstance(sql_or_expression, Expression):
    7752        if copy:
    7753            return sql_or_expression.copy()
    7754        return sql_or_expression
    7755
    7756    if sql_or_expression is None:
    7757        raise ParseError("SQL cannot be None")
    7758
    7759    import sqlglot
    7760
    7761    sql = str(sql_or_expression)
    7762    if prefix:
    7763        sql = f"{prefix} {sql}"
    7764
    7765    return sqlglot.parse_one(sql, read=dialect, into=into, **opts)

Gracefully handle a possible string or expression.

###### Example:

>     >>> maybe_parse("1")
>     Literal(this=1, is_string=False)
>     >>> maybe_parse(to_identifier("x"))
>     Identifier(this=x, quoted=False)

###### Arguments:

- sql_or_expression: the SQL code string or an expression
- into: the SQLGlot Expression to parse into
- dialect: the dialect used to parse the input expressions (in the case that an input expression is a SQL string).
- prefix: a string to prefix the sql with before it gets parsed (automatically includes a space)
- copy: whether to copy the expression.
- **opts: other options to use to parse the input expressions (again, in the case that an input expression is a SQL string).

###### Returns:

> Expression: the parsed or given expression.

def maybe_copy(instance, copy=True): View Source

    7776def maybe_copy(instance, copy=True):
    7777    return instance.copy() if copy and instance else instance

def union( *expressions: Union[str, Expression], distinct: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Union: View Source

    8032def union(
    8033    *expressions: ExpOrStr,
    8034    distinct: bool = True,
    8035    dialect: DialectType = None,
    8036    copy: bool = True,
    8037    **opts,
    8038) -> Union:
    8039    """
    8040    Initializes a syntax tree for the `UNION` operation.
    8041
    8042    Example:
    8043        >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()
    8044        'SELECT * FROM foo UNION SELECT * FROM bla'
    8045
    8046    Args:
    8047        expressions: the SQL code strings, corresponding to the `UNION`'s operands.
    8048            If `Expression` instances are passed, they will be used as-is.
    8049        distinct: set the DISTINCT flag if and only if this is true.
    8050        dialect: the dialect used to parse the input expression.
    8051        copy: whether to copy the expression.
    8052        opts: other options to use to parse the input expressions.
    8053
    8054    Returns:
    8055        The new Union instance.
    8056    """
    8057    assert len(expressions) >= 2, "At least two expressions are required by `union`."
    8058    return _apply_set_operation(
    8059        *expressions, set_operation=Union, distinct=distinct, dialect=dialect, copy=copy, **opts
    8060    )

Initializes a syntax tree for the `UNION` operation.

###### Example:

>     >>> union("SELECT * FROM foo", "SELECT * FROM bla").sql()
>     'SELECT * FROM foo UNION SELECT * FROM bla'

###### Arguments:

- expressions: the SQL code strings, corresponding to the `UNION`'s operands. If `Expression` instances are passed, they will be used as-is.
- distinct: set the DISTINCT flag if and only if this is true.
- dialect: the dialect used to parse the input expression.
- copy: whether to copy the expression.
- opts: other options to use to parse the input expressions.

###### Returns:

> The new Union instance.

def intersect( *expressions: Union[str, Expression], distinct: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Intersect: View Source

    8063def intersect(
    8064    *expressions: ExpOrStr,
    8065    distinct: bool = True,
    8066    dialect: DialectType = None,
    8067    copy: bool = True,
    8068    **opts,
    8069) -> Intersect:
    8070    """
    8071    Initializes a syntax tree for the `INTERSECT` operation.
    8072
    8073    Example:
    8074        >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()
    8075        'SELECT * FROM foo INTERSECT SELECT * FROM bla'
    8076
    8077    Args:
    8078        expressions: the SQL code strings, corresponding to the `INTERSECT`'s operands.
    8079            If `Expression` instances are passed, they will be used as-is.
    8080        distinct: set the DISTINCT flag if and only if this is true.
    8081        dialect: the dialect used to parse the input expression.
    8082        copy: whether to copy the expression.
    8083        opts: other options to use to parse the input expressions.
    8084
    8085    Returns:
    8086        The new Intersect instance.
    8087    """
    8088    assert len(expressions) >= 2, "At least two expressions are required by `intersect`."
    8089    return _apply_set_operation(
    8090        *expressions, set_operation=Intersect, distinct=distinct, dialect=dialect, copy=copy, **opts
    8091    )

Initializes a syntax tree for the `INTERSECT` operation.

###### Example:

>     >>> intersect("SELECT * FROM foo", "SELECT * FROM bla").sql()
>     'SELECT * FROM foo INTERSECT SELECT * FROM bla'

###### Arguments:

- expressions: the SQL code strings, corresponding to the `INTERSECT`'s operands. If `Expression` instances are passed, they will be used as-is.
- distinct: set the DISTINCT flag if and only if this is true.
- dialect: the dialect used to parse the input expression.
- copy: whether to copy the expression.
- opts: other options to use to parse the input expressions.

###### Returns:

> The new Intersect instance.

def except_( *expressions: Union[str, Expression], distinct: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Except: View Source

    8094def except_(
    8095    *expressions: ExpOrStr,
    8096    distinct: bool = True,
    8097    dialect: DialectType = None,
    8098    copy: bool = True,
    8099    **opts,
    8100) -> Except:
    8101    """
    8102    Initializes a syntax tree for the `EXCEPT` operation.
    8103
    8104    Example:
    8105        >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()
    8106        'SELECT * FROM foo EXCEPT SELECT * FROM bla'
    8107
    8108    Args:
    8109        expressions: the SQL code strings, corresponding to the `EXCEPT`'s operands.
    8110            If `Expression` instances are passed, they will be used as-is.
    8111        distinct: set the DISTINCT flag if and only if this is true.
    8112        dialect: the dialect used to parse the input expression.
    8113        copy: whether to copy the expression.
    8114        opts: other options to use to parse the input expressions.
    8115
    8116    Returns:
    8117        The new Except instance.
    8118    """
    8119    assert len(expressions) >= 2, "At least two expressions are required by `except_`."
    8120    return _apply_set_operation(
    8121        *expressions, set_operation=Except, distinct=distinct, dialect=dialect, copy=copy, **opts
    8122    )

Initializes a syntax tree for the `EXCEPT` operation.

###### Example:

>     >>> except_("SELECT * FROM foo", "SELECT * FROM bla").sql()
>     'SELECT * FROM foo EXCEPT SELECT * FROM bla'

###### Arguments:

- expressions: the SQL code strings, corresponding to the `EXCEPT`'s operands. If `Expression` instances are passed, they will be used as-is.
- distinct: set the DISTINCT flag if and only if this is true.
- dialect: the dialect used to parse the input expression.
- copy: whether to copy the expression.
- opts: other options to use to parse the input expressions.

###### Returns:

> The new Except instance.

def select( *expressions: Union[str, Expression], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **opts) -> Select: View Source

    8125def select(*expressions: ExpOrStr, dialect: DialectType = None, **opts) -> Select:
    8126    """
    8127    Initializes a syntax tree from one or multiple SELECT expressions.
    8128
    8129    Example:
    8130        >>> select("col1", "col2").from_("tbl").sql()
    8131        'SELECT col1, col2 FROM tbl'
    8132
    8133    Args:
    8134        *expressions: the SQL code string to parse as the expressions of a
    8135            SELECT statement. If an Expression instance is passed, this is used as-is.
    8136        dialect: the dialect used to parse the input expressions (in the case that an
    8137            input expression is a SQL string).
    8138        **opts: other options to use to parse the input expressions (again, in the case
    8139            that an input expression is a SQL string).
    8140
    8141    Returns:
    8142        Select: the syntax tree for the SELECT statement.
    8143    """
    8144    return Select().select(*expressions, dialect=dialect, **opts)

Initializes a syntax tree from one or multiple SELECT expressions.

###### Example:

>     >>> select("col1", "col2").from_("tbl").sql()
>     'SELECT col1, col2 FROM tbl'

###### Arguments:

- *expressions: the SQL code string to parse as the expressions of a SELECT statement. If an Expression instance is passed, this is used as-is.
- dialect: the dialect used to parse the input expressions (in the case that an input expression is a SQL string).
- **opts: other options to use to parse the input expressions (again, in the case that an input expression is a SQL string).

###### Returns:

> Select: the syntax tree for the SELECT statement.

def from_( expression: Union[str, Expression], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **opts) -> Select: View Source

    8147def from_(expression: ExpOrStr, dialect: DialectType = None, **opts) -> Select:
    8148    """
    8149    Initializes a syntax tree from a FROM expression.
    8150
    8151    Example:
    8152        >>> from_("tbl").select("col1", "col2").sql()
    8153        'SELECT col1, col2 FROM tbl'
    8154
    8155    Args:
    8156        *expression: the SQL code string to parse as the FROM expressions of a
    8157            SELECT statement. If an Expression instance is passed, this is used as-is.
    8158        dialect: the dialect used to parse the input expression (in the case that the
    8159            input expression is a SQL string).
    8160        **opts: other options to use to parse the input expressions (again, in the case
    8161            that the input expression is a SQL string).
    8162
    8163    Returns:
    8164        Select: the syntax tree for the SELECT statement.
    8165    """
    8166    return Select().from_(expression, dialect=dialect, **opts)

Initializes a syntax tree from a FROM expression.

###### Example:

>     >>> from_("tbl").select("col1", "col2").sql()
>     'SELECT col1, col2 FROM tbl'

###### Arguments:

- *expression: the SQL code string to parse as the FROM expressions of a SELECT statement. If an Expression instance is passed, this is used as-is.
- dialect: the dialect used to parse the input expression (in the case that the input expression is a SQL string).
- **opts: other options to use to parse the input expressions (again, in the case that the input expression is a SQL string).

###### Returns:

> Select: the syntax tree for the SELECT statement.

def update( table: str | Table, properties: Optional[dict] = None, where: Union[str, Expression, NoneType] = None, from_: Union[str, Expression, NoneType] = None, with_: Optional[Dict[str, Union[str, Expression]]] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **opts) -> Update: View Source

    8169def update(
    8170    table: str | Table,
    8171    properties: t.Optional[dict] = None,
    8172    where: t.Optional[ExpOrStr] = None,
    8173    from_: t.Optional[ExpOrStr] = None,
    8174    with_: t.Optional[t.Dict[str, ExpOrStr]] = None,
    8175    dialect: DialectType = None,
    8176    **opts,
    8177) -> Update:
    8178    """
    8179    Creates an update statement.
    8180
    8181    Example:
    8182        >>> update("my_table", {"x": 1, "y": "2", "z": None}, from_="baz_cte", where="baz_cte.id > 1 and my_table.id = baz_cte.id", with_={"baz_cte": "SELECT id FROM foo"}).sql()
    8183        "WITH baz_cte AS (SELECT id FROM foo) UPDATE my_table SET x = 1, y = '2', z = NULL FROM baz_cte WHERE baz_cte.id > 1 AND my_table.id = baz_cte.id"
    8184
    8185    Args:
    8186        properties: dictionary of properties to SET which are
    8187            auto converted to sql objects eg None -> NULL
    8188        where: sql conditional parsed into a WHERE statement
    8189        from_: sql statement parsed into a FROM statement
    8190        with_: dictionary of CTE aliases / select statements to include in a WITH clause.
    8191        dialect: the dialect used to parse the input expressions.
    8192        **opts: other options to use to parse the input expressions.
    8193
    8194    Returns:
    8195        Update: the syntax tree for the UPDATE statement.
    8196    """
    8197    update_expr = Update(this=maybe_parse(table, into=Table, dialect=dialect))
    8198    if properties:
    8199        update_expr.set(
    8200            "expressions",
    8201            [
    8202                EQ(this=maybe_parse(k, dialect=dialect, **opts), expression=convert(v))
    8203                for k, v in properties.items()
    8204            ],
    8205        )
    8206    if from_:
    8207        update_expr.set(
    8208            "from",
    8209            maybe_parse(from_, into=From, dialect=dialect, prefix="FROM", **opts),
    8210        )
    8211    if isinstance(where, Condition):
    8212        where = Where(this=where)
    8213    if where:
    8214        update_expr.set(
    8215            "where",
    8216            maybe_parse(where, into=Where, dialect=dialect, prefix="WHERE", **opts),
    8217        )
    8218    if with_:
    8219        cte_list = [
    8220            alias_(CTE(this=maybe_parse(qry, dialect=dialect, **opts)), alias, table=True)
    8221            for alias, qry in with_.items()
    8222        ]
    8223        update_expr.set(
    8224            "with",
    8225            With(expressions=cte_list),
    8226        )
    8227    return update_expr

Creates an update statement.

###### Example:

>     >>> update("my_table", {"x": 1, "y": "2", "z": None}, from_="baz_cte", where="baz_cte.id > 1 and my_table.id = baz_cte.id", with_={"baz_cte": "SELECT id FROM foo"}).sql()
>     "WITH baz_cte AS (SELECT id FROM foo) UPDATE my_table SET x = 1, y = '2', z = NULL FROM baz_cte WHERE baz_cte.id > 1 AND my_table.id = baz_cte.id"

###### Arguments:

- properties: dictionary of properties to SET which are auto converted to sql objects eg None -> NULL
- where: sql conditional parsed into a WHERE statement
- from_: sql statement parsed into a FROM statement
- with_: dictionary of CTE aliases / select statements to include in a WITH clause.
- dialect: the dialect used to parse the input expressions.
- **opts: other options to use to parse the input expressions.

###### Returns:

> Update: the syntax tree for the UPDATE statement.

def delete( table: Union[str, Expression], where: Union[str, Expression, NoneType] = None, returning: Union[str, Expression, NoneType] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **opts) -> Delete: View Source

    8230def delete(
    8231    table: ExpOrStr,
    8232    where: t.Optional[ExpOrStr] = None,
    8233    returning: t.Optional[ExpOrStr] = None,
    8234    dialect: DialectType = None,
    8235    **opts,
    8236) -> Delete:
    8237    """
    8238    Builds a delete statement.
    8239
    8240    Example:
    8241        >>> delete("my_table", where="id > 1").sql()
    8242        'DELETE FROM my_table WHERE id > 1'
    8243
    8244    Args:
    8245        where: sql conditional parsed into a WHERE statement
    8246        returning: sql conditional parsed into a RETURNING statement
    8247        dialect: the dialect used to parse the input expressions.
    8248        **opts: other options to use to parse the input expressions.
    8249
    8250    Returns:
    8251        Delete: the syntax tree for the DELETE statement.
    8252    """
    8253    delete_expr = Delete().delete(table, dialect=dialect, copy=False, **opts)
    8254    if where:
    8255        delete_expr = delete_expr.where(where, dialect=dialect, copy=False, **opts)
    8256    if returning:
    8257        delete_expr = delete_expr.returning(returning, dialect=dialect, copy=False, **opts)
    8258    return delete_expr

Builds a delete statement.

###### Example:

>     >>> delete("my_table", where="id > 1").sql()
>     'DELETE FROM my_table WHERE id > 1'

###### Arguments:

- where: sql conditional parsed into a WHERE statement
- returning: sql conditional parsed into a RETURNING statement
- dialect: the dialect used to parse the input expressions.
- **opts: other options to use to parse the input expressions.

###### Returns:

> Delete: the syntax tree for the DELETE statement.

def insert( expression: Union[str, Expression], into: Union[str, Expression], columns: Optional[Sequence[str | Identifier]] = None, overwrite: Optional[bool] = None, returning: Union[str, Expression, NoneType] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Insert: View Source

    8261def insert(
    8262    expression: ExpOrStr,
    8263    into: ExpOrStr,
    8264    columns: t.Optional[t.Sequence[str | Identifier]] = None,
    8265    overwrite: t.Optional[bool] = None,
    8266    returning: t.Optional[ExpOrStr] = None,
    8267    dialect: DialectType = None,
    8268    copy: bool = True,
    8269    **opts,
    8270) -> Insert:
    8271    """
    8272    Builds an INSERT statement.
    8273
    8274    Example:
    8275        >>> insert("VALUES (1, 2, 3)", "tbl").sql()
    8276        'INSERT INTO tbl VALUES (1, 2, 3)'
    8277
    8278    Args:
    8279        expression: the sql string or expression of the INSERT statement
    8280        into: the tbl to insert data to.
    8281        columns: optionally the table's column names.
    8282        overwrite: whether to INSERT OVERWRITE or not.
    8283        returning: sql conditional parsed into a RETURNING statement
    8284        dialect: the dialect used to parse the input expressions.
    8285        copy: whether to copy the expression.
    8286        **opts: other options to use to parse the input expressions.
    8287
    8288    Returns:
    8289        Insert: the syntax tree for the INSERT statement.
    8290    """
    8291    expr = maybe_parse(expression, dialect=dialect, copy=copy, **opts)
    8292    this: Table | Schema = maybe_parse(into, into=Table, dialect=dialect, copy=copy, **opts)
    8293
    8294    if columns:
    8295        this = Schema(this=this, expressions=[to_identifier(c, copy=copy) for c in columns])
    8296
    8297    insert = Insert(this=this, expression=expr, overwrite=overwrite)
    8298
    8299    if returning:
    8300        insert = insert.returning(returning, dialect=dialect, copy=False, **opts)
    8301
    8302    return insert

Builds an INSERT statement.

###### Example:

>     >>> insert("VALUES (1, 2, 3)", "tbl").sql()
>     'INSERT INTO tbl VALUES (1, 2, 3)'

###### Arguments:

- expression: the sql string or expression of the INSERT statement
- into: the tbl to insert data to.
- columns: optionally the table's column names.
- overwrite: whether to INSERT OVERWRITE or not.
- returning: sql conditional parsed into a RETURNING statement
- dialect: the dialect used to parse the input expressions.
- copy: whether to copy the expression.
- **opts: other options to use to parse the input expressions.

###### Returns:

> Insert: the syntax tree for the INSERT statement.

def merge( *when_exprs: Union[str, Expression], into: Union[str, Expression], using: Union[str, Expression], on: Union[str, Expression], returning: Union[str, Expression, NoneType] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Merge: View Source

    8305def merge(
    8306    *when_exprs: ExpOrStr,
    8307    into: ExpOrStr,
    8308    using: ExpOrStr,
    8309    on: ExpOrStr,
    8310    returning: t.Optional[ExpOrStr] = None,
    8311    dialect: DialectType = None,
    8312    copy: bool = True,
    8313    **opts,
    8314) -> Merge:
    8315    """
    8316    Builds a MERGE statement.
    8317
    8318    Example:
    8319        >>> merge("WHEN MATCHED THEN UPDATE SET col1 = source_table.col1",
    8320        ...       "WHEN NOT MATCHED THEN INSERT (col1) VALUES (source_table.col1)",
    8321        ...       into="my_table",
    8322        ...       using="source_table",
    8323        ...       on="my_table.id = source_table.id").sql()
    8324        'MERGE INTO my_table USING source_table ON my_table.id = source_table.id WHEN MATCHED THEN UPDATE SET col1 = source_table.col1 WHEN NOT MATCHED THEN INSERT (col1) VALUES (source_table.col1)'
    8325
    8326    Args:
    8327        *when_exprs: The WHEN clauses specifying actions for matched and unmatched rows.
    8328        into: The target table to merge data into.
    8329        using: The source table to merge data from.
    8330        on: The join condition for the merge.
    8331        returning: The columns to return from the merge.
    8332        dialect: The dialect used to parse the input expressions.
    8333        copy: Whether to copy the expression.
    8334        **opts: Other options to use to parse the input expressions.
    8335
    8336    Returns:
    8337        Merge: The syntax tree for the MERGE statement.
    8338    """
    8339    expressions: t.List[Expression] = []
    8340    for when_expr in when_exprs:
    8341        expression = maybe_parse(when_expr, dialect=dialect, copy=copy, into=Whens, **opts)
    8342        expressions.extend([expression] if isinstance(expression, When) else expression.expressions)
    8343
    8344    merge = Merge(
    8345        this=maybe_parse(into, dialect=dialect, copy=copy, **opts),
    8346        using=maybe_parse(using, dialect=dialect, copy=copy, **opts),
    8347        on=maybe_parse(on, dialect=dialect, copy=copy, **opts),
    8348        whens=Whens(expressions=expressions),
    8349    )
    8350    if returning:
    8351        merge = merge.returning(returning, dialect=dialect, copy=False, **opts)
    8352
    8353    if isinstance(using_clause := merge.args.get("using"), Alias):
    8354        using_clause.replace(alias_(using_clause.this, using_clause.args["alias"], table=True))
    8355
    8356    return merge

Builds a MERGE statement.

###### Example:

>     >>> merge("WHEN MATCHED THEN UPDATE SET col1 = source_table.col1",
>     ...       "WHEN NOT MATCHED THEN INSERT (col1) VALUES (source_table.col1)",
>     ...       into="my_table",
>     ...       using="source_table",
>     ...       on="my_table.id = source_table.id").sql()
>     'MERGE INTO my_table USING source_table ON my_table.id = source_table.id WHEN MATCHED THEN UPDATE SET col1 = source_table.col1 WHEN NOT MATCHED THEN INSERT (col1) VALUES (source_table.col1)'

###### Arguments:

- *when_exprs: The WHEN clauses specifying actions for matched and unmatched rows.
- into: The target table to merge data into.
- using: The source table to merge data from.
- on: The join condition for the merge.
- returning: The columns to return from the merge.
- dialect: The dialect used to parse the input expressions.
- copy: Whether to copy the expression.
- **opts: Other options to use to parse the input expressions.

###### Returns:

> Merge: The syntax tree for the MERGE statement.

def condition( expression: Union[str, Expression], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Condition: View Source

    8359def condition(
    8360    expression: ExpOrStr, dialect: DialectType = None, copy: bool = True, **opts
    8361) -> Condition:
    8362    """
    8363    Initialize a logical condition expression.
    8364
    8365    Example:
    8366        >>> condition("x=1").sql()
    8367        'x = 1'
    8368
    8369        This is helpful for composing larger logical syntax trees:
    8370        >>> where = condition("x=1")
    8371        >>> where = where.and_("y=1")
    8372        >>> Select().from_("tbl").select("*").where(where).sql()
    8373        'SELECT * FROM tbl WHERE x = 1 AND y = 1'
    8374
    8375    Args:
    8376        *expression: the SQL code string to parse.
    8377            If an Expression instance is passed, this is used as-is.
    8378        dialect: the dialect used to parse the input expression (in the case that the
    8379            input expression is a SQL string).
    8380        copy: Whether to copy `expression` (only applies to expressions).
    8381        **opts: other options to use to parse the input expressions (again, in the case
    8382            that the input expression is a SQL string).
    8383
    8384    Returns:
    8385        The new Condition instance
    8386    """
    8387    return maybe_parse(
    8388        expression,
    8389        into=Condition,
    8390        dialect=dialect,
    8391        copy=copy,
    8392        **opts,
    8393    )

Initialize a logical condition expression.

###### Example:

>     >>> condition("x=1").sql()
>     'x = 1'

> This is helpful for composing larger logical syntax trees:

>     >>> where = condition("x=1")
>     >>> where = where.and_("y=1")
>     >>> Select().from_("tbl").select("*").where(where).sql()
>     'SELECT * FROM tbl WHERE x = 1 AND y = 1'

###### Arguments:

- *expression: the SQL code string to parse. If an Expression instance is passed, this is used as-is.
- dialect: the dialect used to parse the input expression (in the case that the input expression is a SQL string).
- copy: Whether to copy `expression` (only applies to expressions).
- **opts: other options to use to parse the input expressions (again, in the case that the input expression is a SQL string).

###### Returns:

> The new Condition instance

def and_( *expressions: Union[str, Expression, NoneType], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, wrap: bool = True, **opts) -> Condition: View Source

    8396def and_(
    8397    *expressions: t.Optional[ExpOrStr],
    8398    dialect: DialectType = None,
    8399    copy: bool = True,
    8400    wrap: bool = True,
    8401    **opts,
    8402) -> Condition:
    8403    """
    8404    Combine multiple conditions with an AND logical operator.
    8405
    8406    Example:
    8407        >>> and_("x=1", and_("y=1", "z=1")).sql()
    8408        'x = 1 AND (y = 1 AND z = 1)'
    8409
    8410    Args:
    8411        *expressions: the SQL code strings to parse.
    8412            If an Expression instance is passed, this is used as-is.
    8413        dialect: the dialect used to parse the input expression.
    8414        copy: whether to copy `expressions` (only applies to Expressions).
    8415        wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
    8416            precedence issues, but can be turned off when the produced AST is too deep and
    8417            causes recursion-related issues.
    8418        **opts: other options to use to parse the input expressions.
    8419
    8420    Returns:
    8421        The new condition
    8422    """
    8423    return t.cast(Condition, _combine(expressions, And, dialect, copy=copy, wrap=wrap, **opts))

Combine multiple conditions with an AND logical operator.

###### Example:

>     >>> and_("x=1", and_("y=1", "z=1")).sql()
>     'x = 1 AND (y = 1 AND z = 1)'

###### Arguments:

- *expressions: the SQL code strings to parse. If an Expression instance is passed, this is used as-is.
- dialect: the dialect used to parse the input expression.
- copy: whether to copy `expressions` (only applies to Expressions).
- wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid precedence issues, but can be turned off when the produced AST is too deep and causes recursion-related issues.
- **opts: other options to use to parse the input expressions.

###### Returns:

> The new condition

def or_( *expressions: Union[str, Expression, NoneType], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, wrap: bool = True, **opts) -> Condition: View Source

    8426def or_(
    8427    *expressions: t.Optional[ExpOrStr],
    8428    dialect: DialectType = None,
    8429    copy: bool = True,
    8430    wrap: bool = True,
    8431    **opts,
    8432) -> Condition:
    8433    """
    8434    Combine multiple conditions with an OR logical operator.
    8435
    8436    Example:
    8437        >>> or_("x=1", or_("y=1", "z=1")).sql()
    8438        'x = 1 OR (y = 1 OR z = 1)'
    8439
    8440    Args:
    8441        *expressions: the SQL code strings to parse.
    8442            If an Expression instance is passed, this is used as-is.
    8443        dialect: the dialect used to parse the input expression.
    8444        copy: whether to copy `expressions` (only applies to Expressions).
    8445        wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
    8446            precedence issues, but can be turned off when the produced AST is too deep and
    8447            causes recursion-related issues.
    8448        **opts: other options to use to parse the input expressions.
    8449
    8450    Returns:
    8451        The new condition
    8452    """
    8453    return t.cast(Condition, _combine(expressions, Or, dialect, copy=copy, wrap=wrap, **opts))

Combine multiple conditions with an OR logical operator.

###### Example:

>     >>> or_("x=1", or_("y=1", "z=1")).sql()
>     'x = 1 OR (y = 1 OR z = 1)'

###### Arguments:

- *expressions: the SQL code strings to parse. If an Expression instance is passed, this is used as-is.
- dialect: the dialect used to parse the input expression.
- copy: whether to copy `expressions` (only applies to Expressions).
- wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid precedence issues, but can be turned off when the produced AST is too deep and causes recursion-related issues.
- **opts: other options to use to parse the input expressions.

###### Returns:

> The new condition

def xor( *expressions: Union[str, Expression, NoneType], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, wrap: bool = True, **opts) -> Condition: View Source

    8456def xor(
    8457    *expressions: t.Optional[ExpOrStr],
    8458    dialect: DialectType = None,
    8459    copy: bool = True,
    8460    wrap: bool = True,
    8461    **opts,
    8462) -> Condition:
    8463    """
    8464    Combine multiple conditions with an XOR logical operator.
    8465
    8466    Example:
    8467        >>> xor("x=1", xor("y=1", "z=1")).sql()
    8468        'x = 1 XOR (y = 1 XOR z = 1)'
    8469
    8470    Args:
    8471        *expressions: the SQL code strings to parse.
    8472            If an Expression instance is passed, this is used as-is.
    8473        dialect: the dialect used to parse the input expression.
    8474        copy: whether to copy `expressions` (only applies to Expressions).
    8475        wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid
    8476            precedence issues, but can be turned off when the produced AST is too deep and
    8477            causes recursion-related issues.
    8478        **opts: other options to use to parse the input expressions.
    8479
    8480    Returns:
    8481        The new condition
    8482    """
    8483    return t.cast(Condition, _combine(expressions, Xor, dialect, copy=copy, wrap=wrap, **opts))

Combine multiple conditions with an XOR logical operator.

###### Example:

>     >>> xor("x=1", xor("y=1", "z=1")).sql()
>     'x = 1 XOR (y = 1 XOR z = 1)'

###### Arguments:

- *expressions: the SQL code strings to parse. If an Expression instance is passed, this is used as-is.
- dialect: the dialect used to parse the input expression.
- copy: whether to copy `expressions` (only applies to Expressions).
- wrap: whether to wrap the operands in `Paren`s. This is true by default to avoid precedence issues, but can be turned off when the produced AST is too deep and causes recursion-related issues.
- **opts: other options to use to parse the input expressions.

###### Returns:

> The new condition

def not_( expression: Union[str, Expression], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts) -> Not: View Source

    8486def not_(expression: ExpOrStr, dialect: DialectType = None, copy: bool = True, **opts) -> Not:
    8487    """
    8488    Wrap a condition with a NOT operator.
    8489
    8490    Example:
    8491        >>> not_("this_suit='black'").sql()
    8492        "NOT this_suit = 'black'"
    8493
    8494    Args:
    8495        expression: the SQL code string to parse.
    8496            If an Expression instance is passed, this is used as-is.
    8497        dialect: the dialect used to parse the input expression.
    8498        copy: whether to copy the expression or not.
    8499        **opts: other options to use to parse the input expressions.
    8500
    8501    Returns:
    8502        The new condition.
    8503    """
    8504    this = condition(
    8505        expression,
    8506        dialect=dialect,
    8507        copy=copy,
    8508        **opts,
    8509    )
    8510    return Not(this=_wrap(this, Connector))

Wrap a condition with a NOT operator.

###### Example:

>     >>> not_("this_suit='black'").sql()
>     "NOT this_suit = 'black'"

###### Arguments:

- expression: the SQL code string to parse. If an Expression instance is passed, this is used as-is.
- dialect: the dialect used to parse the input expression.
- copy: whether to copy the expression or not.
- **opts: other options to use to parse the input expressions.

###### Returns:

> The new condition.

def paren( expression: Union[str, Expression], copy: bool = True) -> Paren: View Source

    8513def paren(expression: ExpOrStr, copy: bool = True) -> Paren:
    8514    """
    8515    Wrap an expression in parentheses.
    8516
    8517    Example:
    8518        >>> paren("5 + 3").sql()
    8519        '(5 + 3)'
    8520
    8521    Args:
    8522        expression: the SQL code string to parse.
    8523            If an Expression instance is passed, this is used as-is.
    8524        copy: whether to copy the expression or not.
    8525
    8526    Returns:
    8527        The wrapped expression.
    8528    """
    8529    return Paren(this=maybe_parse(expression, copy=copy))

Wrap an expression in parentheses.

###### Example:

>     >>> paren("5 + 3").sql()
>     '(5 + 3)'

###### Arguments:

- expression: the SQL code string to parse. If an Expression instance is passed, this is used as-is.
- copy: whether to copy the expression or not.

###### Returns:

> The wrapped expression.

SAFE_IDENTIFIER_RE: Pattern[str] = re.compile('^[_a-zA-Z][\\w]*$')
def to_identifier(name, quoted=None, copy=True): View Source

    8545def to_identifier(name, quoted=None, copy=True):
    8546    """Builds an identifier.
    8547
    8548    Args:
    8549        name: The name to turn into an identifier.
    8550        quoted: Whether to force quote the identifier.
    8551        copy: Whether to copy name if it's an Identifier.
    8552
    8553    Returns:
    8554        The identifier ast node.
    8555    """
    8556
    8557    if name is None:
    8558        return None
    8559
    8560    if isinstance(name, Identifier):
    8561        identifier = maybe_copy(name, copy)
    8562    elif isinstance(name, str):
    8563        identifier = Identifier(
    8564            this=name,
    8565            quoted=not SAFE_IDENTIFIER_RE.match(name) if quoted is None else quoted,
    8566        )
    8567    else:
    8568        raise ValueError(f"Name needs to be a string or an Identifier, got: {name.__class__}")
    8569    return identifier

Builds an identifier.

###### Arguments:

- name: The name to turn into an identifier.
- quoted: Whether to force quote the identifier.
- copy: Whether to copy name if it's an Identifier.

###### Returns:

> The identifier ast node.

def parse_identifier( name: str | Identifier, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None) -> Identifier: View Source

    8572def parse_identifier(name: str | Identifier, dialect: DialectType = None) -> Identifier:
    8573    """
    8574    Parses a given string into an identifier.
    8575
    8576    Args:
    8577        name: The name to parse into an identifier.
    8578        dialect: The dialect to parse against.
    8579
    8580    Returns:
    8581        The identifier ast node.
    8582    """
    8583    try:
    8584        expression = maybe_parse(name, dialect=dialect, into=Identifier)
    8585    except (ParseError, TokenError):
    8586        expression = to_identifier(name)
    8587
    8588    return expression

Parses a given string into an identifier.

###### Arguments:

- name: The name to parse into an identifier.
- dialect: The dialect to parse against.

###### Returns:

> The identifier ast node.

INTERVAL_STRING_RE = re.compile('\\s*(-?[0-9]+(?:\\.[0-9]+)?)\\s*([a-zA-Z]+)\\s*')
INTERVAL_DAY_TIME_RE = re.compile('\\s*-?\\s*\\d+(?:\\.\\d+)?\\s+(?:-?(?:\\d+:)?\\d+:\\d+(?:\\.\\d+)?|-?(?:\\d+:){1,2}|:)\\s*')
def to_interval( interval: str | Literal) -> Interval: View Source

    8607def to_interval(interval: str | Literal) -> Interval:
    8608    """Builds an interval expression from a string like '1 day' or '5 months'."""
    8609    if isinstance(interval, Literal):
    8610        if not interval.is_string:
    8611            raise ValueError("Invalid interval string.")
    8612
    8613        interval = interval.this
    8614
    8615    interval = maybe_parse(f"INTERVAL {interval}")
    8616    assert isinstance(interval, Interval)
    8617    return interval

Builds an interval expression from a string like '1 day' or '5 months'.

def to_table( sql_path: str | Table, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **kwargs) -> Table: View Source

    8620def to_table(
    8621    sql_path: str | Table, dialect: DialectType = None, copy: bool = True, **kwargs
    8622) -> Table:
    8623    """
    8624    Create a table expression from a `[catalog].[schema].[table]` sql path. Catalog and schema are optional.
    8625    If a table is passed in then that table is returned.
    8626
    8627    Args:
    8628        sql_path: a `[catalog].[schema].[table]` string.
    8629        dialect: the source dialect according to which the table name will be parsed.
    8630        copy: Whether to copy a table if it is passed in.
    8631        kwargs: the kwargs to instantiate the resulting `Table` expression with.
    8632
    8633    Returns:
    8634        A table expression.
    8635    """
    8636    if isinstance(sql_path, Table):
    8637        return maybe_copy(sql_path, copy=copy)
    8638
    8639    try:
    8640        table = maybe_parse(sql_path, into=Table, dialect=dialect)
    8641    except ParseError:
    8642        catalog, db, this = split_num_words(sql_path, ".", 3)
    8643
    8644        if not this:
    8645            raise
    8646
    8647        table = table_(this, db=db, catalog=catalog)
    8648
    8649    for k, v in kwargs.items():
    8650        table.set(k, v)
    8651
    8652    return table

Create a table expression from a `[catalog].[schema].[table]` sql path. Catalog and schema are optional. If a table is passed in then that table is returned.

###### Arguments:

- sql_path: a `[catalog].[schema].[table]` string.
- dialect: the source dialect according to which the table name will be parsed.
- copy: Whether to copy a table if it is passed in.
- kwargs: the kwargs to instantiate the resulting `Table` expression with.

###### Returns:

> A table expression.

def to_column( sql_path: str | Column, quoted: Optional[bool] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **kwargs) -> Column: View Source

    8655def to_column(
    8656    sql_path: str | Column,
    8657    quoted: t.Optional[bool] = None,
    8658    dialect: DialectType = None,
    8659    copy: bool = True,
    8660    **kwargs,
    8661) -> Column:
    8662    """
    8663    Create a column from a `[table].[column]` sql path. Table is optional.
    8664    If a column is passed in then that column is returned.
    8665
    8666    Args:
    8667        sql_path: a `[table].[column]` string.
    8668        quoted: Whether or not to force quote identifiers.
    8669        dialect: the source dialect according to which the column name will be parsed.
    8670        copy: Whether to copy a column if it is passed in.
    8671        kwargs: the kwargs to instantiate the resulting `Column` expression with.
    8672
    8673    Returns:
    8674        A column expression.
    8675    """
    8676    if isinstance(sql_path, Column):
    8677        return maybe_copy(sql_path, copy=copy)
    8678
    8679    try:
    8680        col = maybe_parse(sql_path, into=Column, dialect=dialect)
    8681    except ParseError:
    8682        return column(*reversed(sql_path.split(".")), quoted=quoted, **kwargs)
    8683
    8684    for k, v in kwargs.items():
    8685        col.set(k, v)
    8686
    8687    if quoted:
    8688        for i in col.find_all(Identifier):
    8689            i.set("quoted", True)
    8690
    8691    return col

Create a column from a `[table].[column]` sql path. Table is optional. If a column is passed in then that column is returned.

###### Arguments:

- sql_path: a `[table].[column]` string.
- quoted: Whether or not to force quote identifiers.
- dialect: the source dialect according to which the column name will be parsed.
- copy: Whether to copy a column if it is passed in.
- kwargs: the kwargs to instantiate the resulting `Column` expression with.

###### Returns:

> A column expression.

def alias_( expression: Union[str, Expression], alias: Union[Identifier, str, NoneType], table: Union[bool, Sequence[str | Identifier]] = False, quoted: Optional[bool] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True, **opts): View Source

    8694def alias_(
    8695    expression: ExpOrStr,
    8696    alias: t.Optional[str | Identifier],
    8697    table: bool | t.Sequence[str | Identifier] = False,
    8698    quoted: t.Optional[bool] = None,
    8699    dialect: DialectType = None,
    8700    copy: bool = True,
    8701    **opts,
    8702):
    8703    """Create an Alias expression.
    8704
    8705    Example:
    8706        >>> alias_('foo', 'bar').sql()
    8707        'foo AS bar'
    8708
    8709        >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()
    8710        '(SELECT 1, 2) AS bar(a, b)'
    8711
    8712    Args:
    8713        expression: the SQL code strings to parse.
    8714            If an Expression instance is passed, this is used as-is.
    8715        alias: the alias name to use. If the name has
    8716            special characters it is quoted.
    8717        table: Whether to create a table alias, can also be a list of columns.
    8718        quoted: whether to quote the alias
    8719        dialect: the dialect used to parse the input expression.
    8720        copy: Whether to copy the expression.
    8721        **opts: other options to use to parse the input expressions.
    8722
    8723    Returns:
    8724        Alias: the aliased expression
    8725    """
    8726    exp = maybe_parse(expression, dialect=dialect, copy=copy, **opts)
    8727    alias = to_identifier(alias, quoted=quoted)
    8728
    8729    if table:
    8730        table_alias = TableAlias(this=alias)
    8731        exp.set("alias", table_alias)
    8732
    8733        if not isinstance(table, bool):
    8734            for column in table:
    8735                table_alias.append("columns", to_identifier(column, quoted=quoted))
    8736
    8737        return exp
    8738
    8739    # We don't set the "alias" arg for Window expressions, because that would add an IDENTIFIER node in
    8740    # the AST, representing a "named_window" [1] construct (eg. bigquery). What we want is an ALIAS node
    8741    # for the complete Window expression.
    8742    #
    8743    # [1]: https://cloud.google.com/bigquery/docs/reference/standard-sql/window-function-calls
    8744
    8745    if "alias" in exp.arg_types and not isinstance(exp, Window):
    8746        exp.set("alias", alias)
    8747        return exp
    8748    return Alias(this=exp, alias=alias)

Create an Alias expression.

###### Example:

>     >>> alias_('foo', 'bar').sql()
>     'foo AS bar'

>     >>> alias_('(select 1, 2)', 'bar', table=['a', 'b']).sql()
>     '(SELECT 1, 2) AS bar(a, b)'

###### Arguments:

- expression: the SQL code strings to parse. If an Expression instance is passed, this is used as-is.
- alias: the alias name to use. If the name has special characters it is quoted.
- table: Whether to create a table alias, can also be a list of columns.
- quoted: whether to quote the alias
- dialect: the dialect used to parse the input expression.
- copy: Whether to copy the expression.
- **opts: other options to use to parse the input expressions.

###### Returns:

> Alias: the aliased expression

def subquery( expression: Union[str, Expression], alias: Union[Identifier, str, NoneType] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **opts) -> Select: View Source

    8751def subquery(
    8752    expression: ExpOrStr,
    8753    alias: t.Optional[Identifier | str] = None,
    8754    dialect: DialectType = None,
    8755    **opts,
    8756) -> Select:
    8757    """
    8758    Build a subquery expression that's selected from.
    8759
    8760    Example:
    8761        >>> subquery('select x from tbl', 'bar').select('x').sql()
    8762        'SELECT x FROM (SELECT x FROM tbl) AS bar'
    8763
    8764    Args:
    8765        expression: the SQL code strings to parse.
    8766            If an Expression instance is passed, this is used as-is.
    8767        alias: the alias name to use.
    8768        dialect: the dialect used to parse the input expression.
    8769        **opts: other options to use to parse the input expressions.
    8770
    8771    Returns:
    8772        A new Select instance with the subquery expression included.
    8773    """
    8774
    8775    expression = maybe_parse(expression, dialect=dialect, **opts).subquery(alias, **opts)
    8776    return Select().from_(expression, dialect=dialect, **opts)

Build a subquery expression that's selected from.

###### Example:

>     >>> subquery('select x from tbl', 'bar').select('x').sql()
>     'SELECT x FROM (SELECT x FROM tbl) AS bar'

###### Arguments:

- expression: the SQL code strings to parse. If an Expression instance is passed, this is used as-is.
- alias: the alias name to use.
- dialect: the dialect used to parse the input expression.
- **opts: other options to use to parse the input expressions.

###### Returns:

> A new Select instance with the subquery expression included.

def column( col, table=None, db=None, catalog=None, *, fields=None, quoted=None, copy=True): View Source

    8807def column(
    8808    col,
    8809    table=None,
    8810    db=None,
    8811    catalog=None,
    8812    *,
    8813    fields=None,
    8814    quoted=None,
    8815    copy=True,
    8816):
    8817    """
    8818    Build a Column.
    8819
    8820    Args:
    8821        col: Column name.
    8822        table: Table name.
    8823        db: Database name.
    8824        catalog: Catalog name.
    8825        fields: Additional fields using dots.
    8826        quoted: Whether to force quotes on the column's identifiers.
    8827        copy: Whether to copy identifiers if passed in.
    8828
    8829    Returns:
    8830        The new Column instance.
    8831    """
    8832    if not isinstance(col, Star):
    8833        col = to_identifier(col, quoted=quoted, copy=copy)
    8834
    8835    this = Column(
    8836        this=col,
    8837        table=to_identifier(table, quoted=quoted, copy=copy),
    8838        db=to_identifier(db, quoted=quoted, copy=copy),
    8839        catalog=to_identifier(catalog, quoted=quoted, copy=copy),
    8840    )
    8841
    8842    if fields:
    8843        this = Dot.build(
    8844            (this, *(to_identifier(field, quoted=quoted, copy=copy) for field in fields))
    8845        )
    8846    return this

Build a Column.

###### Arguments:

- col: Column name.
- table: Table name.
- db: Database name.
- catalog: Catalog name.
- fields: Additional fields using dots.
- quoted: Whether to force quotes on the column's identifiers.
- copy: Whether to copy identifiers if passed in.

###### Returns:

> The new Column instance.

def cast( expression: Union[str, Expression], to: Union[str, Identifier, Dot, DataType, DataType.Type], copy: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **opts) -> Cast: View Source

    8849def cast(
    8850    expression: ExpOrStr, to: DATA_TYPE, copy: bool = True, dialect: DialectType = None, **opts
    8851) -> Cast:
    8852    """Cast an expression to a data type.
    8853
    8854    Example:
    8855        >>> cast('x + 1', 'int').sql()
    8856        'CAST(x + 1 AS INT)'
    8857
    8858    Args:
    8859        expression: The expression to cast.
    8860        to: The datatype to cast to.
    8861        copy: Whether to copy the supplied expressions.
    8862        dialect: The target dialect. This is used to prevent a re-cast in the following scenario:
    8863            - The expression to be cast is already a exp.Cast expression
    8864            - The existing cast is to a type that is logically equivalent to new type
    8865
    8866            For example, if :expression='CAST(x as DATETIME)' and :to=Type.TIMESTAMP,
    8867            but in the target dialect DATETIME is mapped to TIMESTAMP, then we will NOT return `CAST(x (as DATETIME) as TIMESTAMP)`
    8868            and instead just return the original expression `CAST(x as DATETIME)`.
    8869
    8870            This is to prevent it being output as a double cast `CAST(x (as TIMESTAMP) as TIMESTAMP)` once the DATETIME -> TIMESTAMP
    8871            mapping is applied in the target dialect generator.
    8872
    8873    Returns:
    8874        The new Cast instance.
    8875    """
    8876    expr = maybe_parse(expression, copy=copy, dialect=dialect, **opts)
    8877    data_type = DataType.build(to, copy=copy, dialect=dialect, **opts)
    8878
    8879    # dont re-cast if the expression is already a cast to the correct type
    8880    if isinstance(expr, Cast):
    8881        from sqlglot.dialects.dialect import Dialect
    8882
    8883        target_dialect = Dialect.get_or_raise(dialect)
    8884        type_mapping = target_dialect.generator_class.TYPE_MAPPING
    8885
    8886        existing_cast_type: DataType.Type = expr.to.this
    8887        new_cast_type: DataType.Type = data_type.this
    8888        types_are_equivalent = type_mapping.get(
    8889            existing_cast_type, existing_cast_type.value
    8890        ) == type_mapping.get(new_cast_type, new_cast_type.value)
    8891
    8892        if expr.is_type(data_type) or types_are_equivalent:
    8893            return expr
    8894
    8895    expr = Cast(this=expr, to=data_type)
    8896    expr.type = data_type
    8897
    8898    return expr

Cast an expression to a data type.

###### Example:

>     >>> cast('x + 1', 'int').sql()
>     'CAST(x + 1 AS INT)'

###### Arguments:

- expression: The expression to cast.
- to: The datatype to cast to.
- copy: Whether to copy the supplied expressions.

- dialect: The target dialect. This is used to prevent a re-cast in the following scenario:

  - The expression to be cast is already a exp.Cast expression
  - The existing cast is to a type that is logically equivalent to new type

  For example, if :expression='CAST(x as DATETIME)' and :to=Type.TIMESTAMP, but in the target dialect DATETIME is mapped to TIMESTAMP, then we will NOT return `CAST(x (as DATETIME) as TIMESTAMP)` and instead just return the original expression `CAST(x as DATETIME)`.

  This is to prevent it being output as a double cast `CAST(x (as TIMESTAMP) as TIMESTAMP)` once the DATETIME -> TIMESTAMP mapping is applied in the target dialect generator.

###### Returns:

> The new Cast instance.

def table_( table: Identifier | str, db: Union[Identifier, str, NoneType] = None, catalog: Union[Identifier, str, NoneType] = None, quoted: Optional[bool] = None, alias: Union[Identifier, str, NoneType] = None) -> Table: View Source

    8901def table_(
    8902    table: Identifier | str,
    8903    db: t.Optional[Identifier | str] = None,
    8904    catalog: t.Optional[Identifier | str] = None,
    8905    quoted: t.Optional[bool] = None,
    8906    alias: t.Optional[Identifier | str] = None,
    8907) -> Table:
    8908    """Build a Table.
    8909
    8910    Args:
    8911        table: Table name.
    8912        db: Database name.
    8913        catalog: Catalog name.
    8914        quote: Whether to force quotes on the table's identifiers.
    8915        alias: Table's alias.
    8916
    8917    Returns:
    8918        The new Table instance.
    8919    """
    8920    return Table(
    8921        this=to_identifier(table, quoted=quoted) if table else None,
    8922        db=to_identifier(db, quoted=quoted) if db else None,
    8923        catalog=to_identifier(catalog, quoted=quoted) if catalog else None,
    8924        alias=TableAlias(this=to_identifier(alias)) if alias else None,
    8925    )

Build a Table.

###### Arguments:

- table: Table name.
- db: Database name.
- catalog: Catalog name.
- quote: Whether to force quotes on the table's identifiers.
- alias: Table's alias.

###### Returns:

> The new Table instance.

def values( values: Iterable[Tuple[Any, ...]], alias: Optional[str] = None, columns: Union[Iterable[str], Dict[str, DataType], NoneType] = None) -> Values: View Source

    8928def values(
    8929    values: t.Iterable[t.Tuple[t.Any, ...]],
    8930    alias: t.Optional[str] = None,
    8931    columns: t.Optional[t.Iterable[str] | t.Dict[str, DataType]] = None,
    8932) -> Values:
    8933    """Build VALUES statement.
    8934
    8935    Example:
    8936        >>> values([(1, '2')]).sql()
    8937        "VALUES (1, '2')"
    8938
    8939    Args:
    8940        values: values statements that will be converted to SQL
    8941        alias: optional alias
    8942        columns: Optional list of ordered column names or ordered dictionary of column names to types.
    8943         If either are provided then an alias is also required.
    8944
    8945    Returns:
    8946        Values: the Values expression object
    8947    """
    8948    if columns and not alias:
    8949        raise ValueError("Alias is required when providing columns")
    8950
    8951    return Values(
    8952        expressions=[convert(tup) for tup in values],
    8953        alias=(
    8954            TableAlias(this=to_identifier(alias), columns=[to_identifier(x) for x in columns])
    8955            if columns
    8956            else (TableAlias(this=to_identifier(alias)) if alias else None)
    8957        ),
    8958    )

Build VALUES statement.

###### Example:

>     >>> values([(1, '2')]).sql()
>     "VALUES (1, '2')"

###### Arguments:

- values: values statements that will be converted to SQL
- alias: optional alias
- columns: Optional list of ordered column names or ordered dictionary of column names to types. If either are provided then an alias is also required.

###### Returns:

> Values: the Values expression object

def var( name: Union[str, Expression, NoneType]) -> Var: View Source

    8961def var(name: t.Optional[ExpOrStr]) -> Var:
    8962    """Build a SQL variable.
    8963
    8964    Example:
    8965        >>> repr(var('x'))
    8966        'Var(this=x)'
    8967
    8968        >>> repr(var(column('x', table='y')))
    8969        'Var(this=x)'
    8970
    8971    Args:
    8972        name: The name of the var or an expression who's name will become the var.
    8973
    8974    Returns:
    8975        The new variable node.
    8976    """
    8977    if not name:
    8978        raise ValueError("Cannot convert empty name into var.")
    8979
    8980    if isinstance(name, Expression):
    8981        name = name.name
    8982    return Var(this=name)

Build a SQL variable.

###### Example:

>     >>> repr(var('x'))
>     'Var(this=x)'

>     >>> repr(var(column('x', table='y')))
>     'Var(this=x)'

###### Arguments:

- name: The name of the var or an expression who's name will become the var.

###### Returns:

> The new variable node.

def rename_table( old_name: str | Table, new_name: str | Table, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None) -> Alter: View Source

    8985def rename_table(
    8986    old_name: str | Table,
    8987    new_name: str | Table,
    8988    dialect: DialectType = None,
    8989) -> Alter:
    8990    """Build ALTER TABLE... RENAME... expression
    8991
    8992    Args:
    8993        old_name: The old name of the table
    8994        new_name: The new name of the table
    8995        dialect: The dialect to parse the table.
    8996
    8997    Returns:
    8998        Alter table expression
    8999    """
    9000    old_table = to_table(old_name, dialect=dialect)
    9001    new_table = to_table(new_name, dialect=dialect)
    9002    return Alter(
    9003        this=old_table,
    9004        kind="TABLE",
    9005        actions=[
    9006            AlterRename(this=new_table),
    9007        ],
    9008    )

Build ALTER TABLE... RENAME... expression

###### Arguments:

- old_name: The old name of the table
- new_name: The new name of the table
- dialect: The dialect to parse the table.

###### Returns:

> Alter table expression

def rename_column( table_name: str | Table, old_column_name: str | Column, new_column_name: str | Column, exists: Optional[bool] = None, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None) -> Alter: View Source

    9011def rename_column(
    9012    table_name: str | Table,
    9013    old_column_name: str | Column,
    9014    new_column_name: str | Column,
    9015    exists: t.Optional[bool] = None,
    9016    dialect: DialectType = None,
    9017) -> Alter:
    9018    """Build ALTER TABLE... RENAME COLUMN... expression
    9019
    9020    Args:
    9021        table_name: Name of the table
    9022        old_column: The old name of the column
    9023        new_column: The new name of the column
    9024        exists: Whether to add the `IF EXISTS` clause
    9025        dialect: The dialect to parse the table/column.
    9026
    9027    Returns:
    9028        Alter table expression
    9029    """
    9030    table = to_table(table_name, dialect=dialect)
    9031    old_column = to_column(old_column_name, dialect=dialect)
    9032    new_column = to_column(new_column_name, dialect=dialect)
    9033    return Alter(
    9034        this=table,
    9035        kind="TABLE",
    9036        actions=[
    9037            RenameColumn(this=old_column, to=new_column, exists=exists),
    9038        ],
    9039    )

Build ALTER TABLE... RENAME COLUMN... expression

###### Arguments:

- table_name: Name of the table
- old_column: The old name of the column
- new_column: The new name of the column
- exists: Whether to add the `IF EXISTS` clause
- dialect: The dialect to parse the table/column.

###### Returns:

> Alter table expression

def convert(value: Any, copy: bool = False) -> Expression: View Source

    9042def convert(value: t.Any, copy: bool = False) -> Expression:
    9043    """Convert a python value into an expression object.
    9044
    9045    Raises an error if a conversion is not possible.
    9046
    9047    Args:
    9048        value: A python object.
    9049        copy: Whether to copy `value` (only applies to Expressions and collections).
    9050
    9051    Returns:
    9052        The equivalent expression object.
    9053    """
    9054    if isinstance(value, Expression):
    9055        return maybe_copy(value, copy)
    9056    if isinstance(value, str):
    9057        return Literal.string(value)
    9058    if isinstance(value, bool):
    9059        return Boolean(this=value)
    9060    if value is None or (isinstance(value, float) and math.isnan(value)):
    9061        return null()
    9062    if isinstance(value, numbers.Number):
    9063        return Literal.number(value)
    9064    if isinstance(value, bytes):
    9065        return HexString(this=value.hex())
    9066    if isinstance(value, datetime.datetime):
    9067        datetime_literal = Literal.string(value.isoformat(sep=" "))
    9068
    9069        tz = None
    9070        if value.tzinfo:
    9071            # this works for zoneinfo.ZoneInfo, pytz.timezone and datetime.datetime.utc to return IANA timezone names like "America/Los_Angeles"
    9072            # instead of abbreviations like "PDT". This is for consistency with other timezone handling functions in SQLGlot
    9073            tz = Literal.string(str(value.tzinfo))
    9074
    9075        return TimeStrToTime(this=datetime_literal, zone=tz)
    9076    if isinstance(value, datetime.date):
    9077        date_literal = Literal.string(value.strftime("%Y-%m-%d"))
    9078        return DateStrToDate(this=date_literal)
    9079    if isinstance(value, datetime.time):
    9080        time_literal = Literal.string(value.isoformat())
    9081        return TsOrDsToTime(this=time_literal)
    9082    if isinstance(value, tuple):
    9083        if hasattr(value, "_fields"):
    9084            return Struct(
    9085                expressions=[
    9086                    PropertyEQ(
    9087                        this=to_identifier(k), expression=convert(getattr(value, k), copy=copy)
    9088                    )
    9089                    for k in value._fields
    9090                ]
    9091            )
    9092        return Tuple(expressions=[convert(v, copy=copy) for v in value])
    9093    if isinstance(value, list):
    9094        return Array(expressions=[convert(v, copy=copy) for v in value])
    9095    if isinstance(value, dict):
    9096        return Map(
    9097            keys=Array(expressions=[convert(k, copy=copy) for k in value]),
    9098            values=Array(expressions=[convert(v, copy=copy) for v in value.values()]),
    9099        )
    9100    if hasattr(value, "__dict__"):
    9101        return Struct(
    9102            expressions=[
    9103                PropertyEQ(this=to_identifier(k), expression=convert(v, copy=copy))
    9104                for k, v in value.__dict__.items()
    9105            ]
    9106        )
    9107    raise ValueError(f"Cannot convert {value}")

Convert a python value into an expression object.

Raises an error if a conversion is not possible.

###### Arguments:

- value: A python object.
- copy: Whether to copy `value` (only applies to Expressions and collections).

###### Returns:

> The equivalent expression object.

def replace_children( expression: Expression, fun: Callable, *args, **kwargs) -> None: View Source

    9110def replace_children(expression: Expression, fun: t.Callable, *args, **kwargs) -> None:
    9111    """
    9112    Replace children of an expression with the result of a lambda fun(child) -> exp.
    9113    """
    9114    for k, v in tuple(expression.args.items()):
    9115        is_list_arg = type(v) is list
    9116
    9117        child_nodes = v if is_list_arg else [v]
    9118        new_child_nodes = []
    9119
    9120        for cn in child_nodes:
    9121            if isinstance(cn, Expression):
    9122                for child_node in ensure_collection(fun(cn, *args, **kwargs)):
    9123                    new_child_nodes.append(child_node)
    9124            else:
    9125                new_child_nodes.append(cn)
    9126
    9127        expression.set(k, new_child_nodes if is_list_arg else seq_get(new_child_nodes, 0))

Replace children of an expression with the result of a lambda fun(child) -> exp.

def replace_tree( expression: Expression, fun: Callable, prune: Optional[Callable[[Expression], bool]] = None) -> Expression: View Source

    9130def replace_tree(
    9131    expression: Expression,
    9132    fun: t.Callable,
    9133    prune: t.Optional[t.Callable[[Expression], bool]] = None,
    9134) -> Expression:
    9135    """
    9136    Replace an entire tree with the result of function calls on each node.
    9137
    9138    This will be traversed in reverse dfs, so leaves first.
    9139    If new nodes are created as a result of function calls, they will also be traversed.
    9140    """
    9141    stack = list(expression.dfs(prune=prune))
    9142
    9143    while stack:
    9144        node = stack.pop()
    9145        new_node = fun(node)
    9146
    9147        if new_node is not node:
    9148            node.replace(new_node)
    9149
    9150            if isinstance(new_node, Expression):
    9151                stack.append(new_node)
    9152
    9153    return new_node

Replace an entire tree with the result of function calls on each node.

This will be traversed in reverse dfs, so leaves first. If new nodes are created as a result of function calls, they will also be traversed.

def column_table_names( expression: Expression, exclude: str = '') -> Set[str]: View Source

    9156def column_table_names(expression: Expression, exclude: str = "") -> t.Set[str]:
    9157    """
    9158    Return all table names referenced through columns in an expression.
    9159
    9160    Example:
    9161        >>> import sqlglot
    9162        >>> sorted(column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e")))
    9163        ['a', 'c']
    9164
    9165    Args:
    9166        expression: expression to find table names.
    9167        exclude: a table name to exclude
    9168
    9169    Returns:
    9170        A list of unique names.
    9171    """
    9172    return {
    9173        table
    9174        for table in (column.table for column in expression.find_all(Column))
    9175        if table and table != exclude
    9176    }

Return all table names referenced through columns in an expression.

###### Example:

>     >>> import sqlglot
>     >>> sorted(column_table_names(sqlglot.parse_one("a.b AND c.d AND c.e")))
>     ['a', 'c']

###### Arguments:

- expression: expression to find table names.
- exclude: a table name to exclude

###### Returns:

> A list of unique names.

def table_name( table: Table | str, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, identify: bool = False) -> str: View Source

    9179def table_name(table: Table | str, dialect: DialectType = None, identify: bool = False) -> str:
    9180    """Get the full name of a table as a string.
    9181
    9182    Args:
    9183        table: Table expression node or string.
    9184        dialect: The dialect to generate the table name for.
    9185        identify: Determines when an identifier should be quoted. Possible values are:
    9186            False (default): Never quote, except in cases where it's mandatory by the dialect.
    9187            True: Always quote.
    9188
    9189    Examples:
    9190        >>> from sqlglot import exp, parse_one
    9191        >>> table_name(parse_one("select * from a.b.c").find(exp.Table))
    9192        'a.b.c'
    9193
    9194    Returns:
    9195        The table name.
    9196    """
    9197
    9198    table = maybe_parse(table, into=Table, dialect=dialect)
    9199
    9200    if not table:
    9201        raise ValueError(f"Cannot parse {table}")
    9202
    9203    return ".".join(
    9204        (
    9205            part.sql(dialect=dialect, identify=True, copy=False, comments=False)
    9206            if identify or not SAFE_IDENTIFIER_RE.match(part.name)
    9207            else part.name
    9208        )
    9209        for part in table.parts
    9210    )

Get the full name of a table as a string.

###### Arguments:

- table: Table expression node or string.
- dialect: The dialect to generate the table name for.
- identify: Determines when an identifier should be quoted. Possible values are: False (default): Never quote, except in cases where it's mandatory by the dialect. True: Always quote.

###### Examples:

>     >>> from sqlglot import exp, parse_one
>     >>> table_name(parse_one("select * from a.b.c").find(exp.Table))
>     'a.b.c'

###### Returns:

> The table name.

def normalize_table_name( table: str | Table, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True) -> str: View Source

    9213def normalize_table_name(table: str | Table, dialect: DialectType = None, copy: bool = True) -> str:
    9214    """Returns a case normalized table name without quotes.
    9215
    9216    Args:
    9217        table: the table to normalize
    9218        dialect: the dialect to use for normalization rules
    9219        copy: whether to copy the expression.
    9220
    9221    Examples:
    9222        >>> normalize_table_name("`A-B`.c", dialect="bigquery")
    9223        'A-B.c'
    9224    """
    9225    from sqlglot.optimizer.normalize_identifiers import normalize_identifiers
    9226
    9227    return ".".join(
    9228        p.name
    9229        for p in normalize_identifiers(
    9230            to_table(table, dialect=dialect, copy=copy), dialect=dialect
    9231        ).parts
    9232    )

Returns a case normalized table name without quotes.

###### Arguments:

- table: the table to normalize
- dialect: the dialect to use for normalization rules
- copy: whether to copy the expression.

###### Examples:

>     >>> normalize_table_name("`A-B`.c", dialect="bigquery")
>     'A-B.c'

def replace_tables( expression: ~E, mapping: Dict[str, str], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True) -> ~E: View Source

    9235def replace_tables(
    9236    expression: E, mapping: t.Dict[str, str], dialect: DialectType = None, copy: bool = True
    9237) -> E:
    9238    """Replace all tables in expression according to the mapping.
    9239
    9240    Args:
    9241        expression: expression node to be transformed and replaced.
    9242        mapping: mapping of table names.
    9243        dialect: the dialect of the mapping table
    9244        copy: whether to copy the expression.
    9245
    9246    Examples:
    9247        >>> from sqlglot import exp, parse_one
    9248        >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()
    9249        'SELECT * FROM c /* a.b */'
    9250
    9251    Returns:
    9252        The mapped expression.
    9253    """
    9254
    9255    mapping = {normalize_table_name(k, dialect=dialect): v for k, v in mapping.items()}
    9256
    9257    def _replace_tables(node: Expression) -> Expression:
    9258        if isinstance(node, Table) and node.meta.get("replace") is not False:
    9259            original = normalize_table_name(node, dialect=dialect)
    9260            new_name = mapping.get(original)
    9261
    9262            if new_name:
    9263                table = to_table(
    9264                    new_name,
    9265                    **{k: v for k, v in node.args.items() if k not in TABLE_PARTS},
    9266                    dialect=dialect,
    9267                )
    9268                table.add_comments([original])
    9269                return table
    9270        return node
    9271
    9272    return expression.transform(_replace_tables, copy=copy)  # type: ignore

Replace all tables in expression according to the mapping.

###### Arguments:

- expression: expression node to be transformed and replaced.
- mapping: mapping of table names.
- dialect: the dialect of the mapping table
- copy: whether to copy the expression.

###### Examples:

>     >>> from sqlglot import exp, parse_one
>     >>> replace_tables(parse_one("select * from a.b"), {"a.b": "c"}).sql()
>     'SELECT * FROM c /* a.b */'

###### Returns:

> The mapped expression.

def replace_placeholders( expression: Expression, *args, **kwargs) -> Expression: View Source

    9275def replace_placeholders(expression: Expression, *args, **kwargs) -> Expression:
    9276    """Replace placeholders in an expression.
    9277
    9278    Args:
    9279        expression: expression node to be transformed and replaced.
    9280        args: positional names that will substitute unnamed placeholders in the given order.
    9281        kwargs: keyword arguments that will substitute named placeholders.
    9282
    9283    Examples:
    9284        >>> from sqlglot import exp, parse_one
    9285        >>> replace_placeholders(
    9286        ...     parse_one("select * from :tbl where ? = ?"),
    9287        ...     exp.to_identifier("str_col"), "b", tbl=exp.to_identifier("foo")
    9288        ... ).sql()
    9289        "SELECT * FROM foo WHERE str_col = 'b'"
    9290
    9291    Returns:
    9292        The mapped expression.
    9293    """
    9294
    9295    def _replace_placeholders(node: Expression, args, **kwargs) -> Expression:
    9296        if isinstance(node, Placeholder):
    9297            if node.this:
    9298                new_name = kwargs.get(node.this)
    9299                if new_name is not None:
    9300                    return convert(new_name)
    9301            else:
    9302                try:
    9303                    return convert(next(args))
    9304                except StopIteration:
    9305                    pass
    9306        return node
    9307
    9308    return expression.transform(_replace_placeholders, iter(args), **kwargs)

Replace placeholders in an expression.

###### Arguments:

- expression: expression node to be transformed and replaced.
- args: positional names that will substitute unnamed placeholders in the given order.
- kwargs: keyword arguments that will substitute named placeholders.

###### Examples:

>     >>> from sqlglot import exp, parse_one
>     >>> replace_placeholders(
>     ...     parse_one("select * from :tbl where ? = ?"),
>     ...     exp.to_identifier("str_col"), "b", tbl=exp.to_identifier("foo")
>     ... ).sql()
>     "SELECT * FROM foo WHERE str_col = 'b'"

###### Returns:

> The mapped expression.

def expand( expression: Expression, sources: Dict[str, Union[Query, Callable[[], Query]]], dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, copy: bool = True) -> Expression: View Source

    9311def expand(
    9312    expression: Expression,
    9313    sources: t.Dict[str, Query | t.Callable[[], Query]],
    9314    dialect: DialectType = None,
    9315    copy: bool = True,
    9316) -> Expression:
    9317    """Transforms an expression by expanding all referenced sources into subqueries.
    9318
    9319    Examples:
    9320        >>> from sqlglot import parse_one
    9321        >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y")}).sql()
    9322        'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'
    9323
    9324        >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y"), "y": parse_one("select * from z")}).sql()
    9325        'SELECT * FROM (SELECT * FROM (SELECT * FROM z) AS y /* source: y */) AS z /* source: x */'
    9326
    9327    Args:
    9328        expression: The expression to expand.
    9329        sources: A dict of name to query or a callable that provides a query on demand.
    9330        dialect: The dialect of the sources dict or the callable.
    9331        copy: Whether to copy the expression during transformation. Defaults to True.
    9332
    9333    Returns:
    9334        The transformed expression.
    9335    """
    9336    normalized_sources = {normalize_table_name(k, dialect=dialect): v for k, v in sources.items()}
    9337
    9338    def _expand(node: Expression):
    9339        if isinstance(node, Table):
    9340            name = normalize_table_name(node, dialect=dialect)
    9341            source = normalized_sources.get(name)
    9342
    9343            if source:
    9344                # Create a subquery with the same alias (or table name if no alias)
    9345                parsed_source = source() if callable(source) else source
    9346                subquery = parsed_source.subquery(node.alias or name)
    9347                subquery.comments = [f"source: {name}"]
    9348
    9349                # Continue expanding within the subquery
    9350                return subquery.transform(_expand, copy=False)
    9351
    9352        return node
    9353
    9354    return expression.transform(_expand, copy=copy)

Transforms an expression by expanding all referenced sources into subqueries.

###### Examples:

>     >>> from sqlglot import parse_one
>     >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y")}).sql()
>     'SELECT * FROM (SELECT * FROM y) AS z /* source: x */'

>     >>> expand(parse_one("select * from x AS z"), {"x": parse_one("select * from y"), "y": parse_one("select * from z")}).sql()
>     'SELECT * FROM (SELECT * FROM (SELECT * FROM z) AS y /* source: y */) AS z /* source: x */'

###### Arguments:

- expression: The expression to expand.
- sources: A dict of name to query or a callable that provides a query on demand.
- dialect: The dialect of the sources dict or the callable.
- copy: Whether to copy the expression during transformation. Defaults to True.

###### Returns:

> The transformed expression.

def func( name: str, *args, copy: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **kwargs) -> Func: View Source

    9357def func(name: str, *args, copy: bool = True, dialect: DialectType = None, **kwargs) -> Func:
    9358    """
    9359    Returns a Func expression.
    9360
    9361    Examples:
    9362        >>> func("abs", 5).sql()
    9363        'ABS(5)'
    9364
    9365        >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()
    9366        'CAST(5 AS DOUBLE)'
    9367
    9368    Args:
    9369        name: the name of the function to build.
    9370        args: the args used to instantiate the function of interest.
    9371        copy: whether to copy the argument expressions.
    9372        dialect: the source dialect.
    9373        kwargs: the kwargs used to instantiate the function of interest.
    9374
    9375    Note:
    9376        The arguments `args` and `kwargs` are mutually exclusive.
    9377
    9378    Returns:
    9379        An instance of the function of interest, or an anonymous function, if `name` doesn't
    9380        correspond to an existing `sqlglot.expressions.Func` class.
    9381    """
    9382    if args and kwargs:
    9383        raise ValueError("Can't use both args and kwargs to instantiate a function.")
    9384
    9385    from sqlglot.dialects.dialect import Dialect
    9386
    9387    dialect = Dialect.get_or_raise(dialect)
    9388
    9389    converted: t.List[Expression] = [maybe_parse(arg, dialect=dialect, copy=copy) for arg in args]
    9390    kwargs = {key: maybe_parse(value, dialect=dialect, copy=copy) for key, value in kwargs.items()}
    9391
    9392    constructor = dialect.parser_class.FUNCTIONS.get(name.upper())
    9393    if constructor:
    9394        if converted:
    9395            if "dialect" in constructor.__code__.co_varnames:
    9396                function = constructor(converted, dialect=dialect)
    9397            else:
    9398                function = constructor(converted)
    9399        elif constructor.__name__ == "from_arg_list":
    9400            function = constructor.__self__(**kwargs)  # type: ignore
    9401        else:
    9402            constructor = FUNCTION_BY_NAME.get(name.upper())
    9403            if constructor:
    9404                function = constructor(**kwargs)
    9405            else:
    9406                raise ValueError(
    9407                    f"Unable to convert '{name}' into a Func. Either manually construct "
    9408                    "the Func expression of interest or parse the function call."
    9409                )
    9410    else:
    9411        kwargs = kwargs or {"expressions": converted}
    9412        function = Anonymous(this=name, **kwargs)
    9413
    9414    for error_message in function.error_messages(converted):
    9415        raise ValueError(error_message)
    9416
    9417    return function

Returns a Func expression.

###### Examples:

>     >>> func("abs", 5).sql()
>     'ABS(5)'

>     >>> func("cast", this=5, to=DataType.build("DOUBLE")).sql()
>     'CAST(5 AS DOUBLE)'

###### Arguments:

- name: the name of the function to build.
- args: the args used to instantiate the function of interest.
- copy: whether to copy the argument expressions.
- dialect: the source dialect.
- kwargs: the kwargs used to instantiate the function of interest.

###### Note:

> The arguments `args` and `kwargs` are mutually exclusive.

###### Returns:

> An instance of the function of interest, or an anonymous function, if `name` doesn't correspond to an existing `sqlglot.expressions.Func` class.

def case( expression: Union[str, Expression, NoneType] = None, **opts) -> Case: View Source

    9420def case(
    9421    expression: t.Optional[ExpOrStr] = None,
    9422    **opts,
    9423) -> Case:
    9424    """
    9425    Initialize a CASE statement.
    9426
    9427    Example:
    9428        case().when("a = 1", "foo").else_("bar")
    9429
    9430    Args:
    9431        expression: Optionally, the input expression (not all dialects support this)
    9432        **opts: Extra keyword arguments for parsing `expression`
    9433    """
    9434    if expression is not None:
    9435        this = maybe_parse(expression, **opts)
    9436    else:
    9437        this = None
    9438    return Case(this=this, ifs=[])

Initialize a CASE statement.

###### Example:

> case().when("a = 1", "foo").else_("bar")

###### Arguments:

- expression: Optionally, the input expression (not all dialects support this)
- **opts: Extra keyword arguments for parsing `expression`

def array( *expressions: Union[str, Expression], copy: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **kwargs) -> Array: View Source

    9441def array(
    9442    *expressions: ExpOrStr, copy: bool = True, dialect: DialectType = None, **kwargs
    9443) -> Array:
    9444    """
    9445    Returns an array.
    9446
    9447    Examples:
    9448        >>> array(1, 'x').sql()
    9449        'ARRAY(1, x)'
    9450
    9451    Args:
    9452        expressions: the expressions to add to the array.
    9453        copy: whether to copy the argument expressions.
    9454        dialect: the source dialect.
    9455        kwargs: the kwargs used to instantiate the function of interest.
    9456
    9457    Returns:
    9458        An array expression.
    9459    """
    9460    return Array(
    9461        expressions=[
    9462            maybe_parse(expression, copy=copy, dialect=dialect, **kwargs)
    9463            for expression in expressions
    9464        ]
    9465    )

Returns an array.

###### Examples:

>     >>> array(1, 'x').sql()
>     'ARRAY(1, x)'

###### Arguments:

- expressions: the expressions to add to the array.
- copy: whether to copy the argument expressions.
- dialect: the source dialect.
- kwargs: the kwargs used to instantiate the function of interest.

###### Returns:

> An array expression.

def tuple_( *expressions: Union[str, Expression], copy: bool = True, dialect: Union[str, sqlglot.dialects.Dialect, Type[sqlglot.dialects.Dialect], NoneType] = None, **kwargs) -> Tuple: View Source

    9468def tuple_(
    9469    *expressions: ExpOrStr, copy: bool = True, dialect: DialectType = None, **kwargs
    9470) -> Tuple:
    9471    """
    9472    Returns an tuple.
    9473
    9474    Examples:
    9475        >>> tuple_(1, 'x').sql()
    9476        '(1, x)'
    9477
    9478    Args:
    9479        expressions: the expressions to add to the tuple.
    9480        copy: whether to copy the argument expressions.
    9481        dialect: the source dialect.
    9482        kwargs: the kwargs used to instantiate the function of interest.
    9483
    9484    Returns:
    9485        A tuple expression.
    9486    """
    9487    return Tuple(
    9488        expressions=[
    9489            maybe_parse(expression, copy=copy, dialect=dialect, **kwargs)
    9490            for expression in expressions
    9491        ]
    9492    )

Returns an tuple.

###### Examples:

>     >>> tuple_(1, 'x').sql()
>     '(1, x)'

###### Arguments:

- expressions: the expressions to add to the tuple.
- copy: whether to copy the argument expressions.
- dialect: the source dialect.
- kwargs: the kwargs used to instantiate the function of interest.

###### Returns:

> A tuple expression.

def true() -> Boolean: View Source

    9495def true() -> Boolean:
    9496    """
    9497    Returns a true Boolean expression.
    9498    """
    9499    return Boolean(this=True)

Returns a true Boolean expression.

def false() -> Boolean: View Source

    9502def false() -> Boolean:
    9503    """
    9504    Returns a false Boolean expression.
    9505    """
    9506    return Boolean(this=False)

Returns a false Boolean expression.

def null() -> Null: View Source

    9509def null() -> Null:
    9510    """
    9511    Returns a Null expression.
    9512    """
    9513    return Null()

Returns a Null expression.

NONNULL_CONSTANTS = (<class 'Literal'>, <class 'Boolean'>)
CONSTANTS = (<class 'Literal'>, <class 'Boolean'>, <class 'Null'>)