"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""
import builtins
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
from .. import substrait
import typing
import typing_extensions
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 = ...
    AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE: AggregationPhase.ValueType = ...
    AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE: AggregationPhase.ValueType = ...
    AGGREGATION_PHASE_INITIAL_TO_RESULT: AggregationPhase.ValueType = ...
    AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT: AggregationPhase.ValueType = ...

class AggregationPhase(_AggregationPhase, metaclass=_AggregationPhaseEnumTypeWrapper):
    pass
AGGREGATION_PHASE_UNSPECIFIED: AggregationPhase.ValueType = ...
AGGREGATION_PHASE_INITIAL_TO_INTERMEDIATE: AggregationPhase.ValueType = ...
AGGREGATION_PHASE_INTERMEDIATE_TO_INTERMEDIATE: AggregationPhase.ValueType = ...
AGGREGATION_PHASE_INITIAL_TO_RESULT: AggregationPhase.ValueType = ...
AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT: AggregationPhase.ValueType = ...
global___AggregationPhase = AggregationPhase

class Expression(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

    class Enum(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

        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: typing.Text = ...

        @property
        def unspecified(self) -> global___Expression.Enum.Empty:
            ...

        def __init__(self, *, specified: typing.Text=..., unspecified: typing.Optional[global___Expression.Enum.Empty]=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.Literal['enum_kind', b'enum_kind', 'specified', b'specified', 'unspecified', b'unspecified']) -> builtins.bool:
            ...

        def ClearField(self, field_name: typing_extensions.Literal['enum_kind', b'enum_kind', 'specified', b'specified', 'unspecified', b'unspecified']) -> None:
            ...

        def WhichOneof(self, oneof_group: typing_extensions.Literal['enum_kind', b'enum_kind']) -> typing.Optional[typing_extensions.Literal['specified', 'unspecified']]:
            ...

    class Literal(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

        class VarChar(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
            VALUE_FIELD_NUMBER: builtins.int
            LENGTH_FIELD_NUMBER: builtins.int
            value: typing.Text = ...
            length: builtins.int = ...

            def __init__(self, *, value: typing.Text=..., length: builtins.int=...) -> None:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['length', b'length', 'value', b'value']) -> None:
                ...

        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\n            (ignoring precision) Always 16 bytes in length\n            '
            precision: builtins.int = ...
            'The maximum number of digits allowed in the value.\n            the maximum precision is 38.\n            '
            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_extensions.Literal['precision', b'precision', 'scale', b'scale', 'value', b'value']) -> None:
                ...

        class Map(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

            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: typing.Optional[global___Expression.Literal]=..., value: typing.Optional[global___Expression.Literal]=...) -> None:
                    ...

                def HasField(self, field_name: typing_extensions.Literal['key', b'key', 'value', b'value']) -> builtins.bool:
                    ...

                def ClearField(self, field_name: typing_extensions.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: typing.Optional[typing.Iterable[global___Expression.Literal.Map.KeyValue]]=...) -> None:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['key_values', b'key_values']) -> None:
                ...

        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_extensions.Literal['months', b'months', 'years', b'years']) -> None:
                ...

        class IntervalDayToSecond(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
            DAYS_FIELD_NUMBER: builtins.int
            SECONDS_FIELD_NUMBER: builtins.int
            days: builtins.int = ...
            seconds: builtins.int = ...

            def __init__(self, *, days: builtins.int=..., seconds: builtins.int=...) -> None:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['days', b'days', 'seconds', b'seconds']) -> None:
                ...

        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"""
                pass

            def __init__(self, *, fields: typing.Optional[typing.Iterable[global___Expression.Literal]]=...) -> None:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['fields', b'fields']) -> None:
                ...

        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"""
                pass

            def __init__(self, *, values: typing.Optional[typing.Iterable[global___Expression.Literal]]=...) -> None:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['values', b'values']) -> 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
        FIXED_CHAR_FIELD_NUMBER: builtins.int
        VAR_CHAR_FIELD_NUMBER: builtins.int
        FIXED_BINARY_FIELD_NUMBER: builtins.int
        DECIMAL_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
        NULLABLE_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: typing.Text = ...
        binary: builtins.bytes = ...
        timestamp: builtins.int = ...
        'Timestamp in units of microseconds since the UNIX epoch.'
        date: builtins.int = ...
        'Date in units of days since the UNIX epoch.'
        time: builtins.int = ...
        'Time in units of microseconds past midnight'

        @property
        def interval_year_to_month(self) -> global___Expression.Literal.IntervalYearToMonth:
            ...

        @property
        def interval_day_to_second(self) -> global___Expression.Literal.IntervalDayToSecond:
            ...
        fixed_char: typing.Text = ...

        @property
        def var_char(self) -> global___Expression.Literal.VarChar:
            ...
        fixed_binary: builtins.bytes = ...

        @property
        def decimal(self) -> global___Expression.Literal.Decimal:
            ...

        @property
        def struct(self) -> global___Expression.Literal.Struct:
            ...

        @property
        def map(self) -> global___Expression.Literal.Map:
            ...
        timestamp_tz: builtins.int = ...
        'Timestamp in units of microseconds since the UNIX epoch.'
        uuid: builtins.bytes = ...

        @property
        def null(self) -> substrait.type_pb2.Type:
            """a typed null literal"""
            pass

        @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:
            ...
        nullable: builtins.bool = ...
        'whether the literal type should be treated as a nullable type. Applies to\n        all members of union other than the Typed null (which should directly\n        declare nullability).\n        '

        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: typing.Text=..., binary: builtins.bytes=..., timestamp: builtins.int=..., date: builtins.int=..., time: builtins.int=..., interval_year_to_month: typing.Optional[global___Expression.Literal.IntervalYearToMonth]=..., interval_day_to_second: typing.Optional[global___Expression.Literal.IntervalDayToSecond]=..., fixed_char: typing.Text=..., var_char: typing.Optional[global___Expression.Literal.VarChar]=..., fixed_binary: builtins.bytes=..., decimal: typing.Optional[global___Expression.Literal.Decimal]=..., struct: typing.Optional[global___Expression.Literal.Struct]=..., map: typing.Optional[global___Expression.Literal.Map]=..., timestamp_tz: builtins.int=..., uuid: builtins.bytes=..., null: typing.Optional[substrait.type_pb2.Type]=..., list: typing.Optional[global___Expression.Literal.List]=..., empty_list: typing.Optional[substrait.type_pb2.Type.List]=..., empty_map: typing.Optional[substrait.type_pb2.Type.Map]=..., nullable: builtins.bool=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.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_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', 'string', b'string', 'struct', b'struct', 'time', b'time', 'timestamp', b'timestamp', 'timestamp_tz', b'timestamp_tz', 'uuid', b'uuid', 'var_char', b'var_char']) -> builtins.bool:
            ...

        def ClearField(self, field_name: typing_extensions.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_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', 'string', b'string', 'struct', b'struct', 'time', b'time', 'timestamp', b'timestamp', 'timestamp_tz', b'timestamp_tz', 'uuid', b'uuid', 'var_char', b'var_char']) -> None:
            ...

        def WhichOneof(self, oneof_group: typing_extensions.Literal['literal_type', b'literal_type']) -> typing.Optional[typing_extensions.Literal['boolean', 'i8', 'i16', 'i32', 'i64', 'fp32', 'fp64', 'string', 'binary', 'timestamp', 'date', 'time', 'interval_year_to_month', 'interval_day_to_second', 'fixed_char', 'var_char', 'fixed_binary', 'decimal', 'struct', 'map', 'timestamp_tz', 'uuid', 'null', 'list', 'empty_list', 'empty_map']]:
            ...

    class ScalarFunction(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
        FUNCTION_REFERENCE_FIELD_NUMBER: builtins.int
        ARGS_FIELD_NUMBER: builtins.int
        OUTPUT_TYPE_FIELD_NUMBER: builtins.int
        function_reference: builtins.int = ...
        'points to a function_anchor defined in this plan'

        @property
        def args(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Expression]:
            ...

        @property
        def output_type(self) -> substrait.type_pb2.Type:
            ...

        def __init__(self, *, function_reference: builtins.int=..., args: typing.Optional[typing.Iterable[global___Expression]]=..., output_type: typing.Optional[substrait.type_pb2.Type]=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.Literal['output_type', b'output_type']) -> builtins.bool:
            ...

        def ClearField(self, field_name: typing_extensions.Literal['args', b'args', 'function_reference', b'function_reference', 'output_type', b'output_type']) -> None:
            ...

    class WindowFunction(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

        class Bound(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

            class Preceding(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
                OFFSET_FIELD_NUMBER: builtins.int
                offset: builtins.int = ...

                def __init__(self, *, offset: builtins.int=...) -> None:
                    ...

                def ClearField(self, field_name: typing_extensions.Literal['offset', b'offset']) -> None:
                    ...

            class Following(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
                OFFSET_FIELD_NUMBER: builtins.int
                offset: builtins.int = ...

                def __init__(self, *, offset: builtins.int=...) -> None:
                    ...

                def ClearField(self, field_name: typing_extensions.Literal['offset', b'offset']) -> None:
                    ...

            class CurrentRow(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

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

            class Unbounded(google.protobuf.message.Message):
                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:
                ...

            @property
            def following(self) -> global___Expression.WindowFunction.Bound.Following:
                ...

            @property
            def current_row(self) -> global___Expression.WindowFunction.Bound.CurrentRow:
                ...

            @property
            def unbounded(self) -> global___Expression.WindowFunction.Bound.Unbounded:
                ...

            def __init__(self, *, preceding: typing.Optional[global___Expression.WindowFunction.Bound.Preceding]=..., following: typing.Optional[global___Expression.WindowFunction.Bound.Following]=..., current_row: typing.Optional[global___Expression.WindowFunction.Bound.CurrentRow]=..., unbounded: typing.Optional[global___Expression.WindowFunction.Bound.Unbounded]=...) -> None:
                ...

            def HasField(self, field_name: typing_extensions.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_extensions.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_extensions.Literal['kind', b'kind']) -> typing.Optional[typing_extensions.Literal['preceding', 'following', 'current_row', 'unbounded']]:
                ...
        FUNCTION_REFERENCE_FIELD_NUMBER: builtins.int
        PARTITIONS_FIELD_NUMBER: builtins.int
        SORTS_FIELD_NUMBER: builtins.int
        UPPER_BOUND_FIELD_NUMBER: builtins.int
        LOWER_BOUND_FIELD_NUMBER: builtins.int
        PHASE_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'

        @property
        def partitions(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Expression]:
            ...

        @property
        def sorts(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SortField]:
            ...

        @property
        def upper_bound(self) -> global___Expression.WindowFunction.Bound:
            ...

        @property
        def lower_bound(self) -> global___Expression.WindowFunction.Bound:
            ...
        phase: global___AggregationPhase.ValueType = ...

        @property
        def output_type(self) -> substrait.type_pb2.Type:
            ...

        @property
        def args(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Expression]:
            ...

        def __init__(self, *, function_reference: builtins.int=..., partitions: typing.Optional[typing.Iterable[global___Expression]]=..., sorts: typing.Optional[typing.Iterable[global___SortField]]=..., upper_bound: typing.Optional[global___Expression.WindowFunction.Bound]=..., lower_bound: typing.Optional[global___Expression.WindowFunction.Bound]=..., phase: global___AggregationPhase.ValueType=..., output_type: typing.Optional[substrait.type_pb2.Type]=..., args: typing.Optional[typing.Iterable[global___Expression]]=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.Literal['lower_bound', b'lower_bound', 'output_type', b'output_type', 'upper_bound', b'upper_bound']) -> builtins.bool:
            ...

        def ClearField(self, field_name: typing_extensions.Literal['args', b'args', 'function_reference', b'function_reference', 'lower_bound', b'lower_bound', 'output_type', b'output_type', 'partitions', b'partitions', 'phase', b'phase', 'sorts', b'sorts', 'upper_bound', b'upper_bound']) -> None:
            ...

    class IfThen(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

        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: typing.Optional[global___Expression]=...) -> None:
                ...

            def HasField(self, field_name: typing_extensions.Literal['if', b'if', 'then', b'then']) -> builtins.bool:
                ...

            def ClearField(self, field_name: typing_extensions.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]:
            ...

        def __init__(self, *, ifs: typing.Optional[typing.Iterable[global___Expression.IfThen.IfClause]]=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.Literal['else', b'else']) -> builtins.bool:
            ...

        def ClearField(self, field_name: typing_extensions.Literal['else', b'else', 'ifs', b'ifs']) -> None:
            ...

    class Cast(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
        TYPE_FIELD_NUMBER: builtins.int
        INPUT_FIELD_NUMBER: builtins.int

        @property
        def type(self) -> substrait.type_pb2.Type:
            ...

        @property
        def input(self) -> global___Expression:
            ...

        def __init__(self, *, type: typing.Optional[substrait.type_pb2.Type]=..., input: typing.Optional[global___Expression]=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.Literal['input', b'input', 'type', b'type']) -> builtins.bool:
            ...

        def ClearField(self, field_name: typing_extensions.Literal['input', b'input', 'type', b'type']) -> None:
            ...

    class SwitchExpression(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

        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: typing.Optional[global___Expression]=...) -> None:
                ...

            def HasField(self, field_name: typing_extensions.Literal['if', b'if', 'then', b'then']) -> builtins.bool:
                ...

            def ClearField(self, field_name: typing_extensions.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.SwitchExpression.IfValue]:
            ...

        def __init__(self, *, ifs: typing.Optional[typing.Iterable[global___Expression.SwitchExpression.IfValue]]=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.Literal['else', b'else']) -> builtins.bool:
            ...

        def ClearField(self, field_name: typing_extensions.Literal['else', b'else', 'ifs', b'ifs']) -> None:
            ...

    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: typing.Optional[global___Expression]=..., options: typing.Optional[typing.Iterable[global___Expression]]=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.Literal['value', b'value']) -> builtins.bool:
            ...

        def ClearField(self, field_name: typing_extensions.Literal['options', b'options', 'value', b'value']) -> None:
            ...

    class MultiOrList(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

        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: typing.Optional[typing.Iterable[global___Expression]]=...) -> None:
                ...

            def ClearField(self, field_name: typing_extensions.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: typing.Optional[typing.Iterable[global___Expression]]=..., options: typing.Optional[typing.Iterable[global___Expression.MultiOrList.Record]]=...) -> None:
            ...

        def ClearField(self, field_name: typing_extensions.Literal['options', b'options', 'value', b'value']) -> None:
            ...

    class EmbeddedFunction(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

        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[typing.Text]:
                ...

            def __init__(self, *, function: builtins.bytes=..., prerequisite: typing.Optional[typing.Iterable[typing.Text]]=...) -> None:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['function', b'function', 'prerequisite', b'prerequisite']) -> None:
                ...

        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[typing.Text]:
                ...

            def __init__(self, *, script: builtins.bytes=..., prerequisite: typing.Optional[typing.Iterable[typing.Text]]=...) -> None:
                ...

            def ClearField(self, field_name: typing_extensions.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: typing.Optional[typing.Iterable[global___Expression]]=..., output_type: typing.Optional[substrait.type_pb2.Type]=..., python_pickle_function: typing.Optional[global___Expression.EmbeddedFunction.PythonPickleFunction]=..., web_assembly_function: typing.Optional[global___Expression.EmbeddedFunction.WebAssemblyFunction]=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.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_extensions.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_extensions.Literal['kind', b'kind']) -> typing.Optional[typing_extensions.Literal['python_pickle_function', 'web_assembly_function']]:
            ...

    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 = ...

        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."""
                pass

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

            def __init__(self, *, map_key: typing.Optional[global___Expression.Literal]=..., child: typing.Optional[global___Expression.ReferenceSegment]=...) -> None:
                ...

            def HasField(self, field_name: typing_extensions.Literal['child', b'child', 'map_key', b'map_key']) -> builtins.bool:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['child', b'child', 'map_key', b'map_key']) -> None:
                ...

        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"""
                pass

            def __init__(self, *, field: builtins.int=..., child: typing.Optional[global___Expression.ReferenceSegment]=...) -> None:
                ...

            def HasField(self, field_name: typing_extensions.Literal['child', b'child']) -> builtins.bool:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['child', b'child', 'field', b'field']) -> None:
                ...

        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"""
                pass

            def __init__(self, *, offset: builtins.int=..., child: typing.Optional[global___Expression.ReferenceSegment]=...) -> None:
                ...

            def HasField(self, field_name: typing_extensions.Literal['child', b'child']) -> builtins.bool:
                ...

            def ClearField(self, field_name: typing_extensions.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: typing.Optional[global___Expression.ReferenceSegment.MapKey]=..., struct_field: typing.Optional[global___Expression.ReferenceSegment.StructField]=..., list_element: typing.Optional[global___Expression.ReferenceSegment.ListElement]=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.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_extensions.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_extensions.Literal['reference_type', b'reference_type']) -> typing.Optional[typing_extensions.Literal['map_key', 'struct_field', 'list_element']]:
            ...

    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 unecessary elements.
        """
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

        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: typing.Optional[global___Expression.MaskExpression.StructSelect]=..., list: typing.Optional[global___Expression.MaskExpression.ListSelect]=..., map: typing.Optional[global___Expression.MaskExpression.MapSelect]=...) -> None:
                ...

            def HasField(self, field_name: typing_extensions.Literal['list', b'list', 'map', b'map', 'struct', b'struct', 'type', b'type']) -> builtins.bool:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['list', b'list', 'map', b'map', 'struct', b'struct', 'type', b'type']) -> None:
                ...

            def WhichOneof(self, oneof_group: typing_extensions.Literal['type', b'type']) -> typing.Optional[typing_extensions.Literal['struct', 'list', 'map']]:
                ...

        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: typing.Optional[typing.Iterable[global___Expression.MaskExpression.StructItem]]=...) -> None:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['struct_items', b'struct_items']) -> None:
                ...

        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: typing.Optional[global___Expression.MaskExpression.Select]=...) -> None:
                ...

            def HasField(self, field_name: typing_extensions.Literal['child', b'child']) -> builtins.bool:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['child', b'child', 'field', b'field']) -> None:
                ...

        class ListSelect(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

            class ListSelectItem(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

                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_extensions.Literal['field', b'field']) -> None:
                        ...

                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_extensions.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: typing.Optional[global___Expression.MaskExpression.ListSelect.ListSelectItem.ListElement]=..., slice: typing.Optional[global___Expression.MaskExpression.ListSelect.ListSelectItem.ListSlice]=...) -> None:
                    ...

                def HasField(self, field_name: typing_extensions.Literal['item', b'item', 'slice', b'slice', 'type', b'type']) -> builtins.bool:
                    ...

                def ClearField(self, field_name: typing_extensions.Literal['item', b'item', 'slice', b'slice', 'type', b'type']) -> None:
                    ...

                def WhichOneof(self, oneof_group: typing_extensions.Literal['type', b'type']) -> typing.Optional[typing_extensions.Literal['item', 'slice']]:
                    ...
            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: typing.Optional[typing.Iterable[global___Expression.MaskExpression.ListSelect.ListSelectItem]]=..., child: typing.Optional[global___Expression.MaskExpression.Select]=...) -> None:
                ...

            def HasField(self, field_name: typing_extensions.Literal['child', b'child']) -> builtins.bool:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['child', b'child', 'selection', b'selection']) -> None:
                ...

        class MapSelect(google.protobuf.message.Message):
            DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

            class MapKey(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
                MAP_KEY_FIELD_NUMBER: builtins.int
                map_key: typing.Text = ...

                def __init__(self, *, map_key: typing.Text=...) -> None:
                    ...

                def ClearField(self, field_name: typing_extensions.Literal['map_key', b'map_key']) -> None:
                    ...

            class MapKeyExpression(google.protobuf.message.Message):
                DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
                MAP_KEY_EXPRESSION_FIELD_NUMBER: builtins.int
                map_key_expression: typing.Text = ...

                def __init__(self, *, map_key_expression: typing.Text=...) -> None:
                    ...

                def ClearField(self, field_name: typing_extensions.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: typing.Optional[global___Expression.MaskExpression.MapSelect.MapKey]=..., expression: typing.Optional[global___Expression.MaskExpression.MapSelect.MapKeyExpression]=..., child: typing.Optional[global___Expression.MaskExpression.Select]=...) -> None:
                ...

            def HasField(self, field_name: typing_extensions.Literal['child', b'child', 'expression', b'expression', 'key', b'key', 'select', b'select']) -> builtins.bool:
                ...

            def ClearField(self, field_name: typing_extensions.Literal['child', b'child', 'expression', b'expression', 'key', b'key', 'select', b'select']) -> None:
                ...

            def WhichOneof(self, oneof_group: typing_extensions.Literal['select', b'select']) -> typing.Optional[typing_extensions.Literal['key', 'expression']]:
                ...
        SELECT_FIELD_NUMBER: builtins.int
        MAINTAIN_SINGULAR_STRUCT_FIELD_NUMBER: builtins.int

        @property
        def select(self) -> global___Expression.MaskExpression.StructSelect:
            ...
        maintain_singular_struct: builtins.bool = ...

        def __init__(self, *, select: typing.Optional[global___Expression.MaskExpression.StructSelect]=..., maintain_singular_struct: builtins.bool=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.Literal['select', b'select']) -> builtins.bool:
            ...

        def ClearField(self, field_name: typing_extensions.Literal['maintain_singular_struct', b'maintain_singular_struct', 'select', b'select']) -> None:
            ...

    class FieldReference(google.protobuf.message.Message):
        """A reference to an inner part of a complex object. Can reference reference a single
        element or a masked version of elements
        """
        DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...

        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:
                ...
        DIRECT_REFERENCE_FIELD_NUMBER: builtins.int
        MASKED_REFERENCE_FIELD_NUMBER: builtins.int
        EXPRESSION_FIELD_NUMBER: builtins.int
        ROOT_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:
            ...

        def __init__(self, *, direct_reference: typing.Optional[global___Expression.ReferenceSegment]=..., masked_reference: typing.Optional[global___Expression.MaskExpression]=..., expression: typing.Optional[global___Expression]=..., root_reference: typing.Optional[global___Expression.FieldReference.RootReference]=...) -> None:
            ...

        def HasField(self, field_name: typing_extensions.Literal['direct_reference', b'direct_reference', 'expression', b'expression', 'masked_reference', b'masked_reference', 'reference_type', b'reference_type', 'root_reference', b'root_reference', 'root_type', b'root_type']) -> builtins.bool:
            ...

        def ClearField(self, field_name: typing_extensions.Literal['direct_reference', b'direct_reference', 'expression', b'expression', 'masked_reference', b'masked_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_extensions.Literal['reference_type', b'reference_type']) -> typing.Optional[typing_extensions.Literal['direct_reference', 'masked_reference']]:
            ...

        @typing.overload
        def WhichOneof(self, oneof_group: typing_extensions.Literal['root_type', b'root_type']) -> typing.Optional[typing_extensions.Literal['expression', 'root_reference']]:
            ...
    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
    ENUM_FIELD_NUMBER: builtins.int
    CAST_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 enum(self) -> global___Expression.Enum:
        ...

    @property
    def cast(self) -> global___Expression.Cast:
        ...

    def __init__(self, *, literal: typing.Optional[global___Expression.Literal]=..., selection: typing.Optional[global___Expression.FieldReference]=..., scalar_function: typing.Optional[global___Expression.ScalarFunction]=..., window_function: typing.Optional[global___Expression.WindowFunction]=..., if_then: typing.Optional[global___Expression.IfThen]=..., switch_expression: typing.Optional[global___Expression.SwitchExpression]=..., singular_or_list: typing.Optional[global___Expression.SingularOrList]=..., multi_or_list: typing.Optional[global___Expression.MultiOrList]=..., enum: typing.Optional[global___Expression.Enum]=..., cast: typing.Optional[global___Expression.Cast]=...) -> None:
        ...

    def HasField(self, field_name: typing_extensions.Literal['cast', b'cast', 'enum', b'enum', 'if_then', b'if_then', 'literal', b'literal', 'multi_or_list', b'multi_or_list', 'rex_type', b'rex_type', 'scalar_function', b'scalar_function', 'selection', b'selection', 'singular_or_list', b'singular_or_list', 'switch_expression', b'switch_expression', 'window_function', b'window_function']) -> builtins.bool:
        ...

    def ClearField(self, field_name: typing_extensions.Literal['cast', b'cast', 'enum', b'enum', 'if_then', b'if_then', 'literal', b'literal', 'multi_or_list', b'multi_or_list', 'rex_type', b'rex_type', 'scalar_function', b'scalar_function', 'selection', b'selection', 'singular_or_list', b'singular_or_list', 'switch_expression', b'switch_expression', 'window_function', b'window_function']) -> None:
        ...

    def WhichOneof(self, oneof_group: typing_extensions.Literal['rex_type', b'rex_type']) -> typing.Optional[typing_extensions.Literal['literal', 'selection', 'scalar_function', 'window_function', 'if_then', 'switch_expression', 'singular_or_list', 'multi_or_list', 'enum', 'cast']]:
        ...
global___Expression = Expression

class SortField(google.protobuf.message.Message):
    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[_SortDirection.ValueType], builtins.type):
        DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor = ...
        SORT_DIRECTION_UNSPECIFIED: SortField.SortDirection.ValueType = ...
        SORT_DIRECTION_ASC_NULLS_FIRST: SortField.SortDirection.ValueType = ...
        SORT_DIRECTION_ASC_NULLS_LAST: SortField.SortDirection.ValueType = ...
        SORT_DIRECTION_DESC_NULLS_FIRST: SortField.SortDirection.ValueType = ...
        SORT_DIRECTION_DESC_NULLS_LAST: SortField.SortDirection.ValueType = ...
        SORT_DIRECTION_CLUSTERED: SortField.SortDirection.ValueType = ...

    class SortDirection(_SortDirection, metaclass=_SortDirectionEnumTypeWrapper):
        pass
    SORT_DIRECTION_UNSPECIFIED: SortField.SortDirection.ValueType = ...
    SORT_DIRECTION_ASC_NULLS_FIRST: SortField.SortDirection.ValueType = ...
    SORT_DIRECTION_ASC_NULLS_LAST: SortField.SortDirection.ValueType = ...
    SORT_DIRECTION_DESC_NULLS_FIRST: SortField.SortDirection.ValueType = ...
    SORT_DIRECTION_DESC_NULLS_LAST: SortField.SortDirection.ValueType = ...
    SORT_DIRECTION_CLUSTERED: SortField.SortDirection.ValueType = ...
    EXPR_FIELD_NUMBER: builtins.int
    DIRECTION_FIELD_NUMBER: builtins.int
    COMPARISON_FUNCTION_REFERENCE_FIELD_NUMBER: builtins.int

    @property
    def expr(self) -> global___Expression:
        ...
    direction: global___SortField.SortDirection.ValueType = ...
    comparison_function_reference: builtins.int = ...

    def __init__(self, *, expr: typing.Optional[global___Expression]=..., direction: global___SortField.SortDirection.ValueType=..., comparison_function_reference: builtins.int=...) -> None:
        ...

    def HasField(self, field_name: typing_extensions.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_extensions.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_extensions.Literal['sort_kind', b'sort_kind']) -> typing.Optional[typing_extensions.Literal['direction', 'comparison_function_reference']]:
        ...
global___SortField = SortField

class AggregateFunction(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor = ...
    FUNCTION_REFERENCE_FIELD_NUMBER: builtins.int
    ARGS_FIELD_NUMBER: builtins.int
    SORTS_FIELD_NUMBER: builtins.int
    PHASE_FIELD_NUMBER: builtins.int
    OUTPUT_TYPE_FIELD_NUMBER: builtins.int
    function_reference: builtins.int = ...
    'points to a function_anchor defined in this plan'

    @property
    def args(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Expression]:
        ...

    @property
    def sorts(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SortField]:
        ...
    phase: global___AggregationPhase.ValueType = ...

    @property
    def output_type(self) -> substrait.type_pb2.Type:
        ...

    def __init__(self, *, function_reference: builtins.int=..., args: typing.Optional[typing.Iterable[global___Expression]]=..., sorts: typing.Optional[typing.Iterable[global___SortField]]=..., phase: global___AggregationPhase.ValueType=..., output_type: typing.Optional[substrait.type_pb2.Type]=...) -> None:
        ...

    def HasField(self, field_name: typing_extensions.Literal['output_type', b'output_type']) -> builtins.bool:
        ...

    def ClearField(self, field_name: typing_extensions.Literal['args', b'args', 'function_reference', b'function_reference', 'output_type', b'output_type', 'phase', b'phase', 'sorts', b'sorts']) -> None:
        ...
global___AggregateFunction = AggregateFunction