"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
SPDX-License-Identifier: Apache-2.0"""

import builtins
import collections.abc
import google.protobuf.any_pb2
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import substrait.extensions.extensions_pb2
import substrait.type_pb2
import sys
import typing

if sys.version_info >= (3, 10):
    import typing as typing_extensions
else:
    import typing_extensions

if sys.version_info >= (3, 13):
    from warnings import deprecated
else:
    from typing_extensions import deprecated

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

class _AggregationPhase:
    ValueType = typing.NewType("ValueType", builtins.int)
    V: typing_extensions.TypeAlias = ValueType

class _AggregationPhaseEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_AggregationPhase.ValueType], builtins.type):
    DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
    AGGREGATION_PHASE_UNSPECIFIED: _AggregationPhase.ValueType  # 0
    """Implies `INTERMEDIATE_TO_RESULT`."""
    AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE: _AggregationPhase.ValueType  # 1
    """Specifies that the function should be run only up to the point of
    generating an intermediate value, to be further aggregated later using
    INTERMEDIATE_TO_INTERMEDIATE or INTERMEDIATE_TO_RESULT.
    """
    AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE: _AggregationPhase.ValueType  # 2
    """Specifies that the inputs of the aggregate or window function are the
    intermediate values of the function, and that the output should also be
    an intermediate value, to be further aggregated later using
    INTERMEDIATE_TO_INTERMEDIATE or INTERMEDIATE_TO_RESULT.
    """
    AGGREGATION_PHASE_INITIAL_TO_RESULT: _AggregationPhase.ValueType  # 3
    """A complete invocation: the function should aggregate the given set of
    inputs to yield a single return value. This style must be used for
    aggregate or window functions that are not decomposable.
    """
    AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT: _AggregationPhase.ValueType  # 4
    """Specifies that the inputs of the aggregate or window function are the
    intermediate values of the function, generated previously using
    INITIAL_TO_INTERMEDIATE and possibly INTERMEDIATE_TO_INTERMEDIATE calls.
    This call should combine the intermediate values to yield the final
    return value.
    """

class AggregationPhase(_AggregationPhase, metaclass=_AggregationPhaseEnumTypeWrapper):
    """Describes which part of an aggregation or window function to perform within
    the context of distributed algorithms.
    """

AGGREGATION_PHASE_UNSPECIFIED: AggregationPhase.ValueType  # 0
"""Implies `INTERMEDIATE_TO_RESULT`."""
AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE: AggregationPhase.ValueType  # 1
"""Specifies that the function should be run only up to the point of
generating an intermediate value, to be further aggregated later using
INTERMEDIATE_TO_INTERMEDIATE or INTERMEDIATE_TO_RESULT.
"""
AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE: AggregationPhase.ValueType  # 2
"""Specifies that the inputs of the aggregate or window function are the
intermediate values of the function, and that the output should also be
an intermediate value, to be further aggregated later using
INTERMEDIATE_TO_INTERMEDIATE or INTERMEDIATE_TO_RESULT.
"""
AGGREGATION_PHASE_INITIAL_TO_RESULT: AggregationPhase.ValueType  # 3
"""A complete invocation: the function should aggregate the given set of
inputs to yield a single return value. This style must be used for
aggregate or window functions that are not decomposable.
"""
AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT: AggregationPhase.ValueType  # 4
"""Specifies that the inputs of the aggregate or window function are the
intermediate values of the function, generated previously using
INITIAL_TO_INTERMEDIATE and possibly INTERMEDIATE_TO_INTERMEDIATE calls.
This call should combine the intermediate values to yield the final
return value.
"""
Global___AggregationPhase: typing_extensions.TypeAlias = AggregationPhase

@typing.final
class RelCommon(google.protobuf.message.Message):
    """Common fields for all relational operators"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    @typing.final
    class Direct(google.protobuf.message.Message):
        """Direct indicates no change on presence and ordering of fields in the output"""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        def __init__(
            self,
        ) -> None: ...

    @typing.final
    class Emit(google.protobuf.message.Message):
        """Remap which fields are output and in which order"""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        OUTPUT_MAPPING_FIELD_NUMBER: builtins.int
        @property
        def output_mapping(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]: ...
        def __init__(
            self,
            *,
            output_mapping: collections.abc.Iterable[builtins.int] | None = ...,
        ) -> None: ...
        def ClearField(self, field_name: typing.Literal["output_mapping", b"output_mapping"]) -> None: ...

    @typing.final
    class Hint(google.protobuf.message.Message):
        """Changes to the operation that can influence efficiency/performance but
        should not impact correctness.
        """

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        class _ComputationType:
            ValueType = typing.NewType("ValueType", builtins.int)
            V: typing_extensions.TypeAlias = ValueType

        class _ComputationTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[RelCommon.Hint._ComputationType.ValueType], builtins.type):
            DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
            COMPUTATION_TYPE_UNSPECIFIED: RelCommon.Hint._ComputationType.ValueType  # 0
            COMPUTATION_TYPE_HASHTABLE: RelCommon.Hint._ComputationType.ValueType  # 1
            COMPUTATION_TYPE_BLOOM_FILTER: RelCommon.Hint._ComputationType.ValueType  # 2
            COMPUTATION_TYPE_UNKNOWN: RelCommon.Hint._ComputationType.ValueType  # 9999

        class ComputationType(_ComputationType, metaclass=_ComputationTypeEnumTypeWrapper): ...
        COMPUTATION_TYPE_UNSPECIFIED: RelCommon.Hint.ComputationType.ValueType  # 0
        COMPUTATION_TYPE_HASHTABLE: RelCommon.Hint.ComputationType.ValueType  # 1
        COMPUTATION_TYPE_BLOOM_FILTER: RelCommon.Hint.ComputationType.ValueType  # 2
        COMPUTATION_TYPE_UNKNOWN: RelCommon.Hint.ComputationType.ValueType  # 9999

        @typing.final
        class Stats(google.protobuf.message.Message):
            """The statistics related to a hint (physical properties of records)"""

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            ROW_COUNT_FIELD_NUMBER: builtins.int
            RECORD_SIZE_FIELD_NUMBER: builtins.int
            ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
            row_count: builtins.float
            record_size: builtins.float
            @property
            def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
            def __init__(
                self,
                *,
                row_count: builtins.float = ...,
                record_size: builtins.float = ...,
                advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "record_size", b"record_size", "row_count", b"row_count"]) -> None: ...

        @typing.final
        class RuntimeConstraint(google.protobuf.message.Message):
            """TODO: nodes, cpu threads/%, memory, iops, etc."""

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
            @property
            def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
            def __init__(
                self,
                *,
                advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension"]) -> None: ...

        @typing.final
        class SavedComputation(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            COMPUTATION_ID_FIELD_NUMBER: builtins.int
            TYPE_FIELD_NUMBER: builtins.int
            ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
            computation_id: builtins.int
            """The value corresponds to a plan unique number for that datastructure.  Any particular
            computation may be saved only once but it may be loaded multiple times.
            """
            type: Global___RelCommon.Hint.ComputationType.ValueType
            """The type of this computation.  While a plan may use COMPUTATION_TYPE_UNKNOWN for all
            of its types it is recommended to use a more specific type so that the optimization
            is more portable.  The consumer should be able to decide if an unknown type here
            matches the same unknown type at a different plan and ignore the optimization if they
            are mismatched.
            """
            @property
            def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
            def __init__(
                self,
                *,
                computation_id: builtins.int = ...,
                type: Global___RelCommon.Hint.ComputationType.ValueType = ...,
                advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "computation_id", b"computation_id", "type", b"type"]) -> None: ...

        @typing.final
        class LoadedComputation(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            COMPUTATION_ID_REFERENCE_FIELD_NUMBER: builtins.int
            TYPE_FIELD_NUMBER: builtins.int
            ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
            computation_id_reference: builtins.int
            """The value corresponds to a plan unique number for that datastructure.  Any particular
            computation may be saved only once but it may be loaded multiple times.
            """
            type: Global___RelCommon.Hint.ComputationType.ValueType
            """The type of this computation.  While a plan may use COMPUTATION_TYPE_UNKNOWN for all
            of its types it is recommended to use a more specific type so that the optimization
            is more portable.  The consumer should be able to decide if an unknown type here
            matches the same unknown type at a different plan and ignore the optimization if they
            are mismatched.
            """
            @property
            def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
            def __init__(
                self,
                *,
                computation_id_reference: builtins.int = ...,
                type: Global___RelCommon.Hint.ComputationType.ValueType = ...,
                advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "computation_id_reference", b"computation_id_reference", "type", b"type"]) -> None: ...

        STATS_FIELD_NUMBER: builtins.int
        CONSTRAINT_FIELD_NUMBER: builtins.int
        ALIAS_FIELD_NUMBER: builtins.int
        OUTPUT_NAMES_FIELD_NUMBER: builtins.int
        ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
        SAVED_COMPUTATIONS_FIELD_NUMBER: builtins.int
        LOADED_COMPUTATIONS_FIELD_NUMBER: builtins.int
        alias: builtins.str
        """Name (alias) for this relation. Can be used for e.g. qualifying the relation (see e.g.
        Spark's SubqueryAlias), or debugging.
        """
        @property
        def stats(self) -> Global___RelCommon.Hint.Stats: ...
        @property
        def constraint(self) -> Global___RelCommon.Hint.RuntimeConstraint: ...
        @property
        def output_names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
            """Assigns alternative output field names for any relation.  Equivalent to the names field
            in RelRoot but applies to the output of the relation this RelCommon is attached to.
            """

        @property
        def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
        @property
        def saved_computations(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___RelCommon.Hint.SavedComputation]:
            """Save or load a system-specific computation for use in optimizing a remote operation.
            The anchor refers to the source/destination of the computation.  The computation type
            and number refer to the current relation.
            """

        @property
        def loaded_computations(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___RelCommon.Hint.LoadedComputation]: ...
        def __init__(
            self,
            *,
            stats: Global___RelCommon.Hint.Stats | None = ...,
            constraint: Global___RelCommon.Hint.RuntimeConstraint | None = ...,
            alias: builtins.str = ...,
            output_names: collections.abc.Iterable[builtins.str] | None = ...,
            advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
            saved_computations: collections.abc.Iterable[Global___RelCommon.Hint.SavedComputation] | None = ...,
            loaded_computations: collections.abc.Iterable[Global___RelCommon.Hint.LoadedComputation] | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "constraint", b"constraint", "stats", b"stats"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "alias", b"alias", "constraint", b"constraint", "loaded_computations", b"loaded_computations", "output_names", b"output_names", "saved_computations", b"saved_computations", "stats", b"stats"]) -> None: ...

    DIRECT_FIELD_NUMBER: builtins.int
    EMIT_FIELD_NUMBER: builtins.int
    HINT_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    @property
    def direct(self) -> Global___RelCommon.Direct:
        """The underlying relation is output as is (no reordering or projection of columns)"""

    @property
    def emit(self) -> Global___RelCommon.Emit:
        """Allows to control for order and inclusion of fields"""

    @property
    def hint(self) -> Global___RelCommon.Hint: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        direct: Global___RelCommon.Direct | None = ...,
        emit: Global___RelCommon.Emit | None = ...,
        hint: Global___RelCommon.Hint | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "direct", b"direct", "emit", b"emit", "emit_kind", b"emit_kind", "hint", b"hint"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "direct", b"direct", "emit", b"emit", "emit_kind", b"emit_kind", "hint", b"hint"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["emit_kind", b"emit_kind"]) -> typing.Literal["direct", "emit"] | None: ...

Global___RelCommon: typing_extensions.TypeAlias = RelCommon

@typing.final
class ReadRel(google.protobuf.message.Message):
    """The scan operator of base data (physical or virtual), including filtering and projection."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    @typing.final
    class NamedTable(google.protobuf.message.Message):
        """A base table. The list of string is used to represent namespacing (e.g., mydb.mytable).
        This assumes shared catalog between systems exchanging a message.
        """

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        NAMES_FIELD_NUMBER: builtins.int
        ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
        @property
        def names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
        @property
        def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
        def __init__(
            self,
            *,
            names: collections.abc.Iterable[builtins.str] | None = ...,
            advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "names", b"names"]) -> None: ...

    @typing.final
    class IcebergTable(google.protobuf.message.Message):
        """Read an Iceberg Table"""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class MetadataFileRead(google.protobuf.message.Message):
            """Read an Iceberg table using a metadata file. Implicit assumption: required credentials are already known by plan consumer."""

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            METADATA_URI_FIELD_NUMBER: builtins.int
            SNAPSHOT_ID_FIELD_NUMBER: builtins.int
            SNAPSHOT_TIMESTAMP_FIELD_NUMBER: builtins.int
            metadata_uri: builtins.str
            """the specific uri of a metadata file (e.g. s3://mybucket/mytable/<ver>-<uuid>.metadata.json)"""
            snapshot_id: builtins.str
            """the snapshot id to read."""
            snapshot_timestamp: builtins.int
            """the timestamp that should be used to select the snapshot (Time passed in microseconds since 1970-01-01 00:00:00.000000 in UTC)"""
            def __init__(
                self,
                *,
                metadata_uri: builtins.str = ...,
                snapshot_id: builtins.str = ...,
                snapshot_timestamp: builtins.int = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["snapshot", b"snapshot", "snapshot_id", b"snapshot_id", "snapshot_timestamp", b"snapshot_timestamp"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["metadata_uri", b"metadata_uri", "snapshot", b"snapshot", "snapshot_id", b"snapshot_id", "snapshot_timestamp", b"snapshot_timestamp"]) -> None: ...
            def WhichOneof(self, oneof_group: typing.Literal["snapshot", b"snapshot"]) -> typing.Literal["snapshot_id", "snapshot_timestamp"] | None: ...

        DIRECT_FIELD_NUMBER: builtins.int
        @property
        def direct(self) -> Global___ReadRel.IcebergTable.MetadataFileRead:
            """future: add catalog table types (e.g. rest api, latest metadata in path, etc)"""

        def __init__(
            self,
            *,
            direct: Global___ReadRel.IcebergTable.MetadataFileRead | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["direct", b"direct", "table_type", b"table_type"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["direct", b"direct", "table_type", b"table_type"]) -> None: ...
        def WhichOneof(self, oneof_group: typing.Literal["table_type", b"table_type"]) -> typing.Literal["direct"] | None: ...

    @typing.final
    class VirtualTable(google.protobuf.message.Message):
        """A table composed of expressions."""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        VALUES_FIELD_NUMBER: builtins.int
        EXPRESSIONS_FIELD_NUMBER: builtins.int
        @property
        def values(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.Literal.Struct]: ...
        @property
        def expressions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.Nested.Struct]: ...
        def __init__(
            self,
            *,
            values: collections.abc.Iterable[Global___Expression.Literal.Struct] | None = ...,
            expressions: collections.abc.Iterable[Global___Expression.Nested.Struct] | None = ...,
        ) -> None: ...
        def ClearField(self, field_name: typing.Literal["expressions", b"expressions", "values", b"values"]) -> None: ...

    @typing.final
    class ExtensionTable(google.protobuf.message.Message):
        """A stub type that can be used to extend/introduce new table types outside
        the specification.
        """

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        DETAIL_FIELD_NUMBER: builtins.int
        @property
        def detail(self) -> google.protobuf.any_pb2.Any: ...
        def __init__(
            self,
            *,
            detail: google.protobuf.any_pb2.Any | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["detail", b"detail"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["detail", b"detail"]) -> None: ...

    @typing.final
    class LocalFiles(google.protobuf.message.Message):
        """Represents a list of locally-accessible files in input of a scan operation"""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class FileOrFiles(google.protobuf.message.Message):
            """Many files consist of indivisible chunks (e.g. parquet row groups
            or CSV rows).  If a slice partially selects an indivisible chunk
            then the consumer should employ some rule to decide which slice to
            include the chunk in (e.g. include it in the slice that contains
            the midpoint of the chunk)
            """

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            @typing.final
            class ParquetReadOptions(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                def __init__(
                    self,
                ) -> None: ...

            @typing.final
            class ArrowReadOptions(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                def __init__(
                    self,
                ) -> None: ...

            @typing.final
            class OrcReadOptions(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                def __init__(
                    self,
                ) -> None: ...

            @typing.final
            class DwrfReadOptions(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                def __init__(
                    self,
                ) -> None: ...

            @typing.final
            class DelimiterSeparatedTextReadOptions(google.protobuf.message.Message):
                """Delimiter separated files may be compressed.  The reader should
                autodetect this and decompress as needed.
                """

                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                FIELD_DELIMITER_FIELD_NUMBER: builtins.int
                MAX_LINE_SIZE_FIELD_NUMBER: builtins.int
                QUOTE_FIELD_NUMBER: builtins.int
                HEADER_LINES_TO_SKIP_FIELD_NUMBER: builtins.int
                ESCAPE_FIELD_NUMBER: builtins.int
                VALUE_TREATED_AS_NULL_FIELD_NUMBER: builtins.int
                field_delimiter: builtins.str
                """The character(s) used to separate fields.  Common values are comma,
                tab, and pipe.  Multiple characters are allowed.
                """
                max_line_size: builtins.int
                """The maximum number of bytes to read from a single line.  If a line
                exceeds this limit the resulting behavior is undefined.
                """
                quote: builtins.str
                """The character(s) used to quote strings.  Common values are single
                and double quotation marks.
                """
                header_lines_to_skip: builtins.int
                """The number of lines to skip at the beginning of the file."""
                escape: builtins.str
                """The character used to escape characters in strings.  Backslash is
                a common value.  Note that a double quote mark can also be used as an
                escape character but the external quotes should be removed first.
                """
                value_treated_as_null: builtins.str
                """If this value is encountered (including empty string), the resulting
                value is null instead.  Leave unset to disable.  If this value is
                provided, the effective schema of this file is comprised entirely of
                nullable strings.  If not provided, the effective schema is instead
                made up of non-nullable strings.
                """
                def __init__(
                    self,
                    *,
                    field_delimiter: builtins.str = ...,
                    max_line_size: builtins.int = ...,
                    quote: builtins.str = ...,
                    header_lines_to_skip: builtins.int = ...,
                    escape: builtins.str = ...,
                    value_treated_as_null: builtins.str | None = ...,
                ) -> None: ...
                def HasField(self, field_name: typing.Literal["_value_treated_as_null", b"_value_treated_as_null", "value_treated_as_null", b"value_treated_as_null"]) -> builtins.bool: ...
                def ClearField(self, field_name: typing.Literal["_value_treated_as_null", b"_value_treated_as_null", "escape", b"escape", "field_delimiter", b"field_delimiter", "header_lines_to_skip", b"header_lines_to_skip", "max_line_size", b"max_line_size", "quote", b"quote", "value_treated_as_null", b"value_treated_as_null"]) -> None: ...
                def WhichOneof(self, oneof_group: typing.Literal["_value_treated_as_null", b"_value_treated_as_null"]) -> typing.Literal["value_treated_as_null"] | None: ...

            URI_PATH_FIELD_NUMBER: builtins.int
            URI_PATH_GLOB_FIELD_NUMBER: builtins.int
            URI_FILE_FIELD_NUMBER: builtins.int
            URI_FOLDER_FIELD_NUMBER: builtins.int
            PARTITION_INDEX_FIELD_NUMBER: builtins.int
            START_FIELD_NUMBER: builtins.int
            LENGTH_FIELD_NUMBER: builtins.int
            PARQUET_FIELD_NUMBER: builtins.int
            ARROW_FIELD_NUMBER: builtins.int
            ORC_FIELD_NUMBER: builtins.int
            EXTENSION_FIELD_NUMBER: builtins.int
            DWRF_FIELD_NUMBER: builtins.int
            TEXT_FIELD_NUMBER: builtins.int
            uri_path: builtins.str
            """A URI that can refer to either a single folder or a single file"""
            uri_path_glob: builtins.str
            """A URI where the path portion is a glob expression that can
            identify zero or more paths.
            Consumers should support the POSIX syntax.  The recursive
            globstar (**) may not be supported.
            """
            uri_file: builtins.str
            """A URI that refers to a single file"""
            uri_folder: builtins.str
            """A URI that refers to a single folder"""
            partition_index: builtins.int
            """The index of the partition this item belongs to"""
            start: builtins.int
            """The start position in byte to read from this item"""
            length: builtins.int
            """The length in byte to read from this item"""
            @property
            def parquet(self) -> Global___ReadRel.LocalFiles.FileOrFiles.ParquetReadOptions: ...
            @property
            def arrow(self) -> Global___ReadRel.LocalFiles.FileOrFiles.ArrowReadOptions: ...
            @property
            def orc(self) -> Global___ReadRel.LocalFiles.FileOrFiles.OrcReadOptions: ...
            @property
            def extension(self) -> google.protobuf.any_pb2.Any: ...
            @property
            def dwrf(self) -> Global___ReadRel.LocalFiles.FileOrFiles.DwrfReadOptions: ...
            @property
            def text(self) -> Global___ReadRel.LocalFiles.FileOrFiles.DelimiterSeparatedTextReadOptions: ...
            def __init__(
                self,
                *,
                uri_path: builtins.str = ...,
                uri_path_glob: builtins.str = ...,
                uri_file: builtins.str = ...,
                uri_folder: builtins.str = ...,
                partition_index: builtins.int = ...,
                start: builtins.int = ...,
                length: builtins.int = ...,
                parquet: Global___ReadRel.LocalFiles.FileOrFiles.ParquetReadOptions | None = ...,
                arrow: Global___ReadRel.LocalFiles.FileOrFiles.ArrowReadOptions | None = ...,
                orc: Global___ReadRel.LocalFiles.FileOrFiles.OrcReadOptions | None = ...,
                extension: google.protobuf.any_pb2.Any | None = ...,
                dwrf: Global___ReadRel.LocalFiles.FileOrFiles.DwrfReadOptions | None = ...,
                text: Global___ReadRel.LocalFiles.FileOrFiles.DelimiterSeparatedTextReadOptions | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["arrow", b"arrow", "dwrf", b"dwrf", "extension", b"extension", "file_format", b"file_format", "orc", b"orc", "parquet", b"parquet", "path_type", b"path_type", "text", b"text", "uri_file", b"uri_file", "uri_folder", b"uri_folder", "uri_path", b"uri_path", "uri_path_glob", b"uri_path_glob"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["arrow", b"arrow", "dwrf", b"dwrf", "extension", b"extension", "file_format", b"file_format", "length", b"length", "orc", b"orc", "parquet", b"parquet", "partition_index", b"partition_index", "path_type", b"path_type", "start", b"start", "text", b"text", "uri_file", b"uri_file", "uri_folder", b"uri_folder", "uri_path", b"uri_path", "uri_path_glob", b"uri_path_glob"]) -> None: ...
            @typing.overload
            def WhichOneof(self, oneof_group: typing.Literal["file_format", b"file_format"]) -> typing.Literal["parquet", "arrow", "orc", "extension", "dwrf", "text"] | None: ...
            @typing.overload
            def WhichOneof(self, oneof_group: typing.Literal["path_type", b"path_type"]) -> typing.Literal["uri_path", "uri_path_glob", "uri_file", "uri_folder"] | None: ...

        ITEMS_FIELD_NUMBER: builtins.int
        ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
        @property
        def items(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___ReadRel.LocalFiles.FileOrFiles]: ...
        @property
        def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
        def __init__(
            self,
            *,
            items: collections.abc.Iterable[Global___ReadRel.LocalFiles.FileOrFiles] | None = ...,
            advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "items", b"items"]) -> None: ...

    COMMON_FIELD_NUMBER: builtins.int
    BASE_SCHEMA_FIELD_NUMBER: builtins.int
    FILTER_FIELD_NUMBER: builtins.int
    BEST_EFFORT_FILTER_FIELD_NUMBER: builtins.int
    PROJECTION_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    VIRTUAL_TABLE_FIELD_NUMBER: builtins.int
    LOCAL_FILES_FIELD_NUMBER: builtins.int
    NAMED_TABLE_FIELD_NUMBER: builtins.int
    EXTENSION_TABLE_FIELD_NUMBER: builtins.int
    ICEBERG_TABLE_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def base_schema(self) -> substrait.type_pb2.NamedStruct: ...
    @property
    def filter(self) -> Global___Expression: ...
    @property
    def best_effort_filter(self) -> Global___Expression: ...
    @property
    def projection(self) -> Global___Expression.MaskExpression: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    @property
    def virtual_table(self) -> Global___ReadRel.VirtualTable: ...
    @property
    def local_files(self) -> Global___ReadRel.LocalFiles: ...
    @property
    def named_table(self) -> Global___ReadRel.NamedTable: ...
    @property
    def extension_table(self) -> Global___ReadRel.ExtensionTable: ...
    @property
    def iceberg_table(self) -> Global___ReadRel.IcebergTable: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        base_schema: substrait.type_pb2.NamedStruct | None = ...,
        filter: Global___Expression | None = ...,
        best_effort_filter: Global___Expression | None = ...,
        projection: Global___Expression.MaskExpression | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
        virtual_table: Global___ReadRel.VirtualTable | None = ...,
        local_files: Global___ReadRel.LocalFiles | None = ...,
        named_table: Global___ReadRel.NamedTable | None = ...,
        extension_table: Global___ReadRel.ExtensionTable | None = ...,
        iceberg_table: Global___ReadRel.IcebergTable | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "base_schema", b"base_schema", "best_effort_filter", b"best_effort_filter", "common", b"common", "extension_table", b"extension_table", "filter", b"filter", "iceberg_table", b"iceberg_table", "local_files", b"local_files", "named_table", b"named_table", "projection", b"projection", "read_type", b"read_type", "virtual_table", b"virtual_table"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "base_schema", b"base_schema", "best_effort_filter", b"best_effort_filter", "common", b"common", "extension_table", b"extension_table", "filter", b"filter", "iceberg_table", b"iceberg_table", "local_files", b"local_files", "named_table", b"named_table", "projection", b"projection", "read_type", b"read_type", "virtual_table", b"virtual_table"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["read_type", b"read_type"]) -> typing.Literal["virtual_table", "local_files", "named_table", "extension_table", "iceberg_table"] | None: ...

Global___ReadRel: typing_extensions.TypeAlias = ReadRel

@typing.final
class ProjectRel(google.protobuf.message.Message):
    """This operator allows to represent calculated expressions of fields (e.g., a+b). Direct/Emit are used to represent classical relational projections"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    COMMON_FIELD_NUMBER: builtins.int
    INPUT_FIELD_NUMBER: builtins.int
    EXPRESSIONS_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def input(self) -> Global___Rel: ...
    @property
    def expressions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        input: Global___Rel | None = ...,
        expressions: collections.abc.Iterable[Global___Expression] | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "input", b"input"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "expressions", b"expressions", "input", b"input"]) -> None: ...

Global___ProjectRel: typing_extensions.TypeAlias = ProjectRel

@typing.final
class JoinRel(google.protobuf.message.Message):
    """The binary JOIN relational operator left-join-right, including various join types, a join condition and post_join_filter expression"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _JoinType:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _JoinTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[JoinRel._JoinType.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        JOIN_TYPE_UNSPECIFIED: JoinRel._JoinType.ValueType  # 0
        JOIN_TYPE_INNER: JoinRel._JoinType.ValueType  # 1
        JOIN_TYPE_OUTER: JoinRel._JoinType.ValueType  # 2
        JOIN_TYPE_LEFT: JoinRel._JoinType.ValueType  # 3
        JOIN_TYPE_RIGHT: JoinRel._JoinType.ValueType  # 4
        JOIN_TYPE_LEFT_SEMI: JoinRel._JoinType.ValueType  # 5
        JOIN_TYPE_LEFT_ANTI: JoinRel._JoinType.ValueType  # 6
        JOIN_TYPE_LEFT_SINGLE: JoinRel._JoinType.ValueType  # 7
        JOIN_TYPE_RIGHT_SEMI: JoinRel._JoinType.ValueType  # 8
        JOIN_TYPE_RIGHT_ANTI: JoinRel._JoinType.ValueType  # 9
        JOIN_TYPE_RIGHT_SINGLE: JoinRel._JoinType.ValueType  # 10
        JOIN_TYPE_LEFT_MARK: JoinRel._JoinType.ValueType  # 11
        JOIN_TYPE_RIGHT_MARK: JoinRel._JoinType.ValueType  # 12

    class JoinType(_JoinType, metaclass=_JoinTypeEnumTypeWrapper): ...
    JOIN_TYPE_UNSPECIFIED: JoinRel.JoinType.ValueType  # 0
    JOIN_TYPE_INNER: JoinRel.JoinType.ValueType  # 1
    JOIN_TYPE_OUTER: JoinRel.JoinType.ValueType  # 2
    JOIN_TYPE_LEFT: JoinRel.JoinType.ValueType  # 3
    JOIN_TYPE_RIGHT: JoinRel.JoinType.ValueType  # 4
    JOIN_TYPE_LEFT_SEMI: JoinRel.JoinType.ValueType  # 5
    JOIN_TYPE_LEFT_ANTI: JoinRel.JoinType.ValueType  # 6
    JOIN_TYPE_LEFT_SINGLE: JoinRel.JoinType.ValueType  # 7
    JOIN_TYPE_RIGHT_SEMI: JoinRel.JoinType.ValueType  # 8
    JOIN_TYPE_RIGHT_ANTI: JoinRel.JoinType.ValueType  # 9
    JOIN_TYPE_RIGHT_SINGLE: JoinRel.JoinType.ValueType  # 10
    JOIN_TYPE_LEFT_MARK: JoinRel.JoinType.ValueType  # 11
    JOIN_TYPE_RIGHT_MARK: JoinRel.JoinType.ValueType  # 12

    COMMON_FIELD_NUMBER: builtins.int
    LEFT_FIELD_NUMBER: builtins.int
    RIGHT_FIELD_NUMBER: builtins.int
    EXPRESSION_FIELD_NUMBER: builtins.int
    POST_JOIN_FILTER_FIELD_NUMBER: builtins.int
    TYPE_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    type: Global___JoinRel.JoinType.ValueType
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def left(self) -> Global___Rel: ...
    @property
    def right(self) -> Global___Rel: ...
    @property
    def expression(self) -> Global___Expression: ...
    @property
    def post_join_filter(self) -> Global___Expression: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        left: Global___Rel | None = ...,
        right: Global___Rel | None = ...,
        expression: Global___Expression | None = ...,
        post_join_filter: Global___Expression | None = ...,
        type: Global___JoinRel.JoinType.ValueType = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "expression", b"expression", "left", b"left", "post_join_filter", b"post_join_filter", "right", b"right"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "expression", b"expression", "left", b"left", "post_join_filter", b"post_join_filter", "right", b"right", "type", b"type"]) -> None: ...

Global___JoinRel: typing_extensions.TypeAlias = JoinRel

@typing.final
class CrossRel(google.protobuf.message.Message):
    """Cartesian product relational operator of two tables (left and right)"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    COMMON_FIELD_NUMBER: builtins.int
    LEFT_FIELD_NUMBER: builtins.int
    RIGHT_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def left(self) -> Global___Rel: ...
    @property
    def right(self) -> Global___Rel: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        left: Global___Rel | None = ...,
        right: Global___Rel | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "left", b"left", "right", b"right"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "left", b"left", "right", b"right"]) -> None: ...

Global___CrossRel: typing_extensions.TypeAlias = CrossRel

@typing.final
class FetchRel(google.protobuf.message.Message):
    """The relational operator representing LIMIT/OFFSET or TOP type semantics."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    COMMON_FIELD_NUMBER: builtins.int
    INPUT_FIELD_NUMBER: builtins.int
    OFFSET_FIELD_NUMBER: builtins.int
    OFFSET_EXPR_FIELD_NUMBER: builtins.int
    COUNT_FIELD_NUMBER: builtins.int
    COUNT_EXPR_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    offset: builtins.int
    """the offset expressed in number of records
    Deprecated: use `offset_expr` instead
    """
    count: builtins.int
    """the amount of records to return
    use -1 to signal that ALL records should be returned
    Deprecated: use `count_expr` instead
    """
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def input(self) -> Global___Rel: ...
    @property
    def offset_expr(self) -> Global___Expression:
        """Expression evaluated into a non-negative integer specifying the number
        of records to skip. An expression evaluating to null is treated as 0.
        Evaluating to a negative integer should result in an error.
        Recommended type for offset is int64.
        """

    @property
    def count_expr(self) -> Global___Expression:
        """Expression evaluated into a non-negative integer specifying the number
        of records to return. An expression evaluating to null signals that ALL
        records should be returned.
        Evaluating to a negative integer should result in an error.
        Recommended type for count is int64.
        """

    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        input: Global___Rel | None = ...,
        offset: builtins.int = ...,
        offset_expr: Global___Expression | None = ...,
        count: builtins.int = ...,
        count_expr: Global___Expression | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "count", b"count", "count_expr", b"count_expr", "count_mode", b"count_mode", "input", b"input", "offset", b"offset", "offset_expr", b"offset_expr", "offset_mode", b"offset_mode"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "count", b"count", "count_expr", b"count_expr", "count_mode", b"count_mode", "input", b"input", "offset", b"offset", "offset_expr", b"offset_expr", "offset_mode", b"offset_mode"]) -> None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing.Literal["count_mode", b"count_mode"]) -> typing.Literal["count", "count_expr"] | None: ...
    @typing.overload
    def WhichOneof(self, oneof_group: typing.Literal["offset_mode", b"offset_mode"]) -> typing.Literal["offset", "offset_expr"] | None: ...

Global___FetchRel: typing_extensions.TypeAlias = FetchRel

@typing.final
class AggregateRel(google.protobuf.message.Message):
    """The relational operator representing a GROUP BY Aggregate"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    @typing.final
    class Grouping(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        GROUPING_EXPRESSIONS_FIELD_NUMBER: builtins.int
        EXPRESSION_REFERENCES_FIELD_NUMBER: builtins.int
        @property
        def grouping_expressions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]:
            """Deprecated in favor of `expression_references` below."""

        @property
        def expression_references(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
            """A list of zero or more references to grouping expressions, i.e., indices
            into the `grouping_expression` list.
            """

        def __init__(
            self,
            *,
            grouping_expressions: collections.abc.Iterable[Global___Expression] | None = ...,
            expression_references: collections.abc.Iterable[builtins.int] | None = ...,
        ) -> None: ...
        def ClearField(self, field_name: typing.Literal["expression_references", b"expression_references", "grouping_expressions", b"grouping_expressions"]) -> None: ...

    @typing.final
    class Measure(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        MEASURE_FIELD_NUMBER: builtins.int
        FILTER_FIELD_NUMBER: builtins.int
        @property
        def measure(self) -> Global___AggregateFunction: ...
        @property
        def filter(self) -> Global___Expression:
            """An optional boolean expression that acts to filter which records are
            included in the measure. True means include this record for calculation
            within the measure.
            Helps to support SUM(<c>) FILTER(WHERE...) syntax without masking opportunities for optimization
            """

        def __init__(
            self,
            *,
            measure: Global___AggregateFunction | None = ...,
            filter: Global___Expression | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["filter", b"filter", "measure", b"measure"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["filter", b"filter", "measure", b"measure"]) -> None: ...

    COMMON_FIELD_NUMBER: builtins.int
    INPUT_FIELD_NUMBER: builtins.int
    GROUPINGS_FIELD_NUMBER: builtins.int
    MEASURES_FIELD_NUMBER: builtins.int
    GROUPING_EXPRESSIONS_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def input(self) -> Global___Rel:
        """Input of the aggregation"""

    @property
    def groupings(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___AggregateRel.Grouping]:
        """A list of zero or more grouping sets that the aggregation measures should
        be calculated for. There must be at least one grouping set if there are no
        measures (but it can be the empty grouping set).
        """

    @property
    def measures(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___AggregateRel.Measure]:
        """A list of one or more aggregate expressions along with an optional filter.
        Required if there are no groupings.
        """

    @property
    def grouping_expressions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]:
        """A list of zero or more grouping expressions that grouping sets (i.e.,
        `Grouping` messages in the `groupings` field) can reference. Each
        expression in this list must be referred to by at least one
        `Grouping.expression_references`.
        """

    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        input: Global___Rel | None = ...,
        groupings: collections.abc.Iterable[Global___AggregateRel.Grouping] | None = ...,
        measures: collections.abc.Iterable[Global___AggregateRel.Measure] | None = ...,
        grouping_expressions: collections.abc.Iterable[Global___Expression] | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "input", b"input"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "grouping_expressions", b"grouping_expressions", "groupings", b"groupings", "input", b"input", "measures", b"measures"]) -> None: ...

Global___AggregateRel: typing_extensions.TypeAlias = AggregateRel

@typing.final
class ConsistentPartitionWindowRel(google.protobuf.message.Message):
    """ConsistentPartitionWindowRel provides the ability to perform calculations across sets of rows
    that are related to the current query row. It can be used to execute window functions where
    all the windows share the same partitioning and ordering.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    @typing.final
    class WindowRelFunction(google.protobuf.message.Message):
        """This message mirrors the `WindowFunction` message but removes the fields defining the partition,
        sorts, and bounds, since those must be consistent across the various functions in this rel.  Refer
        to the `WindowFunction` message for a description of these fields.
        """

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        FUNCTION_REFERENCE_FIELD_NUMBER: builtins.int
        ARGUMENTS_FIELD_NUMBER: builtins.int
        OPTIONS_FIELD_NUMBER: builtins.int
        OUTPUT_TYPE_FIELD_NUMBER: builtins.int
        PHASE_FIELD_NUMBER: builtins.int
        INVOCATION_FIELD_NUMBER: builtins.int
        LOWER_BOUND_FIELD_NUMBER: builtins.int
        UPPER_BOUND_FIELD_NUMBER: builtins.int
        BOUNDS_TYPE_FIELD_NUMBER: builtins.int
        function_reference: builtins.int
        """References a function_anchor defined in this plan."""
        phase: Global___AggregationPhase.ValueType
        invocation: Global___AggregateFunction.AggregationInvocation.ValueType
        bounds_type: Global___Expression.WindowFunction.BoundsType.ValueType
        @property
        def arguments(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___FunctionArgument]: ...
        @property
        def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___FunctionOption]: ...
        @property
        def output_type(self) -> substrait.type_pb2.Type: ...
        @property
        def lower_bound(self) -> Global___Expression.WindowFunction.Bound: ...
        @property
        def upper_bound(self) -> Global___Expression.WindowFunction.Bound: ...
        def __init__(
            self,
            *,
            function_reference: builtins.int = ...,
            arguments: collections.abc.Iterable[Global___FunctionArgument] | None = ...,
            options: collections.abc.Iterable[Global___FunctionOption] | None = ...,
            output_type: substrait.type_pb2.Type | None = ...,
            phase: Global___AggregationPhase.ValueType = ...,
            invocation: Global___AggregateFunction.AggregationInvocation.ValueType = ...,
            lower_bound: Global___Expression.WindowFunction.Bound | None = ...,
            upper_bound: Global___Expression.WindowFunction.Bound | None = ...,
            bounds_type: Global___Expression.WindowFunction.BoundsType.ValueType = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["lower_bound", b"lower_bound", "output_type", b"output_type", "upper_bound", b"upper_bound"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["arguments", b"arguments", "bounds_type", b"bounds_type", "function_reference", b"function_reference", "invocation", b"invocation", "lower_bound", b"lower_bound", "options", b"options", "output_type", b"output_type", "phase", b"phase", "upper_bound", b"upper_bound"]) -> None: ...

    COMMON_FIELD_NUMBER: builtins.int
    INPUT_FIELD_NUMBER: builtins.int
    WINDOW_FUNCTIONS_FIELD_NUMBER: builtins.int
    PARTITION_EXPRESSIONS_FIELD_NUMBER: builtins.int
    SORTS_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def input(self) -> Global___Rel: ...
    @property
    def window_functions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___ConsistentPartitionWindowRel.WindowRelFunction]: ...
    @property
    def partition_expressions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]: ...
    @property
    def sorts(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___SortField]: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        input: Global___Rel | None = ...,
        window_functions: collections.abc.Iterable[Global___ConsistentPartitionWindowRel.WindowRelFunction] | None = ...,
        partition_expressions: collections.abc.Iterable[Global___Expression] | None = ...,
        sorts: collections.abc.Iterable[Global___SortField] | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "input", b"input"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "input", b"input", "partition_expressions", b"partition_expressions", "sorts", b"sorts", "window_functions", b"window_functions"]) -> None: ...

Global___ConsistentPartitionWindowRel: typing_extensions.TypeAlias = ConsistentPartitionWindowRel

@typing.final
class SortRel(google.protobuf.message.Message):
    """The ORDERY BY (or sorting) relational operator. Beside describing a base relation, it includes a list of fields to sort on"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    COMMON_FIELD_NUMBER: builtins.int
    INPUT_FIELD_NUMBER: builtins.int
    SORTS_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def input(self) -> Global___Rel: ...
    @property
    def sorts(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___SortField]: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        input: Global___Rel | None = ...,
        sorts: collections.abc.Iterable[Global___SortField] | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "input", b"input"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "input", b"input", "sorts", b"sorts"]) -> None: ...

Global___SortRel: typing_extensions.TypeAlias = SortRel

@typing.final
class FilterRel(google.protobuf.message.Message):
    """The relational operator capturing simple FILTERs (as in the WHERE clause of SQL)"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    COMMON_FIELD_NUMBER: builtins.int
    INPUT_FIELD_NUMBER: builtins.int
    CONDITION_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def input(self) -> Global___Rel: ...
    @property
    def condition(self) -> Global___Expression: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        input: Global___Rel | None = ...,
        condition: Global___Expression | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "condition", b"condition", "input", b"input"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "condition", b"condition", "input", b"input"]) -> None: ...

Global___FilterRel: typing_extensions.TypeAlias = FilterRel

@typing.final
class SetRel(google.protobuf.message.Message):
    """The relational set operators (intersection/union/etc..)"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _SetOp:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _SetOpEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[SetRel._SetOp.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        SET_OP_UNSPECIFIED: SetRel._SetOp.ValueType  # 0
        SET_OP_MINUS_PRIMARY: SetRel._SetOp.ValueType  # 1
        SET_OP_MINUS_PRIMARY_ALL: SetRel._SetOp.ValueType  # 7
        SET_OP_MINUS_MULTISET: SetRel._SetOp.ValueType  # 2
        SET_OP_INTERSECTION_PRIMARY: SetRel._SetOp.ValueType  # 3
        SET_OP_INTERSECTION_MULTISET: SetRel._SetOp.ValueType  # 4
        SET_OP_INTERSECTION_MULTISET_ALL: SetRel._SetOp.ValueType  # 8
        SET_OP_UNION_DISTINCT: SetRel._SetOp.ValueType  # 5
        SET_OP_UNION_ALL: SetRel._SetOp.ValueType  # 6

    class SetOp(_SetOp, metaclass=_SetOpEnumTypeWrapper): ...
    SET_OP_UNSPECIFIED: SetRel.SetOp.ValueType  # 0
    SET_OP_MINUS_PRIMARY: SetRel.SetOp.ValueType  # 1
    SET_OP_MINUS_PRIMARY_ALL: SetRel.SetOp.ValueType  # 7
    SET_OP_MINUS_MULTISET: SetRel.SetOp.ValueType  # 2
    SET_OP_INTERSECTION_PRIMARY: SetRel.SetOp.ValueType  # 3
    SET_OP_INTERSECTION_MULTISET: SetRel.SetOp.ValueType  # 4
    SET_OP_INTERSECTION_MULTISET_ALL: SetRel.SetOp.ValueType  # 8
    SET_OP_UNION_DISTINCT: SetRel.SetOp.ValueType  # 5
    SET_OP_UNION_ALL: SetRel.SetOp.ValueType  # 6

    COMMON_FIELD_NUMBER: builtins.int
    INPUTS_FIELD_NUMBER: builtins.int
    OP_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    op: Global___SetRel.SetOp.ValueType
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def inputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Rel]:
        """The first input is the primary input, the remaining are secondary
        inputs.  There must be at least two inputs.
        """

    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        inputs: collections.abc.Iterable[Global___Rel] | None = ...,
        op: Global___SetRel.SetOp.ValueType = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "inputs", b"inputs", "op", b"op"]) -> None: ...

Global___SetRel: typing_extensions.TypeAlias = SetRel

@typing.final
class ExtensionSingleRel(google.protobuf.message.Message):
    """Stub to support extension with a single input"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    COMMON_FIELD_NUMBER: builtins.int
    INPUT_FIELD_NUMBER: builtins.int
    DETAIL_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def input(self) -> Global___Rel: ...
    @property
    def detail(self) -> google.protobuf.any_pb2.Any: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        input: Global___Rel | None = ...,
        detail: google.protobuf.any_pb2.Any | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["common", b"common", "detail", b"detail", "input", b"input"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["common", b"common", "detail", b"detail", "input", b"input"]) -> None: ...

Global___ExtensionSingleRel: typing_extensions.TypeAlias = ExtensionSingleRel

@typing.final
class ExtensionLeafRel(google.protobuf.message.Message):
    """Stub to support extension with a zero inputs"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    COMMON_FIELD_NUMBER: builtins.int
    DETAIL_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def detail(self) -> google.protobuf.any_pb2.Any: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        detail: google.protobuf.any_pb2.Any | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["common", b"common", "detail", b"detail"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["common", b"common", "detail", b"detail"]) -> None: ...

Global___ExtensionLeafRel: typing_extensions.TypeAlias = ExtensionLeafRel

@typing.final
class ExtensionMultiRel(google.protobuf.message.Message):
    """Stub to support extension with multiple inputs"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    COMMON_FIELD_NUMBER: builtins.int
    INPUTS_FIELD_NUMBER: builtins.int
    DETAIL_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def inputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Rel]: ...
    @property
    def detail(self) -> google.protobuf.any_pb2.Any: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        inputs: collections.abc.Iterable[Global___Rel] | None = ...,
        detail: google.protobuf.any_pb2.Any | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["common", b"common", "detail", b"detail"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["common", b"common", "detail", b"detail", "inputs", b"inputs"]) -> None: ...

Global___ExtensionMultiRel: typing_extensions.TypeAlias = ExtensionMultiRel

@typing.final
class ExchangeRel(google.protobuf.message.Message):
    """A redistribution operation"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    @typing.final
    class ScatterFields(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        FIELDS_FIELD_NUMBER: builtins.int
        @property
        def fields(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.FieldReference]: ...
        def __init__(
            self,
            *,
            fields: collections.abc.Iterable[Global___Expression.FieldReference] | None = ...,
        ) -> None: ...
        def ClearField(self, field_name: typing.Literal["fields", b"fields"]) -> None: ...

    @typing.final
    class SingleBucketExpression(google.protobuf.message.Message):
        """Returns a single bucket number per record."""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        EXPRESSION_FIELD_NUMBER: builtins.int
        @property
        def expression(self) -> Global___Expression: ...
        def __init__(
            self,
            *,
            expression: Global___Expression | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["expression", b"expression"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["expression", b"expression"]) -> None: ...

    @typing.final
    class MultiBucketExpression(google.protobuf.message.Message):
        """Returns zero or more bucket numbers per record"""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        EXPRESSION_FIELD_NUMBER: builtins.int
        CONSTRAINED_TO_COUNT_FIELD_NUMBER: builtins.int
        constrained_to_count: builtins.bool
        @property
        def expression(self) -> Global___Expression: ...
        def __init__(
            self,
            *,
            expression: Global___Expression | None = ...,
            constrained_to_count: builtins.bool = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["expression", b"expression"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["constrained_to_count", b"constrained_to_count", "expression", b"expression"]) -> None: ...

    @typing.final
    class Broadcast(google.protobuf.message.Message):
        """Send all data to every target."""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        def __init__(
            self,
        ) -> None: ...

    @typing.final
    class RoundRobin(google.protobuf.message.Message):
        """Route approximately"""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        EXACT_FIELD_NUMBER: builtins.int
        exact: builtins.bool
        """whether the round robin behavior is required to exact (per record) or
        approximate. Defaults to approximate.
        """
        def __init__(
            self,
            *,
            exact: builtins.bool = ...,
        ) -> None: ...
        def ClearField(self, field_name: typing.Literal["exact", b"exact"]) -> None: ...

    @typing.final
    class ExchangeTarget(google.protobuf.message.Message):
        """The message to describe partition targets of an exchange"""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        PARTITION_ID_FIELD_NUMBER: builtins.int
        URI_FIELD_NUMBER: builtins.int
        EXTENDED_FIELD_NUMBER: builtins.int
        uri: builtins.str
        @property
        def partition_id(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
            """Describes the partition id(s) to send. If this is empty, all data is sent
            to this target.
            """

        @property
        def extended(self) -> google.protobuf.any_pb2.Any: ...
        def __init__(
            self,
            *,
            partition_id: collections.abc.Iterable[builtins.int] | None = ...,
            uri: builtins.str = ...,
            extended: google.protobuf.any_pb2.Any | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["extended", b"extended", "target_type", b"target_type", "uri", b"uri"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["extended", b"extended", "partition_id", b"partition_id", "target_type", b"target_type", "uri", b"uri"]) -> None: ...
        def WhichOneof(self, oneof_group: typing.Literal["target_type", b"target_type"]) -> typing.Literal["uri", "extended"] | None: ...

    COMMON_FIELD_NUMBER: builtins.int
    INPUT_FIELD_NUMBER: builtins.int
    PARTITION_COUNT_FIELD_NUMBER: builtins.int
    TARGETS_FIELD_NUMBER: builtins.int
    SCATTER_BY_FIELDS_FIELD_NUMBER: builtins.int
    SINGLE_TARGET_FIELD_NUMBER: builtins.int
    MULTI_TARGET_FIELD_NUMBER: builtins.int
    ROUND_ROBIN_FIELD_NUMBER: builtins.int
    BROADCAST_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    partition_count: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def input(self) -> Global___Rel: ...
    @property
    def targets(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___ExchangeRel.ExchangeTarget]: ...
    @property
    def scatter_by_fields(self) -> Global___ExchangeRel.ScatterFields: ...
    @property
    def single_target(self) -> Global___ExchangeRel.SingleBucketExpression: ...
    @property
    def multi_target(self) -> Global___ExchangeRel.MultiBucketExpression: ...
    @property
    def round_robin(self) -> Global___ExchangeRel.RoundRobin: ...
    @property
    def broadcast(self) -> Global___ExchangeRel.Broadcast: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        input: Global___Rel | None = ...,
        partition_count: builtins.int = ...,
        targets: collections.abc.Iterable[Global___ExchangeRel.ExchangeTarget] | None = ...,
        scatter_by_fields: Global___ExchangeRel.ScatterFields | None = ...,
        single_target: Global___ExchangeRel.SingleBucketExpression | None = ...,
        multi_target: Global___ExchangeRel.MultiBucketExpression | None = ...,
        round_robin: Global___ExchangeRel.RoundRobin | None = ...,
        broadcast: Global___ExchangeRel.Broadcast | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "broadcast", b"broadcast", "common", b"common", "exchange_kind", b"exchange_kind", "input", b"input", "multi_target", b"multi_target", "round_robin", b"round_robin", "scatter_by_fields", b"scatter_by_fields", "single_target", b"single_target"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "broadcast", b"broadcast", "common", b"common", "exchange_kind", b"exchange_kind", "input", b"input", "multi_target", b"multi_target", "partition_count", b"partition_count", "round_robin", b"round_robin", "scatter_by_fields", b"scatter_by_fields", "single_target", b"single_target", "targets", b"targets"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["exchange_kind", b"exchange_kind"]) -> typing.Literal["scatter_by_fields", "single_target", "multi_target", "round_robin", "broadcast"] | None: ...

Global___ExchangeRel: typing_extensions.TypeAlias = ExchangeRel

@typing.final
class ExpandRel(google.protobuf.message.Message):
    """Duplicates records by emitting one or more rows per input row.  The number of rows emitted per
    input row is the same for all input rows.

    In addition to a field being emitted per input field an extra int64 field is emitted which
    contains a zero-indexed ordinal corresponding to the duplicate definition.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    @typing.final
    class ExpandField(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        SWITCHING_FIELD_FIELD_NUMBER: builtins.int
        CONSISTENT_FIELD_FIELD_NUMBER: builtins.int
        @property
        def switching_field(self) -> Global___ExpandRel.SwitchingField:
            """Field that switches output based on which duplicate is being output.  Every
            switching_field should contain the same number of duplicates (so that the output rows
            are of consistent size and type).  If there are not enough switching field definitions
            to match the other field definitions NULL will be returned to fill the extras.
            """

        @property
        def consistent_field(self) -> Global___Expression:
            """Field that outputs the same value no matter which duplicate is being output.  Equivalent
            to a switching_field that lists the same expression multiple times.
            """

        def __init__(
            self,
            *,
            switching_field: Global___ExpandRel.SwitchingField | None = ...,
            consistent_field: Global___Expression | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["consistent_field", b"consistent_field", "field_type", b"field_type", "switching_field", b"switching_field"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["consistent_field", b"consistent_field", "field_type", b"field_type", "switching_field", b"switching_field"]) -> None: ...
        def WhichOneof(self, oneof_group: typing.Literal["field_type", b"field_type"]) -> typing.Literal["switching_field", "consistent_field"] | None: ...

    @typing.final
    class SwitchingField(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        DUPLICATES_FIELD_NUMBER: builtins.int
        @property
        def duplicates(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]:
            """All duplicates must return the same type class but may differ in nullability.  The effective
            type of the output field will be nullable if any of the duplicate expressions are nullable.
            """

        def __init__(
            self,
            *,
            duplicates: collections.abc.Iterable[Global___Expression] | None = ...,
        ) -> None: ...
        def ClearField(self, field_name: typing.Literal["duplicates", b"duplicates"]) -> None: ...

    COMMON_FIELD_NUMBER: builtins.int
    INPUT_FIELD_NUMBER: builtins.int
    FIELDS_FIELD_NUMBER: builtins.int
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def input(self) -> Global___Rel: ...
    @property
    def fields(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___ExpandRel.ExpandField]:
        """There should be one definition here for each input field.  Any fields beyond the provided
        definitions will be emitted as is (as if a consistent_field record with an identity
        expression was provided).
        """

    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        input: Global___Rel | None = ...,
        fields: collections.abc.Iterable[Global___ExpandRel.ExpandField] | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["common", b"common", "input", b"input"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["common", b"common", "fields", b"fields", "input", b"input"]) -> None: ...

Global___ExpandRel: typing_extensions.TypeAlias = ExpandRel

@typing.final
class RelRoot(google.protobuf.message.Message):
    """A relation with output field names.

    This is for use at the root of a `Rel` tree.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    INPUT_FIELD_NUMBER: builtins.int
    NAMES_FIELD_NUMBER: builtins.int
    @property
    def input(self) -> Global___Rel:
        """A relation"""

    @property
    def names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """Field names in depth-first order"""

    def __init__(
        self,
        *,
        input: Global___Rel | None = ...,
        names: collections.abc.Iterable[builtins.str] | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["input", b"input"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["input", b"input", "names", b"names"]) -> None: ...

Global___RelRoot: typing_extensions.TypeAlias = RelRoot

@typing.final
class Rel(google.protobuf.message.Message):
    """A relation (used internally in a plan)"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    READ_FIELD_NUMBER: builtins.int
    FILTER_FIELD_NUMBER: builtins.int
    FETCH_FIELD_NUMBER: builtins.int
    AGGREGATE_FIELD_NUMBER: builtins.int
    SORT_FIELD_NUMBER: builtins.int
    JOIN_FIELD_NUMBER: builtins.int
    PROJECT_FIELD_NUMBER: builtins.int
    SET_FIELD_NUMBER: builtins.int
    EXTENSION_SINGLE_FIELD_NUMBER: builtins.int
    EXTENSION_MULTI_FIELD_NUMBER: builtins.int
    EXTENSION_LEAF_FIELD_NUMBER: builtins.int
    CROSS_FIELD_NUMBER: builtins.int
    REFERENCE_FIELD_NUMBER: builtins.int
    WRITE_FIELD_NUMBER: builtins.int
    DDL_FIELD_NUMBER: builtins.int
    UPDATE_FIELD_NUMBER: builtins.int
    HASH_JOIN_FIELD_NUMBER: builtins.int
    MERGE_JOIN_FIELD_NUMBER: builtins.int
    NESTED_LOOP_JOIN_FIELD_NUMBER: builtins.int
    WINDOW_FIELD_NUMBER: builtins.int
    EXCHANGE_FIELD_NUMBER: builtins.int
    EXPAND_FIELD_NUMBER: builtins.int
    @property
    def read(self) -> Global___ReadRel: ...
    @property
    def filter(self) -> Global___FilterRel: ...
    @property
    def fetch(self) -> Global___FetchRel: ...
    @property
    def aggregate(self) -> Global___AggregateRel: ...
    @property
    def sort(self) -> Global___SortRel: ...
    @property
    def join(self) -> Global___JoinRel: ...
    @property
    def project(self) -> Global___ProjectRel: ...
    @property
    def set(self) -> Global___SetRel: ...
    @property
    def extension_single(self) -> Global___ExtensionSingleRel: ...
    @property
    def extension_multi(self) -> Global___ExtensionMultiRel: ...
    @property
    def extension_leaf(self) -> Global___ExtensionLeafRel: ...
    @property
    def cross(self) -> Global___CrossRel: ...
    @property
    def reference(self) -> Global___ReferenceRel: ...
    @property
    def write(self) -> Global___WriteRel: ...
    @property
    def ddl(self) -> Global___DdlRel: ...
    @property
    def update(self) -> Global___UpdateRel: ...
    @property
    def hash_join(self) -> Global___HashJoinRel:
        """Physical relations"""

    @property
    def merge_join(self) -> Global___MergeJoinRel: ...
    @property
    def nested_loop_join(self) -> Global___NestedLoopJoinRel: ...
    @property
    def window(self) -> Global___ConsistentPartitionWindowRel: ...
    @property
    def exchange(self) -> Global___ExchangeRel: ...
    @property
    def expand(self) -> Global___ExpandRel: ...
    def __init__(
        self,
        *,
        read: Global___ReadRel | None = ...,
        filter: Global___FilterRel | None = ...,
        fetch: Global___FetchRel | None = ...,
        aggregate: Global___AggregateRel | None = ...,
        sort: Global___SortRel | None = ...,
        join: Global___JoinRel | None = ...,
        project: Global___ProjectRel | None = ...,
        set: Global___SetRel | None = ...,
        extension_single: Global___ExtensionSingleRel | None = ...,
        extension_multi: Global___ExtensionMultiRel | None = ...,
        extension_leaf: Global___ExtensionLeafRel | None = ...,
        cross: Global___CrossRel | None = ...,
        reference: Global___ReferenceRel | None = ...,
        write: Global___WriteRel | None = ...,
        ddl: Global___DdlRel | None = ...,
        update: Global___UpdateRel | None = ...,
        hash_join: Global___HashJoinRel | None = ...,
        merge_join: Global___MergeJoinRel | None = ...,
        nested_loop_join: Global___NestedLoopJoinRel | None = ...,
        window: Global___ConsistentPartitionWindowRel | None = ...,
        exchange: Global___ExchangeRel | None = ...,
        expand: Global___ExpandRel | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["aggregate", b"aggregate", "cross", b"cross", "ddl", b"ddl", "exchange", b"exchange", "expand", b"expand", "extension_leaf", b"extension_leaf", "extension_multi", b"extension_multi", "extension_single", b"extension_single", "fetch", b"fetch", "filter", b"filter", "hash_join", b"hash_join", "join", b"join", "merge_join", b"merge_join", "nested_loop_join", b"nested_loop_join", "project", b"project", "read", b"read", "reference", b"reference", "rel_type", b"rel_type", "set", b"set", "sort", b"sort", "update", b"update", "window", b"window", "write", b"write"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["aggregate", b"aggregate", "cross", b"cross", "ddl", b"ddl", "exchange", b"exchange", "expand", b"expand", "extension_leaf", b"extension_leaf", "extension_multi", b"extension_multi", "extension_single", b"extension_single", "fetch", b"fetch", "filter", b"filter", "hash_join", b"hash_join", "join", b"join", "merge_join", b"merge_join", "nested_loop_join", b"nested_loop_join", "project", b"project", "read", b"read", "reference", b"reference", "rel_type", b"rel_type", "set", b"set", "sort", b"sort", "update", b"update", "window", b"window", "write", b"write"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["rel_type", b"rel_type"]) -> typing.Literal["read", "filter", "fetch", "aggregate", "sort", "join", "project", "set", "extension_single", "extension_multi", "extension_leaf", "cross", "reference", "write", "ddl", "update", "hash_join", "merge_join", "nested_loop_join", "window", "exchange", "expand"] | None: ...

Global___Rel: typing_extensions.TypeAlias = Rel

@typing.final
class NamedObjectWrite(google.protobuf.message.Message):
    """A base object for writing (e.g., a table or a view)."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    NAMES_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    @property
    def names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """The list of string is used to represent namespacing (e.g., mydb.mytable).
        This assumes shared catalog between systems exchanging a message.
        """

    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        names: collections.abc.Iterable[builtins.str] | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "names", b"names"]) -> None: ...

Global___NamedObjectWrite: typing_extensions.TypeAlias = NamedObjectWrite

@typing.final
class ExtensionObject(google.protobuf.message.Message):
    """A stub type that can be used to extend/introduce new table types outside
    the specification.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    DETAIL_FIELD_NUMBER: builtins.int
    @property
    def detail(self) -> google.protobuf.any_pb2.Any: ...
    def __init__(
        self,
        *,
        detail: google.protobuf.any_pb2.Any | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["detail", b"detail"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["detail", b"detail"]) -> None: ...

Global___ExtensionObject: typing_extensions.TypeAlias = ExtensionObject

@typing.final
class DdlRel(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _DdlObject:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _DdlObjectEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DdlRel._DdlObject.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        DDL_OBJECT_UNSPECIFIED: DdlRel._DdlObject.ValueType  # 0
        DDL_OBJECT_TABLE: DdlRel._DdlObject.ValueType  # 1
        """A Table object in the system"""
        DDL_OBJECT_VIEW: DdlRel._DdlObject.ValueType  # 2
        """A View object in the system"""

    class DdlObject(_DdlObject, metaclass=_DdlObjectEnumTypeWrapper): ...
    DDL_OBJECT_UNSPECIFIED: DdlRel.DdlObject.ValueType  # 0
    DDL_OBJECT_TABLE: DdlRel.DdlObject.ValueType  # 1
    """A Table object in the system"""
    DDL_OBJECT_VIEW: DdlRel.DdlObject.ValueType  # 2
    """A View object in the system"""

    class _DdlOp:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _DdlOpEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DdlRel._DdlOp.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        DDL_OP_UNSPECIFIED: DdlRel._DdlOp.ValueType  # 0
        DDL_OP_CREATE: DdlRel._DdlOp.ValueType  # 1
        """A create operation (for any object)"""
        DDL_OP_CREATE_OR_REPLACE: DdlRel._DdlOp.ValueType  # 2
        """A create operation if the object does not exist, or replaces it (equivalent to a DROP + CREATE) if the object already exists"""
        DDL_OP_ALTER: DdlRel._DdlOp.ValueType  # 3
        """An operation that modifies the schema (e.g., column names, types, default values) for the target object"""
        DDL_OP_DROP: DdlRel._DdlOp.ValueType  # 4
        """An operation that removes an object from the system"""
        DDL_OP_DROP_IF_EXIST: DdlRel._DdlOp.ValueType  # 5
        """An operation that removes an object from the system (without throwing an exception if the object did not exist)"""

    class DdlOp(_DdlOp, metaclass=_DdlOpEnumTypeWrapper): ...
    DDL_OP_UNSPECIFIED: DdlRel.DdlOp.ValueType  # 0
    DDL_OP_CREATE: DdlRel.DdlOp.ValueType  # 1
    """A create operation (for any object)"""
    DDL_OP_CREATE_OR_REPLACE: DdlRel.DdlOp.ValueType  # 2
    """A create operation if the object does not exist, or replaces it (equivalent to a DROP + CREATE) if the object already exists"""
    DDL_OP_ALTER: DdlRel.DdlOp.ValueType  # 3
    """An operation that modifies the schema (e.g., column names, types, default values) for the target object"""
    DDL_OP_DROP: DdlRel.DdlOp.ValueType  # 4
    """An operation that removes an object from the system"""
    DDL_OP_DROP_IF_EXIST: DdlRel.DdlOp.ValueType  # 5
    """An operation that removes an object from the system (without throwing an exception if the object did not exist)"""

    NAMED_OBJECT_FIELD_NUMBER: builtins.int
    EXTENSION_OBJECT_FIELD_NUMBER: builtins.int
    TABLE_SCHEMA_FIELD_NUMBER: builtins.int
    TABLE_DEFAULTS_FIELD_NUMBER: builtins.int
    OBJECT_FIELD_NUMBER: builtins.int
    OP_FIELD_NUMBER: builtins.int
    VIEW_DEFINITION_FIELD_NUMBER: builtins.int
    COMMON_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    object: Global___DdlRel.DdlObject.ValueType
    """Which type of object we operate on"""
    op: Global___DdlRel.DdlOp.ValueType
    """The type of operation to perform"""
    @property
    def named_object(self) -> Global___NamedObjectWrite: ...
    @property
    def extension_object(self) -> Global___ExtensionObject: ...
    @property
    def table_schema(self) -> substrait.type_pb2.NamedStruct:
        """The columns that will be modified (representing after-image of a schema change)"""

    @property
    def table_defaults(self) -> Global___Expression.Literal.Struct:
        """The default values for the columns (representing after-image of a schema change)
        E.g., in case of an ALTER TABLE that changes some of the column default values, we expect
        the table_defaults Struct to report a full list of default values reflecting the result of applying
        the ALTER TABLE operator successfully
        """

    @property
    def view_definition(self) -> Global___Rel:
        """The body of the CREATE VIEW"""

    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        named_object: Global___NamedObjectWrite | None = ...,
        extension_object: Global___ExtensionObject | None = ...,
        table_schema: substrait.type_pb2.NamedStruct | None = ...,
        table_defaults: Global___Expression.Literal.Struct | None = ...,
        object: Global___DdlRel.DdlObject.ValueType = ...,
        op: Global___DdlRel.DdlOp.ValueType = ...,
        view_definition: Global___Rel | None = ...,
        common: Global___RelCommon | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "extension_object", b"extension_object", "named_object", b"named_object", "table_defaults", b"table_defaults", "table_schema", b"table_schema", "view_definition", b"view_definition", "write_type", b"write_type"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "extension_object", b"extension_object", "named_object", b"named_object", "object", b"object", "op", b"op", "table_defaults", b"table_defaults", "table_schema", b"table_schema", "view_definition", b"view_definition", "write_type", b"write_type"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["write_type", b"write_type"]) -> typing.Literal["named_object", "extension_object"] | None: ...

Global___DdlRel: typing_extensions.TypeAlias = DdlRel

@typing.final
class WriteRel(google.protobuf.message.Message):
    """The operator that modifies the content of a database (operates on 1 table at a time, but record-selection/source can be
    based on joining of multiple tables).
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _WriteOp:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _WriteOpEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[WriteRel._WriteOp.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        WRITE_OP_UNSPECIFIED: WriteRel._WriteOp.ValueType  # 0
        WRITE_OP_INSERT: WriteRel._WriteOp.ValueType  # 1
        """The insert of new records in a table"""
        WRITE_OP_DELETE: WriteRel._WriteOp.ValueType  # 2
        """The removal of records from a table"""
        WRITE_OP_UPDATE: WriteRel._WriteOp.ValueType  # 3
        """The modification of existing records within a table"""
        WRITE_OP_CTAS: WriteRel._WriteOp.ValueType  # 4
        """The Creation of a new table, and the insert of new records in the table"""

    class WriteOp(_WriteOp, metaclass=_WriteOpEnumTypeWrapper): ...
    WRITE_OP_UNSPECIFIED: WriteRel.WriteOp.ValueType  # 0
    WRITE_OP_INSERT: WriteRel.WriteOp.ValueType  # 1
    """The insert of new records in a table"""
    WRITE_OP_DELETE: WriteRel.WriteOp.ValueType  # 2
    """The removal of records from a table"""
    WRITE_OP_UPDATE: WriteRel.WriteOp.ValueType  # 3
    """The modification of existing records within a table"""
    WRITE_OP_CTAS: WriteRel.WriteOp.ValueType  # 4
    """The Creation of a new table, and the insert of new records in the table"""

    class _CreateMode:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _CreateModeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[WriteRel._CreateMode.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        CREATE_MODE_UNSPECIFIED: WriteRel._CreateMode.ValueType  # 0
        CREATE_MODE_APPEND_IF_EXISTS: WriteRel._CreateMode.ValueType  # 1
        """Append the data to the table if it already exists"""
        CREATE_MODE_REPLACE_IF_EXISTS: WriteRel._CreateMode.ValueType  # 2
        """Replace the table if it already exists ("OR REPLACE")"""
        CREATE_MODE_IGNORE_IF_EXISTS: WriteRel._CreateMode.ValueType  # 3
        """Ignore the request if the table already exists ("IF NOT EXISTS")"""
        CREATE_MODE_ERROR_IF_EXISTS: WriteRel._CreateMode.ValueType  # 4
        """Throw an error if the table already exists (default behavior)"""

    class CreateMode(_CreateMode, metaclass=_CreateModeEnumTypeWrapper): ...
    CREATE_MODE_UNSPECIFIED: WriteRel.CreateMode.ValueType  # 0
    CREATE_MODE_APPEND_IF_EXISTS: WriteRel.CreateMode.ValueType  # 1
    """Append the data to the table if it already exists"""
    CREATE_MODE_REPLACE_IF_EXISTS: WriteRel.CreateMode.ValueType  # 2
    """Replace the table if it already exists ("OR REPLACE")"""
    CREATE_MODE_IGNORE_IF_EXISTS: WriteRel.CreateMode.ValueType  # 3
    """Ignore the request if the table already exists ("IF NOT EXISTS")"""
    CREATE_MODE_ERROR_IF_EXISTS: WriteRel.CreateMode.ValueType  # 4
    """Throw an error if the table already exists (default behavior)"""

    class _OutputMode:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _OutputModeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[WriteRel._OutputMode.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        OUTPUT_MODE_UNSPECIFIED: WriteRel._OutputMode.ValueType  # 0
        OUTPUT_MODE_NO_OUTPUT: WriteRel._OutputMode.ValueType  # 1
        """return no records at all"""
        OUTPUT_MODE_MODIFIED_RECORDS: WriteRel._OutputMode.ValueType  # 2
        """this mode makes the operator return all the record INSERTED/DELETED/UPDATED by the operator.
        The operator returns the AFTER-image of any change. This can be further manipulated by operators upstreams
        (e.g., retunring the typical "count of modified records").
        For scenarios in which the BEFORE image is required, the user must implement a spool (via references to
        subplans in the body of the Rel input) and return those with anounter PlanRel.relations.
        """

    class OutputMode(_OutputMode, metaclass=_OutputModeEnumTypeWrapper): ...
    OUTPUT_MODE_UNSPECIFIED: WriteRel.OutputMode.ValueType  # 0
    OUTPUT_MODE_NO_OUTPUT: WriteRel.OutputMode.ValueType  # 1
    """return no records at all"""
    OUTPUT_MODE_MODIFIED_RECORDS: WriteRel.OutputMode.ValueType  # 2
    """this mode makes the operator return all the record INSERTED/DELETED/UPDATED by the operator.
    The operator returns the AFTER-image of any change. This can be further manipulated by operators upstreams
    (e.g., retunring the typical "count of modified records").
    For scenarios in which the BEFORE image is required, the user must implement a spool (via references to
    subplans in the body of the Rel input) and return those with anounter PlanRel.relations.
    """

    NAMED_TABLE_FIELD_NUMBER: builtins.int
    EXTENSION_TABLE_FIELD_NUMBER: builtins.int
    TABLE_SCHEMA_FIELD_NUMBER: builtins.int
    OP_FIELD_NUMBER: builtins.int
    INPUT_FIELD_NUMBER: builtins.int
    CREATE_MODE_FIELD_NUMBER: builtins.int
    OUTPUT_FIELD_NUMBER: builtins.int
    COMMON_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    op: Global___WriteRel.WriteOp.ValueType
    """The type of operation to perform"""
    create_mode: Global___WriteRel.CreateMode.ValueType
    """Used with CTAS to determine what to do if the table already exists"""
    output: Global___WriteRel.OutputMode.ValueType
    """Output mode determines what is the output of executing this rel"""
    @property
    def named_table(self) -> Global___NamedObjectWrite: ...
    @property
    def extension_table(self) -> Global___ExtensionObject: ...
    @property
    def table_schema(self) -> substrait.type_pb2.NamedStruct:
        """The schema of the table (must align with Rel input (e.g., number of leaf fields must match))"""

    @property
    def input(self) -> Global___Rel:
        """The relation that determines the records to add/remove/modify
        the schema must match with table_schema. Default values must be explicitly stated
        in a ProjectRel at the top of the input. The match must also
        occur in case of DELETE to ensure multi-engine plans are unequivocal.
        """

    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        named_table: Global___NamedObjectWrite | None = ...,
        extension_table: Global___ExtensionObject | None = ...,
        table_schema: substrait.type_pb2.NamedStruct | None = ...,
        op: Global___WriteRel.WriteOp.ValueType = ...,
        input: Global___Rel | None = ...,
        create_mode: Global___WriteRel.CreateMode.ValueType = ...,
        output: Global___WriteRel.OutputMode.ValueType = ...,
        common: Global___RelCommon | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "extension_table", b"extension_table", "input", b"input", "named_table", b"named_table", "table_schema", b"table_schema", "write_type", b"write_type"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "create_mode", b"create_mode", "extension_table", b"extension_table", "input", b"input", "named_table", b"named_table", "op", b"op", "output", b"output", "table_schema", b"table_schema", "write_type", b"write_type"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["write_type", b"write_type"]) -> typing.Literal["named_table", "extension_table"] | None: ...

Global___WriteRel: typing_extensions.TypeAlias = WriteRel

@typing.final
class UpdateRel(google.protobuf.message.Message):
    """The operator that modifies the columns of a table"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    @typing.final
    class TransformExpression(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        TRANSFORMATION_FIELD_NUMBER: builtins.int
        COLUMN_TARGET_FIELD_NUMBER: builtins.int
        column_target: builtins.int
        """index of the column to apply the transformation to"""
        @property
        def transformation(self) -> Global___Expression:
            """the transformation to apply"""

        def __init__(
            self,
            *,
            transformation: Global___Expression | None = ...,
            column_target: builtins.int = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["transformation", b"transformation"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["column_target", b"column_target", "transformation", b"transformation"]) -> None: ...

    NAMED_TABLE_FIELD_NUMBER: builtins.int
    TABLE_SCHEMA_FIELD_NUMBER: builtins.int
    CONDITION_FIELD_NUMBER: builtins.int
    TRANSFORMATIONS_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    @property
    def named_table(self) -> Global___NamedTable: ...
    @property
    def table_schema(self) -> substrait.type_pb2.NamedStruct:
        """The full schema of the named_table"""

    @property
    def condition(self) -> Global___Expression:
        """condition to be met for the update to be applied on a record"""

    @property
    def transformations(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___UpdateRel.TransformExpression]:
        """The list of transformations to apply to the columns of the named_table"""

    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        named_table: Global___NamedTable | None = ...,
        table_schema: substrait.type_pb2.NamedStruct | None = ...,
        condition: Global___Expression | None = ...,
        transformations: collections.abc.Iterable[Global___UpdateRel.TransformExpression] | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "condition", b"condition", "named_table", b"named_table", "table_schema", b"table_schema", "update_type", b"update_type"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "condition", b"condition", "named_table", b"named_table", "table_schema", b"table_schema", "transformations", b"transformations", "update_type", b"update_type"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["update_type", b"update_type"]) -> typing.Literal["named_table"] | None: ...

Global___UpdateRel: typing_extensions.TypeAlias = UpdateRel

@typing.final
class NamedTable(google.protobuf.message.Message):
    """A base table. The list of string is used to represent namespacing (e.g., mydb.mytable).
    This assumes shared catalog between systems exchanging a message.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    NAMES_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    @property
    def names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        names: collections.abc.Iterable[builtins.str] | None = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "names", b"names"]) -> None: ...

Global___NamedTable: typing_extensions.TypeAlias = NamedTable

@typing.final
class ComparisonJoinKey(google.protobuf.message.Message):
    """Hash joins and merge joins are a specialization of the general join where the join
    expression is an series of comparisons between fields that are ANDed together.  The
    behavior of this comparison is flexible
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _SimpleComparisonType:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _SimpleComparisonTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ComparisonJoinKey._SimpleComparisonType.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        SIMPLE_COMPARISON_TYPE_UNSPECIFIED: ComparisonJoinKey._SimpleComparisonType.ValueType  # 0
        SIMPLE_COMPARISON_TYPE_EQ: ComparisonJoinKey._SimpleComparisonType.ValueType  # 1
        """Returns true only if both values are equal and not null"""
        SIMPLE_COMPARISON_TYPE_IS_NOT_DISTINCT_FROM: ComparisonJoinKey._SimpleComparisonType.ValueType  # 2
        """Returns true if both values are equal and not null
        Returns true if both values are null
        Returns false if one value is null and the other value is not null

        This can be expressed as a = b OR (isnull(a) AND isnull(b))
        """
        SIMPLE_COMPARISON_TYPE_MIGHT_EQUAL: ComparisonJoinKey._SimpleComparisonType.ValueType  # 3
        """Returns true if both values are equal and not null
        Returns true if either value is null

        This can be expressed as a = b OR isnull(a = b)
        """

    class SimpleComparisonType(_SimpleComparisonType, metaclass=_SimpleComparisonTypeEnumTypeWrapper):
        """Most joins will use one of the following behaviors.  To avoid the complexity
        of a function lookup we define the common behaviors here
        """

    SIMPLE_COMPARISON_TYPE_UNSPECIFIED: ComparisonJoinKey.SimpleComparisonType.ValueType  # 0
    SIMPLE_COMPARISON_TYPE_EQ: ComparisonJoinKey.SimpleComparisonType.ValueType  # 1
    """Returns true only if both values are equal and not null"""
    SIMPLE_COMPARISON_TYPE_IS_NOT_DISTINCT_FROM: ComparisonJoinKey.SimpleComparisonType.ValueType  # 2
    """Returns true if both values are equal and not null
    Returns true if both values are null
    Returns false if one value is null and the other value is not null

    This can be expressed as a = b OR (isnull(a) AND isnull(b))
    """
    SIMPLE_COMPARISON_TYPE_MIGHT_EQUAL: ComparisonJoinKey.SimpleComparisonType.ValueType  # 3
    """Returns true if both values are equal and not null
    Returns true if either value is null

    This can be expressed as a = b OR isnull(a = b)
    """

    @typing.final
    class ComparisonType(google.protobuf.message.Message):
        """Describes how the relation should consider if two rows are a match"""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        SIMPLE_FIELD_NUMBER: builtins.int
        CUSTOM_FUNCTION_REFERENCE_FIELD_NUMBER: builtins.int
        simple: Global___ComparisonJoinKey.SimpleComparisonType.ValueType
        """One of the simple comparison behaviors is used"""
        custom_function_reference: builtins.int
        """A custom comparison behavior is used.  This can happen, for example, when using
        collations, where we might want to do something like a case-insensitive comparison.

        This must be a binary function with a boolean return type.
        """
        def __init__(
            self,
            *,
            simple: Global___ComparisonJoinKey.SimpleComparisonType.ValueType = ...,
            custom_function_reference: builtins.int = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["custom_function_reference", b"custom_function_reference", "inner_type", b"inner_type", "simple", b"simple"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["custom_function_reference", b"custom_function_reference", "inner_type", b"inner_type", "simple", b"simple"]) -> None: ...
        def WhichOneof(self, oneof_group: typing.Literal["inner_type", b"inner_type"]) -> typing.Literal["simple", "custom_function_reference"] | None: ...

    LEFT_FIELD_NUMBER: builtins.int
    RIGHT_FIELD_NUMBER: builtins.int
    COMPARISON_FIELD_NUMBER: builtins.int
    @property
    def left(self) -> Global___Expression.FieldReference:
        """The key to compare from the left table"""

    @property
    def right(self) -> Global___Expression.FieldReference:
        """The key to compare from the right table"""

    @property
    def comparison(self) -> Global___ComparisonJoinKey.ComparisonType:
        """Describes how to compare the two keys"""

    def __init__(
        self,
        *,
        left: Global___Expression.FieldReference | None = ...,
        right: Global___Expression.FieldReference | None = ...,
        comparison: Global___ComparisonJoinKey.ComparisonType | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["comparison", b"comparison", "left", b"left", "right", b"right"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["comparison", b"comparison", "left", b"left", "right", b"right"]) -> None: ...

Global___ComparisonJoinKey: typing_extensions.TypeAlias = ComparisonJoinKey

@typing.final
class HashJoinRel(google.protobuf.message.Message):
    """The hash equijoin operator will build a hash table out of one input (default `right`) based on a set of join keys.
    It will then probe that hash table for the other input (default `left`), finding matches.

    Two rows are a match if the comparison function returns true for all keys
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _JoinType:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _JoinTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[HashJoinRel._JoinType.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        JOIN_TYPE_UNSPECIFIED: HashJoinRel._JoinType.ValueType  # 0
        JOIN_TYPE_INNER: HashJoinRel._JoinType.ValueType  # 1
        JOIN_TYPE_OUTER: HashJoinRel._JoinType.ValueType  # 2
        JOIN_TYPE_LEFT: HashJoinRel._JoinType.ValueType  # 3
        JOIN_TYPE_RIGHT: HashJoinRel._JoinType.ValueType  # 4
        JOIN_TYPE_LEFT_SEMI: HashJoinRel._JoinType.ValueType  # 5
        JOIN_TYPE_RIGHT_SEMI: HashJoinRel._JoinType.ValueType  # 6
        JOIN_TYPE_LEFT_ANTI: HashJoinRel._JoinType.ValueType  # 7
        JOIN_TYPE_RIGHT_ANTI: HashJoinRel._JoinType.ValueType  # 8
        JOIN_TYPE_LEFT_SINGLE: HashJoinRel._JoinType.ValueType  # 9
        JOIN_TYPE_RIGHT_SINGLE: HashJoinRel._JoinType.ValueType  # 10
        JOIN_TYPE_LEFT_MARK: HashJoinRel._JoinType.ValueType  # 11
        JOIN_TYPE_RIGHT_MARK: HashJoinRel._JoinType.ValueType  # 12

    class JoinType(_JoinType, metaclass=_JoinTypeEnumTypeWrapper): ...
    JOIN_TYPE_UNSPECIFIED: HashJoinRel.JoinType.ValueType  # 0
    JOIN_TYPE_INNER: HashJoinRel.JoinType.ValueType  # 1
    JOIN_TYPE_OUTER: HashJoinRel.JoinType.ValueType  # 2
    JOIN_TYPE_LEFT: HashJoinRel.JoinType.ValueType  # 3
    JOIN_TYPE_RIGHT: HashJoinRel.JoinType.ValueType  # 4
    JOIN_TYPE_LEFT_SEMI: HashJoinRel.JoinType.ValueType  # 5
    JOIN_TYPE_RIGHT_SEMI: HashJoinRel.JoinType.ValueType  # 6
    JOIN_TYPE_LEFT_ANTI: HashJoinRel.JoinType.ValueType  # 7
    JOIN_TYPE_RIGHT_ANTI: HashJoinRel.JoinType.ValueType  # 8
    JOIN_TYPE_LEFT_SINGLE: HashJoinRel.JoinType.ValueType  # 9
    JOIN_TYPE_RIGHT_SINGLE: HashJoinRel.JoinType.ValueType  # 10
    JOIN_TYPE_LEFT_MARK: HashJoinRel.JoinType.ValueType  # 11
    JOIN_TYPE_RIGHT_MARK: HashJoinRel.JoinType.ValueType  # 12

    class _BuildInput:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _BuildInputEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[HashJoinRel._BuildInput.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        BUILD_INPUT_UNSPECIFIED: HashJoinRel._BuildInput.ValueType  # 0
        BUILD_INPUT_LEFT: HashJoinRel._BuildInput.ValueType  # 1
        BUILD_INPUT_RIGHT: HashJoinRel._BuildInput.ValueType  # 2

    class BuildInput(_BuildInput, metaclass=_BuildInputEnumTypeWrapper): ...
    BUILD_INPUT_UNSPECIFIED: HashJoinRel.BuildInput.ValueType  # 0
    BUILD_INPUT_LEFT: HashJoinRel.BuildInput.ValueType  # 1
    BUILD_INPUT_RIGHT: HashJoinRel.BuildInput.ValueType  # 2

    COMMON_FIELD_NUMBER: builtins.int
    LEFT_FIELD_NUMBER: builtins.int
    RIGHT_FIELD_NUMBER: builtins.int
    LEFT_KEYS_FIELD_NUMBER: builtins.int
    RIGHT_KEYS_FIELD_NUMBER: builtins.int
    KEYS_FIELD_NUMBER: builtins.int
    POST_JOIN_FILTER_FIELD_NUMBER: builtins.int
    TYPE_FIELD_NUMBER: builtins.int
    BUILD_INPUT_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    type: Global___HashJoinRel.JoinType.ValueType
    build_input: Global___HashJoinRel.BuildInput.ValueType
    """Specifies which side of input to build the hash table for this hash join. Default is `BUILD_INPUT_RIGHT`."""
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def left(self) -> Global___Rel: ...
    @property
    def right(self) -> Global___Rel: ...
    @property
    def left_keys(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.FieldReference]:
        """These fields are deprecated in favor of `keys`.  If they are set then
        the two lists (left_keys and right_keys) must have the same length and
        the comparion function is considered to be SimpleEqualityType::EQ
        """

    @property
    def right_keys(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.FieldReference]: ...
    @property
    def keys(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___ComparisonJoinKey]:
        """One or more keys to join on.  The relation is invalid if this is empty
        (unless the deprecated left_keys/right_keys fields are being used).

        If a custom comparison function is used then it must be consistent with
        the hash function used for the keys.

        In other words, the hash function must return the same hash code when the
        comparison returns true.  For example, if the comparison function is
        "equals ignoring case" then the hash function must return the same hash
        code for strings that differ only by case.  Note: the hash function is not
        specified here.  It is the responsibility of the consumer to find an appropriate
        hash function for a given comparsion function or to reject the plan if it cannot
        do so.
        """

    @property
    def post_join_filter(self) -> Global___Expression: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        left: Global___Rel | None = ...,
        right: Global___Rel | None = ...,
        left_keys: collections.abc.Iterable[Global___Expression.FieldReference] | None = ...,
        right_keys: collections.abc.Iterable[Global___Expression.FieldReference] | None = ...,
        keys: collections.abc.Iterable[Global___ComparisonJoinKey] | None = ...,
        post_join_filter: Global___Expression | None = ...,
        type: Global___HashJoinRel.JoinType.ValueType = ...,
        build_input: Global___HashJoinRel.BuildInput.ValueType = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "left", b"left", "post_join_filter", b"post_join_filter", "right", b"right"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "build_input", b"build_input", "common", b"common", "keys", b"keys", "left", b"left", "left_keys", b"left_keys", "post_join_filter", b"post_join_filter", "right", b"right", "right_keys", b"right_keys", "type", b"type"]) -> None: ...

Global___HashJoinRel: typing_extensions.TypeAlias = HashJoinRel

@typing.final
class MergeJoinRel(google.protobuf.message.Message):
    """The merge equijoin does a join by taking advantage of two sets that are sorted on the join keys.
    This allows the join operation to be done in a streaming fashion.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _JoinType:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _JoinTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[MergeJoinRel._JoinType.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        JOIN_TYPE_UNSPECIFIED: MergeJoinRel._JoinType.ValueType  # 0
        JOIN_TYPE_INNER: MergeJoinRel._JoinType.ValueType  # 1
        JOIN_TYPE_OUTER: MergeJoinRel._JoinType.ValueType  # 2
        JOIN_TYPE_LEFT: MergeJoinRel._JoinType.ValueType  # 3
        JOIN_TYPE_RIGHT: MergeJoinRel._JoinType.ValueType  # 4
        JOIN_TYPE_LEFT_SEMI: MergeJoinRel._JoinType.ValueType  # 5
        JOIN_TYPE_RIGHT_SEMI: MergeJoinRel._JoinType.ValueType  # 6
        JOIN_TYPE_LEFT_ANTI: MergeJoinRel._JoinType.ValueType  # 7
        JOIN_TYPE_RIGHT_ANTI: MergeJoinRel._JoinType.ValueType  # 8
        JOIN_TYPE_LEFT_SINGLE: MergeJoinRel._JoinType.ValueType  # 9
        JOIN_TYPE_RIGHT_SINGLE: MergeJoinRel._JoinType.ValueType  # 10
        JOIN_TYPE_LEFT_MARK: MergeJoinRel._JoinType.ValueType  # 11
        JOIN_TYPE_RIGHT_MARK: MergeJoinRel._JoinType.ValueType  # 12

    class JoinType(_JoinType, metaclass=_JoinTypeEnumTypeWrapper): ...
    JOIN_TYPE_UNSPECIFIED: MergeJoinRel.JoinType.ValueType  # 0
    JOIN_TYPE_INNER: MergeJoinRel.JoinType.ValueType  # 1
    JOIN_TYPE_OUTER: MergeJoinRel.JoinType.ValueType  # 2
    JOIN_TYPE_LEFT: MergeJoinRel.JoinType.ValueType  # 3
    JOIN_TYPE_RIGHT: MergeJoinRel.JoinType.ValueType  # 4
    JOIN_TYPE_LEFT_SEMI: MergeJoinRel.JoinType.ValueType  # 5
    JOIN_TYPE_RIGHT_SEMI: MergeJoinRel.JoinType.ValueType  # 6
    JOIN_TYPE_LEFT_ANTI: MergeJoinRel.JoinType.ValueType  # 7
    JOIN_TYPE_RIGHT_ANTI: MergeJoinRel.JoinType.ValueType  # 8
    JOIN_TYPE_LEFT_SINGLE: MergeJoinRel.JoinType.ValueType  # 9
    JOIN_TYPE_RIGHT_SINGLE: MergeJoinRel.JoinType.ValueType  # 10
    JOIN_TYPE_LEFT_MARK: MergeJoinRel.JoinType.ValueType  # 11
    JOIN_TYPE_RIGHT_MARK: MergeJoinRel.JoinType.ValueType  # 12

    COMMON_FIELD_NUMBER: builtins.int
    LEFT_FIELD_NUMBER: builtins.int
    RIGHT_FIELD_NUMBER: builtins.int
    LEFT_KEYS_FIELD_NUMBER: builtins.int
    RIGHT_KEYS_FIELD_NUMBER: builtins.int
    KEYS_FIELD_NUMBER: builtins.int
    POST_JOIN_FILTER_FIELD_NUMBER: builtins.int
    TYPE_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    type: Global___MergeJoinRel.JoinType.ValueType
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def left(self) -> Global___Rel: ...
    @property
    def right(self) -> Global___Rel: ...
    @property
    def left_keys(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.FieldReference]:
        """These fields are deprecated in favor of `keys`.  If they are set then
        the two lists (left_keys and right_keys) must have the same length and
        the comparion function is considered to be SimpleEqualityType::EQ
        """

    @property
    def right_keys(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.FieldReference]: ...
    @property
    def keys(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___ComparisonJoinKey]:
        """One or more keys to join on.  The relation is invalid if this is empty
        (unless the deprecated left_keys/right_keys fields are being used).

        If a custom comparison function is used then it must be consistent with
        the ordering of the input data.  For example, if the comparison function
        is "<" then we generally expect the data to be sorted in ascending order.

        If the comparison function is something like "less than ignoring case" then
        the data should be sorted appropriately (e.g. both "A" and "a" should come
        before "b")

        The sort order is not specified here.  It is typically the responsibility of
        the producer to ensure the plan sorts the data if needed (although the consumer
        is free to do so as well).  If possible, the consumer should verify the sort
        order and reject invalid plans.
        """

    @property
    def post_join_filter(self) -> Global___Expression: ...
    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        left: Global___Rel | None = ...,
        right: Global___Rel | None = ...,
        left_keys: collections.abc.Iterable[Global___Expression.FieldReference] | None = ...,
        right_keys: collections.abc.Iterable[Global___Expression.FieldReference] | None = ...,
        keys: collections.abc.Iterable[Global___ComparisonJoinKey] | None = ...,
        post_join_filter: Global___Expression | None = ...,
        type: Global___MergeJoinRel.JoinType.ValueType = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "left", b"left", "post_join_filter", b"post_join_filter", "right", b"right"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "keys", b"keys", "left", b"left", "left_keys", b"left_keys", "post_join_filter", b"post_join_filter", "right", b"right", "right_keys", b"right_keys", "type", b"type"]) -> None: ...

Global___MergeJoinRel: typing_extensions.TypeAlias = MergeJoinRel

@typing.final
class NestedLoopJoinRel(google.protobuf.message.Message):
    """The nested loop join (NLJ) operator will hold the entire right input and iterate over it using the
    left input, evaluating the join expression on the Cartesian product of all rows.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _JoinType:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _JoinTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[NestedLoopJoinRel._JoinType.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        JOIN_TYPE_UNSPECIFIED: NestedLoopJoinRel._JoinType.ValueType  # 0
        JOIN_TYPE_INNER: NestedLoopJoinRel._JoinType.ValueType  # 1
        JOIN_TYPE_OUTER: NestedLoopJoinRel._JoinType.ValueType  # 2
        JOIN_TYPE_LEFT: NestedLoopJoinRel._JoinType.ValueType  # 3
        JOIN_TYPE_RIGHT: NestedLoopJoinRel._JoinType.ValueType  # 4
        JOIN_TYPE_LEFT_SEMI: NestedLoopJoinRel._JoinType.ValueType  # 5
        JOIN_TYPE_RIGHT_SEMI: NestedLoopJoinRel._JoinType.ValueType  # 6
        JOIN_TYPE_LEFT_ANTI: NestedLoopJoinRel._JoinType.ValueType  # 7
        JOIN_TYPE_RIGHT_ANTI: NestedLoopJoinRel._JoinType.ValueType  # 8
        JOIN_TYPE_LEFT_SINGLE: NestedLoopJoinRel._JoinType.ValueType  # 9
        JOIN_TYPE_RIGHT_SINGLE: NestedLoopJoinRel._JoinType.ValueType  # 10
        JOIN_TYPE_LEFT_MARK: NestedLoopJoinRel._JoinType.ValueType  # 11
        JOIN_TYPE_RIGHT_MARK: NestedLoopJoinRel._JoinType.ValueType  # 12

    class JoinType(_JoinType, metaclass=_JoinTypeEnumTypeWrapper): ...
    JOIN_TYPE_UNSPECIFIED: NestedLoopJoinRel.JoinType.ValueType  # 0
    JOIN_TYPE_INNER: NestedLoopJoinRel.JoinType.ValueType  # 1
    JOIN_TYPE_OUTER: NestedLoopJoinRel.JoinType.ValueType  # 2
    JOIN_TYPE_LEFT: NestedLoopJoinRel.JoinType.ValueType  # 3
    JOIN_TYPE_RIGHT: NestedLoopJoinRel.JoinType.ValueType  # 4
    JOIN_TYPE_LEFT_SEMI: NestedLoopJoinRel.JoinType.ValueType  # 5
    JOIN_TYPE_RIGHT_SEMI: NestedLoopJoinRel.JoinType.ValueType  # 6
    JOIN_TYPE_LEFT_ANTI: NestedLoopJoinRel.JoinType.ValueType  # 7
    JOIN_TYPE_RIGHT_ANTI: NestedLoopJoinRel.JoinType.ValueType  # 8
    JOIN_TYPE_LEFT_SINGLE: NestedLoopJoinRel.JoinType.ValueType  # 9
    JOIN_TYPE_RIGHT_SINGLE: NestedLoopJoinRel.JoinType.ValueType  # 10
    JOIN_TYPE_LEFT_MARK: NestedLoopJoinRel.JoinType.ValueType  # 11
    JOIN_TYPE_RIGHT_MARK: NestedLoopJoinRel.JoinType.ValueType  # 12

    COMMON_FIELD_NUMBER: builtins.int
    LEFT_FIELD_NUMBER: builtins.int
    RIGHT_FIELD_NUMBER: builtins.int
    EXPRESSION_FIELD_NUMBER: builtins.int
    TYPE_FIELD_NUMBER: builtins.int
    ADVANCED_EXTENSION_FIELD_NUMBER: builtins.int
    type: Global___NestedLoopJoinRel.JoinType.ValueType
    @property
    def common(self) -> Global___RelCommon: ...
    @property
    def left(self) -> Global___Rel: ...
    @property
    def right(self) -> Global___Rel: ...
    @property
    def expression(self) -> Global___Expression:
        """optional, defaults to true (a cartesian join)"""

    @property
    def advanced_extension(self) -> substrait.extensions.extensions_pb2.AdvancedExtension: ...
    def __init__(
        self,
        *,
        common: Global___RelCommon | None = ...,
        left: Global___Rel | None = ...,
        right: Global___Rel | None = ...,
        expression: Global___Expression | None = ...,
        type: Global___NestedLoopJoinRel.JoinType.ValueType = ...,
        advanced_extension: substrait.extensions.extensions_pb2.AdvancedExtension | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "expression", b"expression", "left", b"left", "right", b"right"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["advanced_extension", b"advanced_extension", "common", b"common", "expression", b"expression", "left", b"left", "right", b"right", "type", b"type"]) -> None: ...

Global___NestedLoopJoinRel: typing_extensions.TypeAlias = NestedLoopJoinRel

@typing.final
class FunctionArgument(google.protobuf.message.Message):
    """The argument of a function"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    ENUM_FIELD_NUMBER: builtins.int
    TYPE_FIELD_NUMBER: builtins.int
    VALUE_FIELD_NUMBER: builtins.int
    enum: builtins.str
    @property
    def type(self) -> substrait.type_pb2.Type: ...
    @property
    def value(self) -> Global___Expression: ...
    def __init__(
        self,
        *,
        enum: builtins.str = ...,
        type: substrait.type_pb2.Type | None = ...,
        value: Global___Expression | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["arg_type", b"arg_type", "enum", b"enum", "type", b"type", "value", b"value"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["arg_type", b"arg_type", "enum", b"enum", "type", b"type", "value", b"value"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["arg_type", b"arg_type"]) -> typing.Literal["enum", "type", "value"] | None: ...

Global___FunctionArgument: typing_extensions.TypeAlias = FunctionArgument

@typing.final
class FunctionOption(google.protobuf.message.Message):
    """An optional function argument.  Typically used for specifying behavior in
    invalid or corner cases.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    NAME_FIELD_NUMBER: builtins.int
    PREFERENCE_FIELD_NUMBER: builtins.int
    name: builtins.str
    """Name of the option to set. If the consumer does not recognize the
    option, it must reject the plan. The name is matched case-insensitively
    with option names defined for the function.
    """
    @property
    def preference(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
        """List of behavior options allowed by the producer. At least one must be
        specified; to leave an option unspecified, simply don't add an entry to
        `options`. The consumer must use the first option from the list that it
        supports. If the consumer supports none of the specified options, it
        must reject the plan. The name is matched case-insensitively and must
        match one of the option values defined for the option.
        """

    def __init__(
        self,
        *,
        name: builtins.str = ...,
        preference: collections.abc.Iterable[builtins.str] | None = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["name", b"name", "preference", b"preference"]) -> None: ...

Global___FunctionOption: typing_extensions.TypeAlias = FunctionOption

@typing.final
class Expression(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    @deprecated("""This message has been marked as deprecated using proto message options.""")
    @typing.final
    class Enum(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @deprecated("""This message has been marked as deprecated using proto message options.""")
        @typing.final
        class Empty(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            def __init__(
                self,
            ) -> None: ...

        SPECIFIED_FIELD_NUMBER: builtins.int
        UNSPECIFIED_FIELD_NUMBER: builtins.int
        specified: builtins.str
        @property
        def unspecified(self) -> Global___Expression.Enum.Empty: ...
        def __init__(
            self,
            *,
            specified: builtins.str = ...,
            unspecified: Global___Expression.Enum.Empty | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["enum_kind", b"enum_kind", "specified", b"specified", "unspecified", b"unspecified"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["enum_kind", b"enum_kind", "specified", b"specified", "unspecified", b"unspecified"]) -> None: ...
        def WhichOneof(self, oneof_group: typing.Literal["enum_kind", b"enum_kind"]) -> typing.Literal["specified", "unspecified"] | None: ...

    @typing.final
    class Literal(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class VarChar(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            VALUE_FIELD_NUMBER: builtins.int
            LENGTH_FIELD_NUMBER: builtins.int
            value: builtins.str
            length: builtins.int
            def __init__(
                self,
                *,
                value: builtins.str = ...,
                length: builtins.int = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["length", b"length", "value", b"value"]) -> None: ...

        @typing.final
        class Decimal(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            VALUE_FIELD_NUMBER: builtins.int
            PRECISION_FIELD_NUMBER: builtins.int
            SCALE_FIELD_NUMBER: builtins.int
            value: builtins.bytes
            """little-endian twos-complement integer representation of complete value
            (ignoring precision) Always 16 bytes in length
            """
            precision: builtins.int
            """The maximum number of digits allowed in the value.
            the maximum precision is 38.
            """
            scale: builtins.int
            """declared scale of decimal literal"""
            def __init__(
                self,
                *,
                value: builtins.bytes = ...,
                precision: builtins.int = ...,
                scale: builtins.int = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["precision", b"precision", "scale", b"scale", "value", b"value"]) -> None: ...

        @typing.final
        class PrecisionTime(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            PRECISION_FIELD_NUMBER: builtins.int
            VALUE_FIELD_NUMBER: builtins.int
            precision: builtins.int
            """Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds, 12 is picoseconds"""
            value: builtins.int
            """Time passed since midnight in precision units."""
            def __init__(
                self,
                *,
                precision: builtins.int = ...,
                value: builtins.int = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["precision", b"precision", "value", b"value"]) -> None: ...

        @typing.final
        class PrecisionTimestamp(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            PRECISION_FIELD_NUMBER: builtins.int
            VALUE_FIELD_NUMBER: builtins.int
            precision: builtins.int
            """Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds, 12 is picoseconds"""
            value: builtins.int
            """Time passed since 1970-01-01 00:00:00.000000 in UTC for PrecisionTimestampTZ and unspecified timezone for PrecisionTimestamp"""
            def __init__(
                self,
                *,
                precision: builtins.int = ...,
                value: builtins.int = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["precision", b"precision", "value", b"value"]) -> None: ...

        @typing.final
        class Map(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            @typing.final
            class KeyValue(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                KEY_FIELD_NUMBER: builtins.int
                VALUE_FIELD_NUMBER: builtins.int
                @property
                def key(self) -> Global___Expression.Literal: ...
                @property
                def value(self) -> Global___Expression.Literal: ...
                def __init__(
                    self,
                    *,
                    key: Global___Expression.Literal | None = ...,
                    value: Global___Expression.Literal | None = ...,
                ) -> None: ...
                def HasField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> builtins.bool: ...
                def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ...

            KEY_VALUES_FIELD_NUMBER: builtins.int
            @property
            def key_values(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.Literal.Map.KeyValue]: ...
            def __init__(
                self,
                *,
                key_values: collections.abc.Iterable[Global___Expression.Literal.Map.KeyValue] | None = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["key_values", b"key_values"]) -> None: ...

        @typing.final
        class IntervalYearToMonth(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            YEARS_FIELD_NUMBER: builtins.int
            MONTHS_FIELD_NUMBER: builtins.int
            years: builtins.int
            months: builtins.int
            def __init__(
                self,
                *,
                years: builtins.int = ...,
                months: builtins.int = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["months", b"months", "years", b"years"]) -> None: ...

        @typing.final
        class IntervalDayToSecond(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            DAYS_FIELD_NUMBER: builtins.int
            SECONDS_FIELD_NUMBER: builtins.int
            MICROSECONDS_FIELD_NUMBER: builtins.int
            PRECISION_FIELD_NUMBER: builtins.int
            SUBSECONDS_FIELD_NUMBER: builtins.int
            days: builtins.int
            seconds: builtins.int
            microseconds: builtins.int
            """use precision and subseconds below, they cover and replace microseconds."""
            precision: builtins.int
            """Sub-second precision, 0 means the value given is in seconds, 3 is milliseconds, 6 microseconds, 9 is nanoseconds. Should be used with subseconds below."""
            subseconds: builtins.int
            """the number of fractional seconds using 1e(-precision) units. Should only be used with precision field, not microseconds."""
            def __init__(
                self,
                *,
                days: builtins.int = ...,
                seconds: builtins.int = ...,
                microseconds: builtins.int = ...,
                precision: builtins.int = ...,
                subseconds: builtins.int = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["microseconds", b"microseconds", "precision", b"precision", "precision_mode", b"precision_mode"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["days", b"days", "microseconds", b"microseconds", "precision", b"precision", "precision_mode", b"precision_mode", "seconds", b"seconds", "subseconds", b"subseconds"]) -> None: ...
            def WhichOneof(self, oneof_group: typing.Literal["precision_mode", b"precision_mode"]) -> typing.Literal["microseconds", "precision"] | None: ...

        @typing.final
        class IntervalCompound(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            INTERVAL_YEAR_TO_MONTH_FIELD_NUMBER: builtins.int
            INTERVAL_DAY_TO_SECOND_FIELD_NUMBER: builtins.int
            @property
            def interval_year_to_month(self) -> Global___Expression.Literal.IntervalYearToMonth: ...
            @property
            def interval_day_to_second(self) -> Global___Expression.Literal.IntervalDayToSecond: ...
            def __init__(
                self,
                *,
                interval_year_to_month: Global___Expression.Literal.IntervalYearToMonth | None = ...,
                interval_day_to_second: Global___Expression.Literal.IntervalDayToSecond | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["interval_day_to_second", b"interval_day_to_second", "interval_year_to_month", b"interval_year_to_month"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["interval_day_to_second", b"interval_day_to_second", "interval_year_to_month", b"interval_year_to_month"]) -> None: ...

        @typing.final
        class Struct(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            FIELDS_FIELD_NUMBER: builtins.int
            @property
            def fields(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.Literal]:
                """A possibly heterogeneously typed list of literals"""

            def __init__(
                self,
                *,
                fields: collections.abc.Iterable[Global___Expression.Literal] | None = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["fields", b"fields"]) -> None: ...

        @typing.final
        class List(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            VALUES_FIELD_NUMBER: builtins.int
            @property
            def values(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.Literal]:
                """A homogeneously typed list of literals"""

            def __init__(
                self,
                *,
                values: collections.abc.Iterable[Global___Expression.Literal] | None = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["values", b"values"]) -> None: ...

        @typing.final
        class UserDefined(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            TYPE_REFERENCE_FIELD_NUMBER: builtins.int
            TYPE_ALIAS_REFERENCE_FIELD_NUMBER: builtins.int
            TYPE_PARAMETERS_FIELD_NUMBER: builtins.int
            VALUE_FIELD_NUMBER: builtins.int
            STRUCT_FIELD_NUMBER: builtins.int
            type_reference: builtins.int
            """points to a type_anchor defined in this plan"""
            type_alias_reference: builtins.int
            """points to a type_alias_anchor defined in this plan."""
            @property
            def type_parameters(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[substrait.type_pb2.Type.Parameter]:
                """The parameters to be bound to the type class, if the type class is
                parameterizable.
                """

            @property
            def value(self) -> google.protobuf.any_pb2.Any:
                """the value of the literal, serialized using some type-specific protobuf message"""

            @property
            def struct(self) -> Global___Expression.Literal.Struct:
                """the value of the literal, serialized using the structure definition in its declaration"""

            def __init__(
                self,
                *,
                type_reference: builtins.int = ...,
                type_alias_reference: builtins.int = ...,
                type_parameters: collections.abc.Iterable[substrait.type_pb2.Type.Parameter] | None = ...,
                value: google.protobuf.any_pb2.Any | None = ...,
                struct: Global___Expression.Literal.Struct | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["struct", b"struct", "type_alias_reference", b"type_alias_reference", "type_anchor_type", b"type_anchor_type", "type_reference", b"type_reference", "val", b"val", "value", b"value"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["struct", b"struct", "type_alias_reference", b"type_alias_reference", "type_anchor_type", b"type_anchor_type", "type_parameters", b"type_parameters", "type_reference", b"type_reference", "val", b"val", "value", b"value"]) -> None: ...
            @typing.overload
            def WhichOneof(self, oneof_group: typing.Literal["type_anchor_type", b"type_anchor_type"]) -> typing.Literal["type_reference", "type_alias_reference"] | None: ...
            @typing.overload
            def WhichOneof(self, oneof_group: typing.Literal["val", b"val"]) -> typing.Literal["value", "struct"] | None: ...

        BOOLEAN_FIELD_NUMBER: builtins.int
        I8_FIELD_NUMBER: builtins.int
        I16_FIELD_NUMBER: builtins.int
        I32_FIELD_NUMBER: builtins.int
        I64_FIELD_NUMBER: builtins.int
        FP32_FIELD_NUMBER: builtins.int
        FP64_FIELD_NUMBER: builtins.int
        STRING_FIELD_NUMBER: builtins.int
        BINARY_FIELD_NUMBER: builtins.int
        TIMESTAMP_FIELD_NUMBER: builtins.int
        DATE_FIELD_NUMBER: builtins.int
        TIME_FIELD_NUMBER: builtins.int
        INTERVAL_YEAR_TO_MONTH_FIELD_NUMBER: builtins.int
        INTERVAL_DAY_TO_SECOND_FIELD_NUMBER: builtins.int
        INTERVAL_COMPOUND_FIELD_NUMBER: builtins.int
        FIXED_CHAR_FIELD_NUMBER: builtins.int
        VAR_CHAR_FIELD_NUMBER: builtins.int
        FIXED_BINARY_FIELD_NUMBER: builtins.int
        DECIMAL_FIELD_NUMBER: builtins.int
        PRECISION_TIME_FIELD_NUMBER: builtins.int
        PRECISION_TIMESTAMP_FIELD_NUMBER: builtins.int
        PRECISION_TIMESTAMP_TZ_FIELD_NUMBER: builtins.int
        STRUCT_FIELD_NUMBER: builtins.int
        MAP_FIELD_NUMBER: builtins.int
        TIMESTAMP_TZ_FIELD_NUMBER: builtins.int
        UUID_FIELD_NUMBER: builtins.int
        NULL_FIELD_NUMBER: builtins.int
        LIST_FIELD_NUMBER: builtins.int
        EMPTY_LIST_FIELD_NUMBER: builtins.int
        EMPTY_MAP_FIELD_NUMBER: builtins.int
        USER_DEFINED_FIELD_NUMBER: builtins.int
        NULLABLE_FIELD_NUMBER: builtins.int
        TYPE_VARIATION_REFERENCE_FIELD_NUMBER: builtins.int
        boolean: builtins.bool
        i8: builtins.int
        i16: builtins.int
        i32: builtins.int
        i64: builtins.int
        fp32: builtins.float
        fp64: builtins.float
        string: builtins.str
        binary: builtins.bytes
        timestamp: builtins.int
        """Timestamp in units of microseconds since the UNIX epoch.
        Deprecated in favor of `precision_timestamp`.
        """
        date: builtins.int
        """Date in units of days since the UNIX epoch."""
        time: builtins.int
        """Time in units of microseconds past midnight.
        Deprecated in favor of `precision_time`.
        """
        fixed_char: builtins.str
        fixed_binary: builtins.bytes
        timestamp_tz: builtins.int
        """Timestamp in units of microseconds since the UNIX epoch.
        Deprecated in favor of `precision_timestamp_tz`
        """
        uuid: builtins.bytes
        nullable: builtins.bool
        """Whether the literal_type above should be treated as a nullable type.
        Applies to all members of the literal_type oneof EXCEPT:
         * Type null             (must be nullable by definition)
         * Type.List empty_list  (use Type.List::nullability)
         * Type.Map empty_map    (use Type.Map::nullability)
        """
        type_variation_reference: builtins.int
        """optionally points to a type_variation_anchor defined in this plan.
        Applies to all members of union other than the Typed null (which should
        directly declare the type variation).
        """
        @property
        def interval_year_to_month(self) -> Global___Expression.Literal.IntervalYearToMonth: ...
        @property
        def interval_day_to_second(self) -> Global___Expression.Literal.IntervalDayToSecond: ...
        @property
        def interval_compound(self) -> Global___Expression.Literal.IntervalCompound: ...
        @property
        def var_char(self) -> Global___Expression.Literal.VarChar: ...
        @property
        def decimal(self) -> Global___Expression.Literal.Decimal: ...
        @property
        def precision_time(self) -> Global___Expression.Literal.PrecisionTime:
            """Time in precision units past midnight."""

        @property
        def precision_timestamp(self) -> Global___Expression.Literal.PrecisionTimestamp: ...
        @property
        def precision_timestamp_tz(self) -> Global___Expression.Literal.PrecisionTimestamp: ...
        @property
        def struct(self) -> Global___Expression.Literal.Struct: ...
        @property
        def map(self) -> Global___Expression.Literal.Map: ...
        @property
        def null(self) -> substrait.type_pb2.Type:
            """a typed null literal"""

        @property
        def list(self) -> Global___Expression.Literal.List: ...
        @property
        def empty_list(self) -> substrait.type_pb2.Type.List: ...
        @property
        def empty_map(self) -> substrait.type_pb2.Type.Map: ...
        @property
        def user_defined(self) -> Global___Expression.Literal.UserDefined: ...
        def __init__(
            self,
            *,
            boolean: builtins.bool = ...,
            i8: builtins.int = ...,
            i16: builtins.int = ...,
            i32: builtins.int = ...,
            i64: builtins.int = ...,
            fp32: builtins.float = ...,
            fp64: builtins.float = ...,
            string: builtins.str = ...,
            binary: builtins.bytes = ...,
            timestamp: builtins.int = ...,
            date: builtins.int = ...,
            time: builtins.int = ...,
            interval_year_to_month: Global___Expression.Literal.IntervalYearToMonth | None = ...,
            interval_day_to_second: Global___Expression.Literal.IntervalDayToSecond | None = ...,
            interval_compound: Global___Expression.Literal.IntervalCompound | None = ...,
            fixed_char: builtins.str = ...,
            var_char: Global___Expression.Literal.VarChar | None = ...,
            fixed_binary: builtins.bytes = ...,
            decimal: Global___Expression.Literal.Decimal | None = ...,
            precision_time: Global___Expression.Literal.PrecisionTime | None = ...,
            precision_timestamp: Global___Expression.Literal.PrecisionTimestamp | None = ...,
            precision_timestamp_tz: Global___Expression.Literal.PrecisionTimestamp | None = ...,
            struct: Global___Expression.Literal.Struct | None = ...,
            map: Global___Expression.Literal.Map | None = ...,
            timestamp_tz: builtins.int = ...,
            uuid: builtins.bytes = ...,
            null: substrait.type_pb2.Type | None = ...,
            list: Global___Expression.Literal.List | None = ...,
            empty_list: substrait.type_pb2.Type.List | None = ...,
            empty_map: substrait.type_pb2.Type.Map | None = ...,
            user_defined: Global___Expression.Literal.UserDefined | None = ...,
            nullable: builtins.bool = ...,
            type_variation_reference: builtins.int = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["binary", b"binary", "boolean", b"boolean", "date", b"date", "decimal", b"decimal", "empty_list", b"empty_list", "empty_map", b"empty_map", "fixed_binary", b"fixed_binary", "fixed_char", b"fixed_char", "fp32", b"fp32", "fp64", b"fp64", "i16", b"i16", "i32", b"i32", "i64", b"i64", "i8", b"i8", "interval_compound", b"interval_compound", "interval_day_to_second", b"interval_day_to_second", "interval_year_to_month", b"interval_year_to_month", "list", b"list", "literal_type", b"literal_type", "map", b"map", "null", b"null", "precision_time", b"precision_time", "precision_timestamp", b"precision_timestamp", "precision_timestamp_tz", b"precision_timestamp_tz", "string", b"string", "struct", b"struct", "time", b"time", "timestamp", b"timestamp", "timestamp_tz", b"timestamp_tz", "user_defined", b"user_defined", "uuid", b"uuid", "var_char", b"var_char"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["binary", b"binary", "boolean", b"boolean", "date", b"date", "decimal", b"decimal", "empty_list", b"empty_list", "empty_map", b"empty_map", "fixed_binary", b"fixed_binary", "fixed_char", b"fixed_char", "fp32", b"fp32", "fp64", b"fp64", "i16", b"i16", "i32", b"i32", "i64", b"i64", "i8", b"i8", "interval_compound", b"interval_compound", "interval_day_to_second", b"interval_day_to_second", "interval_year_to_month", b"interval_year_to_month", "list", b"list", "literal_type", b"literal_type", "map", b"map", "null", b"null", "nullable", b"nullable", "precision_time", b"precision_time", "precision_timestamp", b"precision_timestamp", "precision_timestamp_tz", b"precision_timestamp_tz", "string", b"string", "struct", b"struct", "time", b"time", "timestamp", b"timestamp", "timestamp_tz", b"timestamp_tz", "type_variation_reference", b"type_variation_reference", "user_defined", b"user_defined", "uuid", b"uuid", "var_char", b"var_char"]) -> None: ...
        def WhichOneof(self, oneof_group: typing.Literal["literal_type", b"literal_type"]) -> typing.Literal["boolean", "i8", "i16", "i32", "i64", "fp32", "fp64", "string", "binary", "timestamp", "date", "time", "interval_year_to_month", "interval_day_to_second", "interval_compound", "fixed_char", "var_char", "fixed_binary", "decimal", "precision_time", "precision_timestamp", "precision_timestamp_tz", "struct", "map", "timestamp_tz", "uuid", "null", "list", "empty_list", "empty_map", "user_defined"] | None: ...

    @typing.final
    class Nested(google.protobuf.message.Message):
        """Expression to dynamically construct nested types."""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class Map(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            @typing.final
            class KeyValue(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                KEY_FIELD_NUMBER: builtins.int
                VALUE_FIELD_NUMBER: builtins.int
                @property
                def key(self) -> Global___Expression:
                    """Mandatory key/value expressions."""

                @property
                def value(self) -> Global___Expression: ...
                def __init__(
                    self,
                    *,
                    key: Global___Expression | None = ...,
                    value: Global___Expression | None = ...,
                ) -> None: ...
                def HasField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> builtins.bool: ...
                def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ...

            KEY_VALUES_FIELD_NUMBER: builtins.int
            @property
            def key_values(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.Nested.Map.KeyValue]:
                """One or more key-value pairs. To specify an empty map, use
                Literal.empty_map (otherwise type information would be missing).
                """

            def __init__(
                self,
                *,
                key_values: collections.abc.Iterable[Global___Expression.Nested.Map.KeyValue] | None = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["key_values", b"key_values"]) -> None: ...

        @typing.final
        class Struct(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            FIELDS_FIELD_NUMBER: builtins.int
            @property
            def fields(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]:
                """Zero or more possibly heterogeneously-typed list of expressions that
                form the struct fields.
                """

            def __init__(
                self,
                *,
                fields: collections.abc.Iterable[Global___Expression] | None = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["fields", b"fields"]) -> None: ...

        @typing.final
        class List(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            VALUES_FIELD_NUMBER: builtins.int
            @property
            def values(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]:
                """A homogeneously-typed list of one or more expressions that form the
                list entries. To specify an empty list, use Literal.empty_list
                (otherwise type information would be missing).
                """

            def __init__(
                self,
                *,
                values: collections.abc.Iterable[Global___Expression] | None = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["values", b"values"]) -> None: ...

        NULLABLE_FIELD_NUMBER: builtins.int
        TYPE_VARIATION_REFERENCE_FIELD_NUMBER: builtins.int
        STRUCT_FIELD_NUMBER: builtins.int
        LIST_FIELD_NUMBER: builtins.int
        MAP_FIELD_NUMBER: builtins.int
        nullable: builtins.bool
        """Whether the returned nested type is nullable."""
        type_variation_reference: builtins.int
        """Optionally points to a type_variation_anchor defined in this plan for
        the returned nested type.
        """
        @property
        def struct(self) -> Global___Expression.Nested.Struct: ...
        @property
        def list(self) -> Global___Expression.Nested.List: ...
        @property
        def map(self) -> Global___Expression.Nested.Map: ...
        def __init__(
            self,
            *,
            nullable: builtins.bool = ...,
            type_variation_reference: builtins.int = ...,
            struct: Global___Expression.Nested.Struct | None = ...,
            list: Global___Expression.Nested.List | None = ...,
            map: Global___Expression.Nested.Map | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["list", b"list", "map", b"map", "nested_type", b"nested_type", "struct", b"struct"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["list", b"list", "map", b"map", "nested_type", b"nested_type", "nullable", b"nullable", "struct", b"struct", "type_variation_reference", b"type_variation_reference"]) -> None: ...
        def WhichOneof(self, oneof_group: typing.Literal["nested_type", b"nested_type"]) -> typing.Literal["struct", "list", "map"] | None: ...

    @typing.final
    class Lambda(google.protobuf.message.Message):
        """A lambda expression representing an inline, anonymous function.
        Lambda expressions have parameters and a body expression that can reference
        those parameters using FieldReference with FieldReference.LambdaParameterReference as the root_type.
        """

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        PARAMETERS_FIELD_NUMBER: builtins.int
        BODY_FIELD_NUMBER: builtins.int
        @property
        def parameters(self) -> substrait.type_pb2.Type.Struct:
            """Parameters this lambda accepts, represented as a struct where each field corresponds
            to a parameter. Parameters can be accessed using FieldReference with
            FieldReference.LambdaParameterReference as root_type and StructField to select
            specific parameters. The struct's nullability must be NULLABILITY_REQUIRED.
            """

        @property
        def body(self) -> Global___Expression:
            """The lambda body expression. Lambda parameters can be referenced using FieldReference
            with FieldReference.LambdaParameterReference as root_type.
            """

        def __init__(
            self,
            *,
            parameters: substrait.type_pb2.Type.Struct | None = ...,
            body: Global___Expression | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["body", b"body", "parameters", b"parameters"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["body", b"body", "parameters", b"parameters"]) -> None: ...

    @typing.final
    class LambdaInvocation(google.protobuf.message.Message):
        """Invokes an inline lambda expression with provided arguments.
        Enables immediate invocation patterns like: ((x) -> x * 2)(5)

        The return type is derived from the type of the lambda's body expression.
        """

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        LAMBDA_FIELD_NUMBER: builtins.int
        ARGUMENTS_FIELD_NUMBER: builtins.int
        @property
        def arguments(self) -> Global___Expression.Nested.Struct:
            """Arguments to pass to the lambda, as a struct expression. The struct must have
            exactly one Expression field for each lambda parameter, and the expression at
            each position must have a type that matches the corresponding parameter type.
            """

        def __init__(
            self,
            *,
            arguments: Global___Expression.Nested.Struct | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["arguments", b"arguments", "lambda", b"lambda"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["arguments", b"arguments", "lambda", b"lambda"]) -> None: ...

    @typing.final
    class ScalarFunction(google.protobuf.message.Message):
        """A scalar function call."""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        FUNCTION_REFERENCE_FIELD_NUMBER: builtins.int
        ARGUMENTS_FIELD_NUMBER: builtins.int
        OPTIONS_FIELD_NUMBER: builtins.int
        OUTPUT_TYPE_FIELD_NUMBER: builtins.int
        ARGS_FIELD_NUMBER: builtins.int
        function_reference: builtins.int
        """Points to a function_anchor defined in this plan, which must refer
        to a scalar function in the associated YAML file. Required.
        """
        @property
        def arguments(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___FunctionArgument]:
            """The arguments to be bound to the function. This must have exactly the
            number of arguments specified in the function definition, and the
            argument types must also match exactly:

             - Value arguments must be bound using FunctionArgument.value, and
               the expression in that must yield a value of a type that a function
               overload is defined for.
             - Type arguments must be bound using FunctionArgument.type.
             - Enum arguments must be bound using FunctionArgument.enum
               followed by Enum.specified, with a string that case-insensitively
               matches one of the allowed options.
            """

        @property
        def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___FunctionOption]:
            """Options to specify behavior for corner cases, or leave behavior
            unspecified if the consumer does not need specific behavior in these
            cases.
            """

        @property
        def output_type(self) -> substrait.type_pb2.Type:
            """Must be set to the return type of the function, exactly as derived
            using the declaration in the extension.
            """

        @property
        def args(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]:
            """Deprecated; use arguments instead."""

        def __init__(
            self,
            *,
            function_reference: builtins.int = ...,
            arguments: collections.abc.Iterable[Global___FunctionArgument] | None = ...,
            options: collections.abc.Iterable[Global___FunctionOption] | None = ...,
            output_type: substrait.type_pb2.Type | None = ...,
            args: collections.abc.Iterable[Global___Expression] | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["output_type", b"output_type"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["args", b"args", "arguments", b"arguments", "function_reference", b"function_reference", "options", b"options", "output_type", b"output_type"]) -> None: ...

    @typing.final
    class WindowFunction(google.protobuf.message.Message):
        """A window function call."""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        class _BoundsType:
            ValueType = typing.NewType("ValueType", builtins.int)
            V: typing_extensions.TypeAlias = ValueType

        class _BoundsTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Expression.WindowFunction._BoundsType.ValueType], builtins.type):
            DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
            BOUNDS_TYPE_UNSPECIFIED: Expression.WindowFunction._BoundsType.ValueType  # 0
            BOUNDS_TYPE_ROWS: Expression.WindowFunction._BoundsType.ValueType  # 1
            """The lower and upper bound specify how many rows before and after the current row
            the window should extend.
            """
            BOUNDS_TYPE_RANGE: Expression.WindowFunction._BoundsType.ValueType  # 2
            """The lower and upper bound describe a range of values.  The window should include all rows
            where the value of the ordering column is greater than or equal to (current_value - lower bound)
            and less than or equal to (current_value + upper bound).  This bounds type is only valid if there
            is a single ordering column.
            """

        class BoundsType(_BoundsType, metaclass=_BoundsTypeEnumTypeWrapper): ...
        BOUNDS_TYPE_UNSPECIFIED: Expression.WindowFunction.BoundsType.ValueType  # 0
        BOUNDS_TYPE_ROWS: Expression.WindowFunction.BoundsType.ValueType  # 1
        """The lower and upper bound specify how many rows before and after the current row
        the window should extend.
        """
        BOUNDS_TYPE_RANGE: Expression.WindowFunction.BoundsType.ValueType  # 2
        """The lower and upper bound describe a range of values.  The window should include all rows
        where the value of the ordering column is greater than or equal to (current_value - lower bound)
        and less than or equal to (current_value + upper bound).  This bounds type is only valid if there
        is a single ordering column.
        """

        @typing.final
        class Bound(google.protobuf.message.Message):
            """Defines one of the two boundaries for the window of a window function."""

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            @typing.final
            class Preceding(google.protobuf.message.Message):
                """Defines that the bound extends this far back from the current record."""

                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                OFFSET_FIELD_NUMBER: builtins.int
                offset: builtins.int
                """A strictly positive integer specifying the number of records that
                the window extends back from the current record. Required. Use
                CurrentRow for offset zero and Following for negative offsets.
                """
                def __init__(
                    self,
                    *,
                    offset: builtins.int = ...,
                ) -> None: ...
                def ClearField(self, field_name: typing.Literal["offset", b"offset"]) -> None: ...

            @typing.final
            class Following(google.protobuf.message.Message):
                """Defines that the bound extends this far ahead of the current record."""

                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                OFFSET_FIELD_NUMBER: builtins.int
                offset: builtins.int
                """A strictly positive integer specifying the number of records that
                the window extends ahead of the current record. Required. Use
                CurrentRow for offset zero and Preceding for negative offsets.
                """
                def __init__(
                    self,
                    *,
                    offset: builtins.int = ...,
                ) -> None: ...
                def ClearField(self, field_name: typing.Literal["offset", b"offset"]) -> None: ...

            @typing.final
            class CurrentRow(google.protobuf.message.Message):
                """Defines that the bound extends to or from the current record."""

                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                def __init__(
                    self,
                ) -> None: ...

            @typing.final
            class Unbounded(google.protobuf.message.Message):
                """Defines an "unbounded bound": for lower bounds this means the start
                of the partition, and for upper bounds this means the end of the
                partition.
                """

                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                def __init__(
                    self,
                ) -> None: ...

            PRECEDING_FIELD_NUMBER: builtins.int
            FOLLOWING_FIELD_NUMBER: builtins.int
            CURRENT_ROW_FIELD_NUMBER: builtins.int
            UNBOUNDED_FIELD_NUMBER: builtins.int
            @property
            def preceding(self) -> Global___Expression.WindowFunction.Bound.Preceding:
                """The bound extends some number of records behind the current record."""

            @property
            def following(self) -> Global___Expression.WindowFunction.Bound.Following:
                """The bound extends some number of records ahead of the current
                record.
                """

            @property
            def current_row(self) -> Global___Expression.WindowFunction.Bound.CurrentRow:
                """The bound extends to the current record."""

            @property
            def unbounded(self) -> Global___Expression.WindowFunction.Bound.Unbounded:
                """The bound extends to the start of the partition or the end of the
                partition, depending on whether this represents the upper or lower
                bound.
                """

            def __init__(
                self,
                *,
                preceding: Global___Expression.WindowFunction.Bound.Preceding | None = ...,
                following: Global___Expression.WindowFunction.Bound.Following | None = ...,
                current_row: Global___Expression.WindowFunction.Bound.CurrentRow | None = ...,
                unbounded: Global___Expression.WindowFunction.Bound.Unbounded | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["current_row", b"current_row", "following", b"following", "kind", b"kind", "preceding", b"preceding", "unbounded", b"unbounded"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["current_row", b"current_row", "following", b"following", "kind", b"kind", "preceding", b"preceding", "unbounded", b"unbounded"]) -> None: ...
            def WhichOneof(self, oneof_group: typing.Literal["kind", b"kind"]) -> typing.Literal["preceding", "following", "current_row", "unbounded"] | None: ...

        FUNCTION_REFERENCE_FIELD_NUMBER: builtins.int
        ARGUMENTS_FIELD_NUMBER: builtins.int
        OPTIONS_FIELD_NUMBER: builtins.int
        OUTPUT_TYPE_FIELD_NUMBER: builtins.int
        PHASE_FIELD_NUMBER: builtins.int
        SORTS_FIELD_NUMBER: builtins.int
        INVOCATION_FIELD_NUMBER: builtins.int
        PARTITIONS_FIELD_NUMBER: builtins.int
        BOUNDS_TYPE_FIELD_NUMBER: builtins.int
        LOWER_BOUND_FIELD_NUMBER: builtins.int
        UPPER_BOUND_FIELD_NUMBER: builtins.int
        ARGS_FIELD_NUMBER: builtins.int
        function_reference: builtins.int
        """Points to a function_anchor defined in this plan. The function must be:
         - a window function
         - an aggregate function

        An aggregate function referenced here should be treated as a window
        function with Window Type STREAMING

        Required.
        """
        phase: Global___AggregationPhase.ValueType
        """Describes which part of the window function to perform within the
        context of distributed algorithms. Required. Must be set to
        INITIAL_TO_RESULT for window functions that are not decomposable.
        """
        invocation: Global___AggregateFunction.AggregationInvocation.ValueType
        """Specifies whether equivalent records are merged before being aggregated.
        Optional, defaults to AGGREGATION_INVOCATION_ALL.
        """
        bounds_type: Global___Expression.WindowFunction.BoundsType.ValueType
        """Defines the bounds type: ROWS, RANGE"""
        @property
        def arguments(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___FunctionArgument]:
            """The arguments to be bound to the function. This must have exactly the
            number of arguments specified in the function definition, and the
            argument types must also match exactly:

             - Value arguments must be bound using FunctionArgument.value, and
               the expression in that must yield a value of a type that a function
               overload is defined for.
             - Type arguments must be bound using FunctionArgument.type, and a
               function overload must be defined for that type.
             - Enum arguments must be bound using FunctionArgument.enum
               followed by Enum.specified, with a string that case-insensitively
               matches one of the allowed options.
            """

        @property
        def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___FunctionOption]:
            """Options to specify behavior for corner cases, or leave behavior
            unspecified if the consumer does not need specific behavior in these
            cases.
            """

        @property
        def output_type(self) -> substrait.type_pb2.Type:
            """Must be set to the return type of the function, exactly as derived
            using the declaration in the extension.
            """

        @property
        def sorts(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___SortField]:
            """If specified, the records that are part of the window defined by
            upper_bound and lower_bound are ordered according to this list
            before they are aggregated. The first sort field has the highest
            priority; only if a sort field determines two records to be equivalent
            is the next field queried. This field is optional, and is only allowed
            if the window function is defined to support sorting.
            """

        @property
        def partitions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]:
            """When one or more partition expressions are specified, two records are
            considered to be in the same partition if and only if these expressions
            yield an equal record of values for both. When computing the window
            function, only the subset of records within the bounds that are also in
            the same partition as the current record are aggregated.
            """

        @property
        def lower_bound(self) -> Global___Expression.WindowFunction.Bound:
            """Defines the record relative to the current record from which the window
            extends. The bound is inclusive. If the lower bound indexes a record
            greater than the upper bound, TODO (null range/no records passed?
            wrapping around as if lower/upper were swapped? error? null?).
            Optional; defaults to the start of the partition.
            """

        @property
        def upper_bound(self) -> Global___Expression.WindowFunction.Bound:
            """Defines the record relative to the current record up to which the window
            extends. The bound is inclusive. If the upper bound indexes a record
            less than the lower bound, TODO (null range/no records passed?
            wrapping around as if lower/upper were swapped? error? null?).
            Optional; defaults to the end of the partition.
            """

        @property
        def args(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]:
            """Deprecated; use arguments instead."""

        def __init__(
            self,
            *,
            function_reference: builtins.int = ...,
            arguments: collections.abc.Iterable[Global___FunctionArgument] | None = ...,
            options: collections.abc.Iterable[Global___FunctionOption] | None = ...,
            output_type: substrait.type_pb2.Type | None = ...,
            phase: Global___AggregationPhase.ValueType = ...,
            sorts: collections.abc.Iterable[Global___SortField] | None = ...,
            invocation: Global___AggregateFunction.AggregationInvocation.ValueType = ...,
            partitions: collections.abc.Iterable[Global___Expression] | None = ...,
            bounds_type: Global___Expression.WindowFunction.BoundsType.ValueType = ...,
            lower_bound: Global___Expression.WindowFunction.Bound | None = ...,
            upper_bound: Global___Expression.WindowFunction.Bound | None = ...,
            args: collections.abc.Iterable[Global___Expression] | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["lower_bound", b"lower_bound", "output_type", b"output_type", "upper_bound", b"upper_bound"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["args", b"args", "arguments", b"arguments", "bounds_type", b"bounds_type", "function_reference", b"function_reference", "invocation", b"invocation", "lower_bound", b"lower_bound", "options", b"options", "output_type", b"output_type", "partitions", b"partitions", "phase", b"phase", "sorts", b"sorts", "upper_bound", b"upper_bound"]) -> None: ...

    @typing.final
    class IfThen(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class IfClause(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            IF_FIELD_NUMBER: builtins.int
            THEN_FIELD_NUMBER: builtins.int
            @property
            def then(self) -> Global___Expression: ...
            def __init__(
                self,
                *,
                then: Global___Expression | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["if", b"if", "then", b"then"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["if", b"if", "then", b"then"]) -> None: ...

        IFS_FIELD_NUMBER: builtins.int
        ELSE_FIELD_NUMBER: builtins.int
        @property
        def ifs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.IfThen.IfClause]:
            """A list of one or more IfClauses"""

        def __init__(
            self,
            *,
            ifs: collections.abc.Iterable[Global___Expression.IfThen.IfClause] | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["else", b"else"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["else", b"else", "ifs", b"ifs"]) -> None: ...

    @typing.final
    class Cast(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        class _FailureBehavior:
            ValueType = typing.NewType("ValueType", builtins.int)
            V: typing_extensions.TypeAlias = ValueType

        class _FailureBehaviorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Expression.Cast._FailureBehavior.ValueType], builtins.type):
            DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
            FAILURE_BEHAVIOR_UNSPECIFIED: Expression.Cast._FailureBehavior.ValueType  # 0
            FAILURE_BEHAVIOR_RETURN_NULL: Expression.Cast._FailureBehavior.ValueType  # 1
            FAILURE_BEHAVIOR_THROW_EXCEPTION: Expression.Cast._FailureBehavior.ValueType  # 2

        class FailureBehavior(_FailureBehavior, metaclass=_FailureBehaviorEnumTypeWrapper): ...
        FAILURE_BEHAVIOR_UNSPECIFIED: Expression.Cast.FailureBehavior.ValueType  # 0
        FAILURE_BEHAVIOR_RETURN_NULL: Expression.Cast.FailureBehavior.ValueType  # 1
        FAILURE_BEHAVIOR_THROW_EXCEPTION: Expression.Cast.FailureBehavior.ValueType  # 2

        TYPE_FIELD_NUMBER: builtins.int
        INPUT_FIELD_NUMBER: builtins.int
        FAILURE_BEHAVIOR_FIELD_NUMBER: builtins.int
        failure_behavior: Global___Expression.Cast.FailureBehavior.ValueType
        @property
        def type(self) -> substrait.type_pb2.Type: ...
        @property
        def input(self) -> Global___Expression: ...
        def __init__(
            self,
            *,
            type: substrait.type_pb2.Type | None = ...,
            input: Global___Expression | None = ...,
            failure_behavior: Global___Expression.Cast.FailureBehavior.ValueType = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["input", b"input", "type", b"type"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["failure_behavior", b"failure_behavior", "input", b"input", "type", b"type"]) -> None: ...

    @typing.final
    class SwitchExpression(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class IfValue(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            IF_FIELD_NUMBER: builtins.int
            THEN_FIELD_NUMBER: builtins.int
            @property
            def then(self) -> Global___Expression: ...
            def __init__(
                self,
                *,
                then: Global___Expression | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["if", b"if", "then", b"then"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["if", b"if", "then", b"then"]) -> None: ...

        MATCH_FIELD_NUMBER: builtins.int
        IFS_FIELD_NUMBER: builtins.int
        ELSE_FIELD_NUMBER: builtins.int
        @property
        def match(self) -> Global___Expression: ...
        @property
        def ifs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.SwitchExpression.IfValue]: ...
        def __init__(
            self,
            *,
            match: Global___Expression | None = ...,
            ifs: collections.abc.Iterable[Global___Expression.SwitchExpression.IfValue] | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["else", b"else", "match", b"match"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["else", b"else", "ifs", b"ifs", "match", b"match"]) -> None: ...

    @typing.final
    class SingularOrList(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        VALUE_FIELD_NUMBER: builtins.int
        OPTIONS_FIELD_NUMBER: builtins.int
        @property
        def value(self) -> Global___Expression: ...
        @property
        def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]: ...
        def __init__(
            self,
            *,
            value: Global___Expression | None = ...,
            options: collections.abc.Iterable[Global___Expression] | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["value", b"value"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["options", b"options", "value", b"value"]) -> None: ...

    @typing.final
    class MultiOrList(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class Record(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            FIELDS_FIELD_NUMBER: builtins.int
            @property
            def fields(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]: ...
            def __init__(
                self,
                *,
                fields: collections.abc.Iterable[Global___Expression] | None = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["fields", b"fields"]) -> None: ...

        VALUE_FIELD_NUMBER: builtins.int
        OPTIONS_FIELD_NUMBER: builtins.int
        @property
        def value(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]: ...
        @property
        def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.MultiOrList.Record]: ...
        def __init__(
            self,
            *,
            value: collections.abc.Iterable[Global___Expression] | None = ...,
            options: collections.abc.Iterable[Global___Expression.MultiOrList.Record] | None = ...,
        ) -> None: ...
        def ClearField(self, field_name: typing.Literal["options", b"options", "value", b"value"]) -> None: ...

    @typing.final
    class EmbeddedFunction(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class PythonPickleFunction(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            FUNCTION_FIELD_NUMBER: builtins.int
            PREREQUISITE_FIELD_NUMBER: builtins.int
            function: builtins.bytes
            @property
            def prerequisite(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
            def __init__(
                self,
                *,
                function: builtins.bytes = ...,
                prerequisite: collections.abc.Iterable[builtins.str] | None = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["function", b"function", "prerequisite", b"prerequisite"]) -> None: ...

        @typing.final
        class WebAssemblyFunction(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            SCRIPT_FIELD_NUMBER: builtins.int
            PREREQUISITE_FIELD_NUMBER: builtins.int
            script: builtins.bytes
            @property
            def prerequisite(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
            def __init__(
                self,
                *,
                script: builtins.bytes = ...,
                prerequisite: collections.abc.Iterable[builtins.str] | None = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["prerequisite", b"prerequisite", "script", b"script"]) -> None: ...

        ARGUMENTS_FIELD_NUMBER: builtins.int
        OUTPUT_TYPE_FIELD_NUMBER: builtins.int
        PYTHON_PICKLE_FUNCTION_FIELD_NUMBER: builtins.int
        WEB_ASSEMBLY_FUNCTION_FIELD_NUMBER: builtins.int
        @property
        def arguments(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]: ...
        @property
        def output_type(self) -> substrait.type_pb2.Type: ...
        @property
        def python_pickle_function(self) -> Global___Expression.EmbeddedFunction.PythonPickleFunction: ...
        @property
        def web_assembly_function(self) -> Global___Expression.EmbeddedFunction.WebAssemblyFunction: ...
        def __init__(
            self,
            *,
            arguments: collections.abc.Iterable[Global___Expression] | None = ...,
            output_type: substrait.type_pb2.Type | None = ...,
            python_pickle_function: Global___Expression.EmbeddedFunction.PythonPickleFunction | None = ...,
            web_assembly_function: Global___Expression.EmbeddedFunction.WebAssemblyFunction | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["kind", b"kind", "output_type", b"output_type", "python_pickle_function", b"python_pickle_function", "web_assembly_function", b"web_assembly_function"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["arguments", b"arguments", "kind", b"kind", "output_type", b"output_type", "python_pickle_function", b"python_pickle_function", "web_assembly_function", b"web_assembly_function"]) -> None: ...
        def WhichOneof(self, oneof_group: typing.Literal["kind", b"kind"]) -> typing.Literal["python_pickle_function", "web_assembly_function"] | None: ...

    @typing.final
    class ReferenceSegment(google.protobuf.message.Message):
        """A way to reference the inner property of a complex record. Can reference
        either a map key by literal, a struct field by the ordinal position of
        the desired field or a particular element in an array. Supports
        expressions that would roughly translate to something similar to:
        a.b[2].c['my_map_key'].x where a,b,c and x are struct field references
        (ordinalized in the internal representation here), [2] is a list offset
        and ['my_map_key'] is a reference into a map field.
        """

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class MapKey(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            MAP_KEY_FIELD_NUMBER: builtins.int
            CHILD_FIELD_NUMBER: builtins.int
            @property
            def map_key(self) -> Global___Expression.Literal:
                """literal based reference to specific possible value in map."""

            @property
            def child(self) -> Global___Expression.ReferenceSegment:
                """Optional child segment"""

            def __init__(
                self,
                *,
                map_key: Global___Expression.Literal | None = ...,
                child: Global___Expression.ReferenceSegment | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["child", b"child", "map_key", b"map_key"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["child", b"child", "map_key", b"map_key"]) -> None: ...

        @typing.final
        class StructField(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            FIELD_FIELD_NUMBER: builtins.int
            CHILD_FIELD_NUMBER: builtins.int
            field: builtins.int
            """zero-indexed ordinal position of field in struct"""
            @property
            def child(self) -> Global___Expression.ReferenceSegment:
                """Optional child segment"""

            def __init__(
                self,
                *,
                field: builtins.int = ...,
                child: Global___Expression.ReferenceSegment | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["child", b"child"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["child", b"child", "field", b"field"]) -> None: ...

        @typing.final
        class ListElement(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            OFFSET_FIELD_NUMBER: builtins.int
            CHILD_FIELD_NUMBER: builtins.int
            offset: builtins.int
            """zero-indexed ordinal position of element in list"""
            @property
            def child(self) -> Global___Expression.ReferenceSegment:
                """Optional child segment"""

            def __init__(
                self,
                *,
                offset: builtins.int = ...,
                child: Global___Expression.ReferenceSegment | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["child", b"child"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["child", b"child", "offset", b"offset"]) -> None: ...

        MAP_KEY_FIELD_NUMBER: builtins.int
        STRUCT_FIELD_FIELD_NUMBER: builtins.int
        LIST_ELEMENT_FIELD_NUMBER: builtins.int
        @property
        def map_key(self) -> Global___Expression.ReferenceSegment.MapKey: ...
        @property
        def struct_field(self) -> Global___Expression.ReferenceSegment.StructField: ...
        @property
        def list_element(self) -> Global___Expression.ReferenceSegment.ListElement: ...
        def __init__(
            self,
            *,
            map_key: Global___Expression.ReferenceSegment.MapKey | None = ...,
            struct_field: Global___Expression.ReferenceSegment.StructField | None = ...,
            list_element: Global___Expression.ReferenceSegment.ListElement | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["list_element", b"list_element", "map_key", b"map_key", "reference_type", b"reference_type", "struct_field", b"struct_field"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["list_element", b"list_element", "map_key", b"map_key", "reference_type", b"reference_type", "struct_field", b"struct_field"]) -> None: ...
        def WhichOneof(self, oneof_group: typing.Literal["reference_type", b"reference_type"]) -> typing.Literal["map_key", "struct_field", "list_element"] | None: ...

    @typing.final
    class MaskExpression(google.protobuf.message.Message):
        """A reference that takes an existing subtype and selectively removes fields
        from it. For example, one might initially have an inner struct with 100
        fields but a a particular operation only needs to interact with only 2 of
        those 100 fields. In this situation, one would use a mask expression to
        eliminate the 98 fields that are not relevant to the rest of the operation
        pipeline.

        Note that this does not fundamentally alter the structure of data beyond
        the elimination of unnecessary elements.
        """

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class Select(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            STRUCT_FIELD_NUMBER: builtins.int
            LIST_FIELD_NUMBER: builtins.int
            MAP_FIELD_NUMBER: builtins.int
            @property
            def struct(self) -> Global___Expression.MaskExpression.StructSelect: ...
            @property
            def list(self) -> Global___Expression.MaskExpression.ListSelect: ...
            @property
            def map(self) -> Global___Expression.MaskExpression.MapSelect: ...
            def __init__(
                self,
                *,
                struct: Global___Expression.MaskExpression.StructSelect | None = ...,
                list: Global___Expression.MaskExpression.ListSelect | None = ...,
                map: Global___Expression.MaskExpression.MapSelect | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["list", b"list", "map", b"map", "struct", b"struct", "type", b"type"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["list", b"list", "map", b"map", "struct", b"struct", "type", b"type"]) -> None: ...
            def WhichOneof(self, oneof_group: typing.Literal["type", b"type"]) -> typing.Literal["struct", "list", "map"] | None: ...

        @typing.final
        class StructSelect(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            STRUCT_ITEMS_FIELD_NUMBER: builtins.int
            @property
            def struct_items(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.MaskExpression.StructItem]: ...
            def __init__(
                self,
                *,
                struct_items: collections.abc.Iterable[Global___Expression.MaskExpression.StructItem] | None = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["struct_items", b"struct_items"]) -> None: ...

        @typing.final
        class StructItem(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            FIELD_FIELD_NUMBER: builtins.int
            CHILD_FIELD_NUMBER: builtins.int
            field: builtins.int
            @property
            def child(self) -> Global___Expression.MaskExpression.Select: ...
            def __init__(
                self,
                *,
                field: builtins.int = ...,
                child: Global___Expression.MaskExpression.Select | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["child", b"child"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["child", b"child", "field", b"field"]) -> None: ...

        @typing.final
        class ListSelect(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            @typing.final
            class ListSelectItem(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                @typing.final
                class ListElement(google.protobuf.message.Message):
                    DESCRIPTOR: google.protobuf.descriptor.Descriptor

                    FIELD_FIELD_NUMBER: builtins.int
                    field: builtins.int
                    def __init__(
                        self,
                        *,
                        field: builtins.int = ...,
                    ) -> None: ...
                    def ClearField(self, field_name: typing.Literal["field", b"field"]) -> None: ...

                @typing.final
                class ListSlice(google.protobuf.message.Message):
                    DESCRIPTOR: google.protobuf.descriptor.Descriptor

                    START_FIELD_NUMBER: builtins.int
                    END_FIELD_NUMBER: builtins.int
                    start: builtins.int
                    end: builtins.int
                    def __init__(
                        self,
                        *,
                        start: builtins.int = ...,
                        end: builtins.int = ...,
                    ) -> None: ...
                    def ClearField(self, field_name: typing.Literal["end", b"end", "start", b"start"]) -> None: ...

                ITEM_FIELD_NUMBER: builtins.int
                SLICE_FIELD_NUMBER: builtins.int
                @property
                def item(self) -> Global___Expression.MaskExpression.ListSelect.ListSelectItem.ListElement: ...
                @property
                def slice(self) -> Global___Expression.MaskExpression.ListSelect.ListSelectItem.ListSlice: ...
                def __init__(
                    self,
                    *,
                    item: Global___Expression.MaskExpression.ListSelect.ListSelectItem.ListElement | None = ...,
                    slice: Global___Expression.MaskExpression.ListSelect.ListSelectItem.ListSlice | None = ...,
                ) -> None: ...
                def HasField(self, field_name: typing.Literal["item", b"item", "slice", b"slice", "type", b"type"]) -> builtins.bool: ...
                def ClearField(self, field_name: typing.Literal["item", b"item", "slice", b"slice", "type", b"type"]) -> None: ...
                def WhichOneof(self, oneof_group: typing.Literal["type", b"type"]) -> typing.Literal["item", "slice"] | None: ...

            SELECTION_FIELD_NUMBER: builtins.int
            CHILD_FIELD_NUMBER: builtins.int
            @property
            def selection(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression.MaskExpression.ListSelect.ListSelectItem]: ...
            @property
            def child(self) -> Global___Expression.MaskExpression.Select: ...
            def __init__(
                self,
                *,
                selection: collections.abc.Iterable[Global___Expression.MaskExpression.ListSelect.ListSelectItem] | None = ...,
                child: Global___Expression.MaskExpression.Select | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["child", b"child"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["child", b"child", "selection", b"selection"]) -> None: ...

        @typing.final
        class MapSelect(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            @typing.final
            class MapKey(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                MAP_KEY_FIELD_NUMBER: builtins.int
                map_key: builtins.str
                def __init__(
                    self,
                    *,
                    map_key: builtins.str = ...,
                ) -> None: ...
                def ClearField(self, field_name: typing.Literal["map_key", b"map_key"]) -> None: ...

            @typing.final
            class MapKeyExpression(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor

                MAP_KEY_EXPRESSION_FIELD_NUMBER: builtins.int
                map_key_expression: builtins.str
                def __init__(
                    self,
                    *,
                    map_key_expression: builtins.str = ...,
                ) -> None: ...
                def ClearField(self, field_name: typing.Literal["map_key_expression", b"map_key_expression"]) -> None: ...

            KEY_FIELD_NUMBER: builtins.int
            EXPRESSION_FIELD_NUMBER: builtins.int
            CHILD_FIELD_NUMBER: builtins.int
            @property
            def key(self) -> Global___Expression.MaskExpression.MapSelect.MapKey: ...
            @property
            def expression(self) -> Global___Expression.MaskExpression.MapSelect.MapKeyExpression: ...
            @property
            def child(self) -> Global___Expression.MaskExpression.Select: ...
            def __init__(
                self,
                *,
                key: Global___Expression.MaskExpression.MapSelect.MapKey | None = ...,
                expression: Global___Expression.MaskExpression.MapSelect.MapKeyExpression | None = ...,
                child: Global___Expression.MaskExpression.Select | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["child", b"child", "expression", b"expression", "key", b"key", "select", b"select"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["child", b"child", "expression", b"expression", "key", b"key", "select", b"select"]) -> None: ...
            def WhichOneof(self, oneof_group: typing.Literal["select", b"select"]) -> typing.Literal["key", "expression"] | None: ...

        SELECT_FIELD_NUMBER: builtins.int
        MAINTAIN_SINGULAR_STRUCT_FIELD_NUMBER: builtins.int
        maintain_singular_struct: builtins.bool
        @property
        def select(self) -> Global___Expression.MaskExpression.StructSelect: ...
        def __init__(
            self,
            *,
            select: Global___Expression.MaskExpression.StructSelect | None = ...,
            maintain_singular_struct: builtins.bool = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["select", b"select"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["maintain_singular_struct", b"maintain_singular_struct", "select", b"select"]) -> None: ...

    @typing.final
    class FieldReference(google.protobuf.message.Message):
        """A reference to data within a structured object, supporting navigation into
        nested fields. The root_type specifies the origin of the data (input record,
        outer query, lambda parameters, or an arbitrary expression), and the
        reference_type specifies how to navigate from that root (either a direct
        path to a single element or a mask selecting multiple elements).
        """

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class RootReference(google.protobuf.message.Message):
            """Singleton that expresses this FieldReference is rooted off the root
            incoming record type
            """

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            def __init__(
                self,
            ) -> None: ...

        @typing.final
        class OuterReference(google.protobuf.message.Message):
            """A root reference for the outer relation's subquery"""

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            STEPS_OUT_FIELD_NUMBER: builtins.int
            steps_out: builtins.int
            """number of subquery boundaries to traverse up for this field's reference

            This value must be >= 1
            """
            def __init__(
                self,
                *,
                steps_out: builtins.int = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["steps_out", b"steps_out"]) -> None: ...

        @typing.final
        class LambdaParameterReference(google.protobuf.message.Message):
            """A reference to a lambda parameter within a lambda body expression.
            This identifies which lambda scope to reference, treating its parameters
            as a struct. Use FieldReference with this as root_type to access specific
            parameters or nested fields within parameters.
            """

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            STEPS_OUT_FIELD_NUMBER: builtins.int
            steps_out: builtins.int
            """Number of lambda boundaries to traverse up for this reference.
            For nested lambdas:
              0 = innermost lambda (current lambda's parameters as a struct)
              1 = one lambda level out (outer lambda's parameters as a struct)
              2 = two lambda levels out, etc.
            """
            def __init__(
                self,
                *,
                steps_out: builtins.int = ...,
            ) -> None: ...
            def ClearField(self, field_name: typing.Literal["steps_out", b"steps_out"]) -> None: ...

        DIRECT_REFERENCE_FIELD_NUMBER: builtins.int
        MASKED_REFERENCE_FIELD_NUMBER: builtins.int
        EXPRESSION_FIELD_NUMBER: builtins.int
        ROOT_REFERENCE_FIELD_NUMBER: builtins.int
        OUTER_REFERENCE_FIELD_NUMBER: builtins.int
        LAMBDA_PARAMETER_REFERENCE_FIELD_NUMBER: builtins.int
        @property
        def direct_reference(self) -> Global___Expression.ReferenceSegment: ...
        @property
        def masked_reference(self) -> Global___Expression.MaskExpression: ...
        @property
        def expression(self) -> Global___Expression: ...
        @property
        def root_reference(self) -> Global___Expression.FieldReference.RootReference: ...
        @property
        def outer_reference(self) -> Global___Expression.FieldReference.OuterReference: ...
        @property
        def lambda_parameter_reference(self) -> Global___Expression.FieldReference.LambdaParameterReference: ...
        def __init__(
            self,
            *,
            direct_reference: Global___Expression.ReferenceSegment | None = ...,
            masked_reference: Global___Expression.MaskExpression | None = ...,
            expression: Global___Expression | None = ...,
            root_reference: Global___Expression.FieldReference.RootReference | None = ...,
            outer_reference: Global___Expression.FieldReference.OuterReference | None = ...,
            lambda_parameter_reference: Global___Expression.FieldReference.LambdaParameterReference | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["direct_reference", b"direct_reference", "expression", b"expression", "lambda_parameter_reference", b"lambda_parameter_reference", "masked_reference", b"masked_reference", "outer_reference", b"outer_reference", "reference_type", b"reference_type", "root_reference", b"root_reference", "root_type", b"root_type"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["direct_reference", b"direct_reference", "expression", b"expression", "lambda_parameter_reference", b"lambda_parameter_reference", "masked_reference", b"masked_reference", "outer_reference", b"outer_reference", "reference_type", b"reference_type", "root_reference", b"root_reference", "root_type", b"root_type"]) -> None: ...
        @typing.overload
        def WhichOneof(self, oneof_group: typing.Literal["reference_type", b"reference_type"]) -> typing.Literal["direct_reference", "masked_reference"] | None: ...
        @typing.overload
        def WhichOneof(self, oneof_group: typing.Literal["root_type", b"root_type"]) -> typing.Literal["expression", "root_reference", "outer_reference", "lambda_parameter_reference"] | None: ...

    @typing.final
    class Subquery(google.protobuf.message.Message):
        """Subquery relation expression"""

        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        @typing.final
        class Scalar(google.protobuf.message.Message):
            """A subquery with one row and one column. This is often an aggregate
            though not required to be.
            """

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            INPUT_FIELD_NUMBER: builtins.int
            @property
            def input(self) -> Global___Rel: ...
            def __init__(
                self,
                *,
                input: Global___Rel | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["input", b"input"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["input", b"input"]) -> None: ...

        @typing.final
        class InPredicate(google.protobuf.message.Message):
            """Predicate checking that the left expression is contained in the right
            subquery

            Examples:

            x IN (SELECT * FROM t)
            (x, y) IN (SELECT a, b FROM t)
            """

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            NEEDLES_FIELD_NUMBER: builtins.int
            HAYSTACK_FIELD_NUMBER: builtins.int
            @property
            def needles(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]: ...
            @property
            def haystack(self) -> Global___Rel: ...
            def __init__(
                self,
                *,
                needles: collections.abc.Iterable[Global___Expression] | None = ...,
                haystack: Global___Rel | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["haystack", b"haystack"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["haystack", b"haystack", "needles", b"needles"]) -> None: ...

        @typing.final
        class SetPredicate(google.protobuf.message.Message):
            """A predicate over a set of rows in the form of a subquery
            EXISTS and UNIQUE are common SQL forms of this operation.
            """

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            class _PredicateOp:
                ValueType = typing.NewType("ValueType", builtins.int)
                V: typing_extensions.TypeAlias = ValueType

            class _PredicateOpEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Expression.Subquery.SetPredicate._PredicateOp.ValueType], builtins.type):
                DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
                PREDICATE_OP_UNSPECIFIED: Expression.Subquery.SetPredicate._PredicateOp.ValueType  # 0
                PREDICATE_OP_EXISTS: Expression.Subquery.SetPredicate._PredicateOp.ValueType  # 1
                PREDICATE_OP_UNIQUE: Expression.Subquery.SetPredicate._PredicateOp.ValueType  # 2

            class PredicateOp(_PredicateOp, metaclass=_PredicateOpEnumTypeWrapper): ...
            PREDICATE_OP_UNSPECIFIED: Expression.Subquery.SetPredicate.PredicateOp.ValueType  # 0
            PREDICATE_OP_EXISTS: Expression.Subquery.SetPredicate.PredicateOp.ValueType  # 1
            PREDICATE_OP_UNIQUE: Expression.Subquery.SetPredicate.PredicateOp.ValueType  # 2

            PREDICATE_OP_FIELD_NUMBER: builtins.int
            TUPLES_FIELD_NUMBER: builtins.int
            predicate_op: Global___Expression.Subquery.SetPredicate.PredicateOp.ValueType
            """TODO: should allow expressions"""
            @property
            def tuples(self) -> Global___Rel: ...
            def __init__(
                self,
                *,
                predicate_op: Global___Expression.Subquery.SetPredicate.PredicateOp.ValueType = ...,
                tuples: Global___Rel | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["tuples", b"tuples"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["predicate_op", b"predicate_op", "tuples", b"tuples"]) -> None: ...

        @typing.final
        class SetComparison(google.protobuf.message.Message):
            """A subquery comparison using ANY or ALL.
            Examples:

            SELECT *
            FROM t1
            WHERE x < ANY(SELECT y from t2)
            """

            DESCRIPTOR: google.protobuf.descriptor.Descriptor

            class _ComparisonOp:
                ValueType = typing.NewType("ValueType", builtins.int)
                V: typing_extensions.TypeAlias = ValueType

            class _ComparisonOpEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Expression.Subquery.SetComparison._ComparisonOp.ValueType], builtins.type):
                DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
                COMPARISON_OP_UNSPECIFIED: Expression.Subquery.SetComparison._ComparisonOp.ValueType  # 0
                COMPARISON_OP_EQ: Expression.Subquery.SetComparison._ComparisonOp.ValueType  # 1
                COMPARISON_OP_NE: Expression.Subquery.SetComparison._ComparisonOp.ValueType  # 2
                COMPARISON_OP_LT: Expression.Subquery.SetComparison._ComparisonOp.ValueType  # 3
                COMPARISON_OP_GT: Expression.Subquery.SetComparison._ComparisonOp.ValueType  # 4
                COMPARISON_OP_LE: Expression.Subquery.SetComparison._ComparisonOp.ValueType  # 5
                COMPARISON_OP_GE: Expression.Subquery.SetComparison._ComparisonOp.ValueType  # 6

            class ComparisonOp(_ComparisonOp, metaclass=_ComparisonOpEnumTypeWrapper): ...
            COMPARISON_OP_UNSPECIFIED: Expression.Subquery.SetComparison.ComparisonOp.ValueType  # 0
            COMPARISON_OP_EQ: Expression.Subquery.SetComparison.ComparisonOp.ValueType  # 1
            COMPARISON_OP_NE: Expression.Subquery.SetComparison.ComparisonOp.ValueType  # 2
            COMPARISON_OP_LT: Expression.Subquery.SetComparison.ComparisonOp.ValueType  # 3
            COMPARISON_OP_GT: Expression.Subquery.SetComparison.ComparisonOp.ValueType  # 4
            COMPARISON_OP_LE: Expression.Subquery.SetComparison.ComparisonOp.ValueType  # 5
            COMPARISON_OP_GE: Expression.Subquery.SetComparison.ComparisonOp.ValueType  # 6

            class _ReductionOp:
                ValueType = typing.NewType("ValueType", builtins.int)
                V: typing_extensions.TypeAlias = ValueType

            class _ReductionOpEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Expression.Subquery.SetComparison._ReductionOp.ValueType], builtins.type):
                DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
                REDUCTION_OP_UNSPECIFIED: Expression.Subquery.SetComparison._ReductionOp.ValueType  # 0
                REDUCTION_OP_ANY: Expression.Subquery.SetComparison._ReductionOp.ValueType  # 1
                REDUCTION_OP_ALL: Expression.Subquery.SetComparison._ReductionOp.ValueType  # 2

            class ReductionOp(_ReductionOp, metaclass=_ReductionOpEnumTypeWrapper): ...
            REDUCTION_OP_UNSPECIFIED: Expression.Subquery.SetComparison.ReductionOp.ValueType  # 0
            REDUCTION_OP_ANY: Expression.Subquery.SetComparison.ReductionOp.ValueType  # 1
            REDUCTION_OP_ALL: Expression.Subquery.SetComparison.ReductionOp.ValueType  # 2

            REDUCTION_OP_FIELD_NUMBER: builtins.int
            COMPARISON_OP_FIELD_NUMBER: builtins.int
            LEFT_FIELD_NUMBER: builtins.int
            RIGHT_FIELD_NUMBER: builtins.int
            reduction_op: Global___Expression.Subquery.SetComparison.ReductionOp.ValueType
            """ANY or ALL"""
            comparison_op: Global___Expression.Subquery.SetComparison.ComparisonOp.ValueType
            """A comparison operator"""
            @property
            def left(self) -> Global___Expression:
                """left side of the expression"""

            @property
            def right(self) -> Global___Rel:
                """right side of the expression"""

            def __init__(
                self,
                *,
                reduction_op: Global___Expression.Subquery.SetComparison.ReductionOp.ValueType = ...,
                comparison_op: Global___Expression.Subquery.SetComparison.ComparisonOp.ValueType = ...,
                left: Global___Expression | None = ...,
                right: Global___Rel | None = ...,
            ) -> None: ...
            def HasField(self, field_name: typing.Literal["left", b"left", "right", b"right"]) -> builtins.bool: ...
            def ClearField(self, field_name: typing.Literal["comparison_op", b"comparison_op", "left", b"left", "reduction_op", b"reduction_op", "right", b"right"]) -> None: ...

        SCALAR_FIELD_NUMBER: builtins.int
        IN_PREDICATE_FIELD_NUMBER: builtins.int
        SET_PREDICATE_FIELD_NUMBER: builtins.int
        SET_COMPARISON_FIELD_NUMBER: builtins.int
        @property
        def scalar(self) -> Global___Expression.Subquery.Scalar:
            """Scalar subquery"""

        @property
        def in_predicate(self) -> Global___Expression.Subquery.InPredicate:
            """x IN y predicate"""

        @property
        def set_predicate(self) -> Global___Expression.Subquery.SetPredicate:
            """EXISTS/UNIQUE predicate"""

        @property
        def set_comparison(self) -> Global___Expression.Subquery.SetComparison:
            """ANY/ALL predicate"""

        def __init__(
            self,
            *,
            scalar: Global___Expression.Subquery.Scalar | None = ...,
            in_predicate: Global___Expression.Subquery.InPredicate | None = ...,
            set_predicate: Global___Expression.Subquery.SetPredicate | None = ...,
            set_comparison: Global___Expression.Subquery.SetComparison | None = ...,
        ) -> None: ...
        def HasField(self, field_name: typing.Literal["in_predicate", b"in_predicate", "scalar", b"scalar", "set_comparison", b"set_comparison", "set_predicate", b"set_predicate", "subquery_type", b"subquery_type"]) -> builtins.bool: ...
        def ClearField(self, field_name: typing.Literal["in_predicate", b"in_predicate", "scalar", b"scalar", "set_comparison", b"set_comparison", "set_predicate", b"set_predicate", "subquery_type", b"subquery_type"]) -> None: ...
        def WhichOneof(self, oneof_group: typing.Literal["subquery_type", b"subquery_type"]) -> typing.Literal["scalar", "in_predicate", "set_predicate", "set_comparison"] | None: ...

    LITERAL_FIELD_NUMBER: builtins.int
    SELECTION_FIELD_NUMBER: builtins.int
    SCALAR_FUNCTION_FIELD_NUMBER: builtins.int
    WINDOW_FUNCTION_FIELD_NUMBER: builtins.int
    IF_THEN_FIELD_NUMBER: builtins.int
    SWITCH_EXPRESSION_FIELD_NUMBER: builtins.int
    SINGULAR_OR_LIST_FIELD_NUMBER: builtins.int
    MULTI_OR_LIST_FIELD_NUMBER: builtins.int
    CAST_FIELD_NUMBER: builtins.int
    SUBQUERY_FIELD_NUMBER: builtins.int
    NESTED_FIELD_NUMBER: builtins.int
    DYNAMIC_PARAMETER_FIELD_NUMBER: builtins.int
    LAMBDA_FIELD_NUMBER: builtins.int
    LAMBDA_INVOCATION_FIELD_NUMBER: builtins.int
    ENUM_FIELD_NUMBER: builtins.int
    @property
    def literal(self) -> Global___Expression.Literal: ...
    @property
    def selection(self) -> Global___Expression.FieldReference: ...
    @property
    def scalar_function(self) -> Global___Expression.ScalarFunction: ...
    @property
    def window_function(self) -> Global___Expression.WindowFunction: ...
    @property
    def if_then(self) -> Global___Expression.IfThen: ...
    @property
    def switch_expression(self) -> Global___Expression.SwitchExpression: ...
    @property
    def singular_or_list(self) -> Global___Expression.SingularOrList: ...
    @property
    def multi_or_list(self) -> Global___Expression.MultiOrList: ...
    @property
    def cast(self) -> Global___Expression.Cast: ...
    @property
    def subquery(self) -> Global___Expression.Subquery: ...
    @property
    def nested(self) -> Global___Expression.Nested: ...
    @property
    def dynamic_parameter(self) -> Global___DynamicParameter: ...
    @property
    def lambda_invocation(self) -> Global___Expression.LambdaInvocation: ...
    @property
    def enum(self) -> Global___Expression.Enum:
        """deprecated: enum literals are only sensible in the context of
        function arguments, for which FunctionArgument should now be
        used
        """

    def __init__(
        self,
        *,
        literal: Global___Expression.Literal | None = ...,
        selection: Global___Expression.FieldReference | None = ...,
        scalar_function: Global___Expression.ScalarFunction | None = ...,
        window_function: Global___Expression.WindowFunction | None = ...,
        if_then: Global___Expression.IfThen | None = ...,
        switch_expression: Global___Expression.SwitchExpression | None = ...,
        singular_or_list: Global___Expression.SingularOrList | None = ...,
        multi_or_list: Global___Expression.MultiOrList | None = ...,
        cast: Global___Expression.Cast | None = ...,
        subquery: Global___Expression.Subquery | None = ...,
        nested: Global___Expression.Nested | None = ...,
        dynamic_parameter: Global___DynamicParameter | None = ...,
        lambda_invocation: Global___Expression.LambdaInvocation | None = ...,
        enum: Global___Expression.Enum | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["cast", b"cast", "dynamic_parameter", b"dynamic_parameter", "enum", b"enum", "if_then", b"if_then", "lambda", b"lambda", "lambda_invocation", b"lambda_invocation", "literal", b"literal", "multi_or_list", b"multi_or_list", "nested", b"nested", "rex_type", b"rex_type", "scalar_function", b"scalar_function", "selection", b"selection", "singular_or_list", b"singular_or_list", "subquery", b"subquery", "switch_expression", b"switch_expression", "window_function", b"window_function"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["cast", b"cast", "dynamic_parameter", b"dynamic_parameter", "enum", b"enum", "if_then", b"if_then", "lambda", b"lambda", "lambda_invocation", b"lambda_invocation", "literal", b"literal", "multi_or_list", b"multi_or_list", "nested", b"nested", "rex_type", b"rex_type", "scalar_function", b"scalar_function", "selection", b"selection", "singular_or_list", b"singular_or_list", "subquery", b"subquery", "switch_expression", b"switch_expression", "window_function", b"window_function"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["rex_type", b"rex_type"]) -> typing.Literal["literal", "selection", "scalar_function", "window_function", "if_then", "switch_expression", "singular_or_list", "multi_or_list", "cast", "subquery", "nested", "dynamic_parameter", "lambda", "lambda_invocation", "enum"] | None: ...

Global___Expression: typing_extensions.TypeAlias = Expression

@typing.final
class DynamicParameter(google.protobuf.message.Message):
    """Expression that represents a dynamic parameter.
    Dynamic parameters are identified by a surrogate key within a plan.
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    TYPE_FIELD_NUMBER: builtins.int
    PARAMETER_REFERENCE_FIELD_NUMBER: builtins.int
    parameter_reference: builtins.int
    """The surrogate key used within a plan to reference a specific parameter binding.
    0 is a valid anchor/reference, but prefer non-zero values for ergonomics.
    """
    @property
    def type(self) -> substrait.type_pb2.Type:
        """The type of the dynamic parameter."""

    def __init__(
        self,
        *,
        type: substrait.type_pb2.Type | None = ...,
        parameter_reference: builtins.int = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["type", b"type"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["parameter_reference", b"parameter_reference", "type", b"type"]) -> None: ...

Global___DynamicParameter: typing_extensions.TypeAlias = DynamicParameter

@typing.final
class SortField(google.protobuf.message.Message):
    """The description of a field to sort on (including the direction of sorting and null semantics)"""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _SortDirection:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _SortDirectionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[SortField._SortDirection.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        SORT_DIRECTION_UNSPECIFIED: SortField._SortDirection.ValueType  # 0
        SORT_DIRECTION_ASC_NULLS_FIRST: SortField._SortDirection.ValueType  # 1
        SORT_DIRECTION_ASC_NULLS_LAST: SortField._SortDirection.ValueType  # 2
        SORT_DIRECTION_DESC_NULLS_FIRST: SortField._SortDirection.ValueType  # 3
        SORT_DIRECTION_DESC_NULLS_LAST: SortField._SortDirection.ValueType  # 4
        SORT_DIRECTION_CLUSTERED: SortField._SortDirection.ValueType  # 5

    class SortDirection(_SortDirection, metaclass=_SortDirectionEnumTypeWrapper): ...
    SORT_DIRECTION_UNSPECIFIED: SortField.SortDirection.ValueType  # 0
    SORT_DIRECTION_ASC_NULLS_FIRST: SortField.SortDirection.ValueType  # 1
    SORT_DIRECTION_ASC_NULLS_LAST: SortField.SortDirection.ValueType  # 2
    SORT_DIRECTION_DESC_NULLS_FIRST: SortField.SortDirection.ValueType  # 3
    SORT_DIRECTION_DESC_NULLS_LAST: SortField.SortDirection.ValueType  # 4
    SORT_DIRECTION_CLUSTERED: SortField.SortDirection.ValueType  # 5

    EXPR_FIELD_NUMBER: builtins.int
    DIRECTION_FIELD_NUMBER: builtins.int
    COMPARISON_FUNCTION_REFERENCE_FIELD_NUMBER: builtins.int
    direction: Global___SortField.SortDirection.ValueType
    comparison_function_reference: builtins.int
    """References a function_anchor defined in this plan."""
    @property
    def expr(self) -> Global___Expression: ...
    def __init__(
        self,
        *,
        expr: Global___Expression | None = ...,
        direction: Global___SortField.SortDirection.ValueType = ...,
        comparison_function_reference: builtins.int = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["comparison_function_reference", b"comparison_function_reference", "direction", b"direction", "expr", b"expr", "sort_kind", b"sort_kind"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["comparison_function_reference", b"comparison_function_reference", "direction", b"direction", "expr", b"expr", "sort_kind", b"sort_kind"]) -> None: ...
    def WhichOneof(self, oneof_group: typing.Literal["sort_kind", b"sort_kind"]) -> typing.Literal["direction", "comparison_function_reference"] | None: ...

Global___SortField: typing_extensions.TypeAlias = SortField

@typing.final
class AggregateFunction(google.protobuf.message.Message):
    """An aggregate function."""

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    class _AggregationInvocation:
        ValueType = typing.NewType("ValueType", builtins.int)
        V: typing_extensions.TypeAlias = ValueType

    class _AggregationInvocationEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[AggregateFunction._AggregationInvocation.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
        AGGREGATION_INVOCATION_UNSPECIFIED: AggregateFunction._AggregationInvocation.ValueType  # 0
        """This default value implies AGGREGATION_INVOCATION_ALL."""
        AGGREGATION_INVOCATION_ALL: AggregateFunction._AggregationInvocation.ValueType  # 1
        """Use all values in the aggregation calculation."""
        AGGREGATION_INVOCATION_DISTINCT: AggregateFunction._AggregationInvocation.ValueType  # 2
        """Use only distinct values in the aggregation calculation."""

    class AggregationInvocation(_AggregationInvocation, metaclass=_AggregationInvocationEnumTypeWrapper):
        """Method in which equivalent records are merged before being aggregated."""

    AGGREGATION_INVOCATION_UNSPECIFIED: AggregateFunction.AggregationInvocation.ValueType  # 0
    """This default value implies AGGREGATION_INVOCATION_ALL."""
    AGGREGATION_INVOCATION_ALL: AggregateFunction.AggregationInvocation.ValueType  # 1
    """Use all values in the aggregation calculation."""
    AGGREGATION_INVOCATION_DISTINCT: AggregateFunction.AggregationInvocation.ValueType  # 2
    """Use only distinct values in the aggregation calculation."""

    FUNCTION_REFERENCE_FIELD_NUMBER: builtins.int
    ARGUMENTS_FIELD_NUMBER: builtins.int
    OPTIONS_FIELD_NUMBER: builtins.int
    OUTPUT_TYPE_FIELD_NUMBER: builtins.int
    PHASE_FIELD_NUMBER: builtins.int
    SORTS_FIELD_NUMBER: builtins.int
    INVOCATION_FIELD_NUMBER: builtins.int
    ARGS_FIELD_NUMBER: builtins.int
    function_reference: builtins.int
    """Points to a function_anchor defined in this plan, which must refer
    to an aggregate function in the associated YAML file. Required.
    """
    phase: Global___AggregationPhase.ValueType
    """Describes which part of the aggregation to perform within the context of
    distributed algorithms. Required. Must be set to INITIAL_TO_RESULT for
    aggregate functions that are not decomposable.
    """
    invocation: Global___AggregateFunction.AggregationInvocation.ValueType
    """Specifies whether equivalent records are merged before being aggregated.
    Optional, defaults to AGGREGATION_INVOCATION_ALL.
    """
    @property
    def arguments(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___FunctionArgument]:
        """The arguments to be bound to the function. This must have exactly the
        number of arguments specified in the function definition, and the
        argument types must also match exactly:

         - Value arguments must be bound using FunctionArgument.value, and
           the expression in that must yield a value of a type that a function
           overload is defined for.
         - Type arguments must be bound using FunctionArgument.type, and a
           function overload must be defined for that type.
         - Enum arguments must be bound using FunctionArgument.enum
           followed by Enum.specified, with a string that case-insensitively
           matches one of the allowed options.
         - Optional enum arguments must be bound using FunctionArgument.enum
           followed by either Enum.specified or Enum.unspecified. If specified,
           the string must case-insensitively match one of the allowed options.
        """

    @property
    def options(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___FunctionOption]:
        """Options to specify behavior for corner cases, or leave behavior
        unspecified if the consumer does not need specific behavior in these
        cases.
        """

    @property
    def output_type(self) -> substrait.type_pb2.Type:
        """Must be set to the return type of the function, exactly as derived
        using the declaration in the extension.
        """

    @property
    def sorts(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___SortField]:
        """If specified, the aggregated records are ordered according to this list
        before they are aggregated. The first sort field has the highest
        priority; only if a sort field determines two records to be equivalent is
        the next field queried. This field is optional.
        """

    @property
    def args(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[Global___Expression]:
        """deprecated; use arguments instead"""

    def __init__(
        self,
        *,
        function_reference: builtins.int = ...,
        arguments: collections.abc.Iterable[Global___FunctionArgument] | None = ...,
        options: collections.abc.Iterable[Global___FunctionOption] | None = ...,
        output_type: substrait.type_pb2.Type | None = ...,
        phase: Global___AggregationPhase.ValueType = ...,
        sorts: collections.abc.Iterable[Global___SortField] | None = ...,
        invocation: Global___AggregateFunction.AggregationInvocation.ValueType = ...,
        args: collections.abc.Iterable[Global___Expression] | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["output_type", b"output_type"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["args", b"args", "arguments", b"arguments", "function_reference", b"function_reference", "invocation", b"invocation", "options", b"options", "output_type", b"output_type", "phase", b"phase", "sorts", b"sorts"]) -> None: ...

Global___AggregateFunction: typing_extensions.TypeAlias = AggregateFunction

@typing.final
class ReferenceRel(google.protobuf.message.Message):
    """This rel is used  to create references,
    in case we refer to a RelRoot field names will be ignored
    """

    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    SUBTREE_ORDINAL_FIELD_NUMBER: builtins.int
    subtree_ordinal: builtins.int
    def __init__(
        self,
        *,
        subtree_ordinal: builtins.int = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["subtree_ordinal", b"subtree_ordinal"]) -> None: ...

Global___ReferenceRel: typing_extensions.TypeAlias = ReferenceRel
