Skip to main content

MatchExpr

Enum MatchExpr 

Source
pub enum MatchExpr<Input, InputColumn, PatternField, CastType = DataType> {
Show 17 variants InputExpr(Input), InputColumn(InputColumn), PatternField(PatternField), Metadata(MatchMetadataFunction), Navigation(MatchNavigation<Input, InputColumn, PatternField, CastType>), Aggregate(MatchAggregateCall<Input, InputColumn, PatternField, CastType>), Alias { expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, name: String, }, ScalarFunction { name: String, args: Vec<MatchExpr<Input, InputColumn, PatternField, CastType>>, }, Unary { op: MatchUnaryOperator, expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, }, Binary { left: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, op: Operator, right: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, }, Like { negated: bool, expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, pattern: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, escape_char: Option<char>, case_insensitive: bool, similar: bool, }, Case { expr: Option<Box<MatchExpr<Input, InputColumn, PatternField, CastType>>>, when_then: Vec<(MatchExpr<Input, InputColumn, PatternField, CastType>, MatchExpr<Input, InputColumn, PatternField, CastType>)>, else_expr: Option<Box<MatchExpr<Input, InputColumn, PatternField, CastType>>>, }, Predicate { kind: MatchPredicateKind, expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, }, Between { expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, negated: bool, low: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, high: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, }, InList { expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, list: Vec<MatchExpr<Input, InputColumn, PatternField, CastType>>, negated: bool, }, Cast { expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>, data_type: CastType, }, Literal(ScalarValue),
}
Expand description

Expression syntax shared by all importers before and after binding.

The type parameters describe the format-specific leaves: an input expression, an input column, a pattern-qualified field, and a cast type. SQL uses parser values for those leaves. After binding, the same tree contains DataFusion expressions, resolved columns, and Arrow data types. Importers therefore share one recursive expression structure.

Variants§

§

InputExpr(Input)

An importer-native expression over ordinary input columns.

§

InputColumn(InputColumn)

One ordinary input-column reference represented by the importer.

§

PatternField(PatternField)

One input field qualified by a row-pattern symbol.

§

Metadata(MatchMetadataFunction)

A MATCH_RECOGNIZE metadata function call.

§

Navigation(MatchNavigation<Input, InputColumn, PatternField, CastType>)

A pattern-aware navigation call.

§

Aggregate(MatchAggregateCall<Input, InputColumn, PatternField, CastType>)

A match-aware aggregate call.

§

Alias

An expression with an output alias.

Fields

§expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Expression being named.

§name: String

Alias assigned to the expression.

§

ScalarFunction

A scalar function resolved during lowering.

Fields

§name: String

Registry name or reserved built-in identity.

§args: Vec<MatchExpr<Input, InputColumn, PatternField, CastType>>

Function arguments in source order.

§

Unary

A unary Boolean or arithmetic expression.

Fields

§op: MatchUnaryOperator

Unary operator.

§expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Operand.

§

Binary

A binary expression using a DataFusion operator.

Fields

§left: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Left operand.

§op: Operator

DataFusion binary operator.

§right: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Right operand.

§

Like

A SQL LIKE, ILIKE, or SIMILAR TO predicate.

Fields

§negated: bool

Whether the predicate is negated.

§expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Value being tested.

§pattern: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Pattern expression.

§escape_char: Option<char>

Optional single-character escape.

§case_insensitive: bool

Whether the comparison ignores case.

§similar: bool

Whether this uses SIMILAR TO rather than LIKE.

§

Case

A searched or simple SQL CASE expression.

Fields

§expr: Option<Box<MatchExpr<Input, InputColumn, PatternField, CastType>>>

Simple-CASE base expression; None denotes searched CASE.

§when_then: Vec<(MatchExpr<Input, InputColumn, PatternField, CastType>, MatchExpr<Input, InputColumn, PatternField, CastType>)>

Ordered (WHEN, THEN) branches.

§else_expr: Option<Box<MatchExpr<Input, InputColumn, PatternField, CastType>>>

Optional ELSE expression.

§

Predicate

An SQL null or truth-value predicate.

Fields

§kind: MatchPredicateKind

Predicate applied to expr.

§expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Predicate input.

§

Between

An inclusive range predicate.

Fields

§expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Value being tested.

§negated: bool

Whether this is NOT BETWEEN.

§low: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Inclusive lower bound.

§high: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Inclusive upper bound.

§

InList

A list-membership predicate.

Fields

§expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Value being tested.

§list: Vec<MatchExpr<Input, InputColumn, PatternField, CastType>>

Candidate values.

§negated: bool

Whether this is NOT IN.

§

Cast

An explicit cast with DataFusion SQL semantics after binding.

In particular, an Int64 value cast to a nanosecond timestamp counts as seconds. This applies to every frontend supplying BoundMatchExpr.

Fields

§expr: Box<MatchExpr<Input, InputColumn, PatternField, CastType>>

Value being cast.

§data_type: CastType

Importer-specific target type, resolved to Arrow DataType by binding.

§

Literal(ScalarValue)

A typed DataFusion scalar literal.

Implementations§

Source§

impl<Input, InputColumn, PatternField, CastType> MatchExpr<Input, InputColumn, PatternField, CastType>

Source

pub fn try_for_each_child<'a>( &'a self, visit: impl FnMut(&'a Self) -> Result<()>, ) -> Result<()>

Visit immediate structured children in order, stopping at the first error.

Aggregate arguments precede the filter and ordering expressions; navigation visits the value, offset, then default. Importer-native InputExpr is opaque.

Source

pub fn try_map_adapter_parts<BoundInput, BoundColumn, BoundPattern, BoundCast>( self, map_input: &mut impl FnMut(Input) -> Result<BoundInput>, map_column: &mut impl FnMut(InputColumn) -> Result<BoundColumn>, map_pattern: &mut impl FnMut(PatternField) -> Result<BoundPattern>, map_cast: &mut impl FnMut(CastType) -> Result<BoundCast>, ) -> Result<MatchExpr<BoundInput, BoundColumn, BoundPattern, BoundCast>>

Convert all format-specific leaves while preserving the expression tree. Binary trees use an explicit stack and visit operands in source order, without a recursive mapping frame per binary operator.

Trait Implementations§

Source§

impl<Input: Clone, InputColumn: Clone, PatternField: Clone, CastType: Clone> Clone for MatchExpr<Input, InputColumn, PatternField, CastType>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Input: Debug, InputColumn: Debug, PatternField: Debug, CastType: Debug> Debug for MatchExpr<Input, InputColumn, PatternField, CastType>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Input, InputColumn, PatternField, CastType> Display for MatchExpr<Input, InputColumn, PatternField, CastType>
where Input: Display, InputColumn: Display, PatternField: Display, CastType: Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Input: PartialEq, InputColumn: PartialEq, PatternField: PartialEq, CastType: PartialEq> PartialEq for MatchExpr<Input, InputColumn, PatternField, CastType>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<Input: PartialEq, InputColumn: PartialEq, PatternField: PartialEq, CastType: PartialEq> StructuralPartialEq for MatchExpr<Input, InputColumn, PatternField, CastType>

Auto Trait Implementations§

§

impl<Input, InputColumn, PatternField, CastType = DataType> !RefUnwindSafe for MatchExpr<Input, InputColumn, PatternField, CastType>

§

impl<Input, InputColumn, PatternField, CastType = DataType> !UnwindSafe for MatchExpr<Input, InputColumn, PatternField, CastType>

§

impl<Input, InputColumn, PatternField, CastType> Forget for MatchExpr<Input, InputColumn, PatternField, CastType>

§

impl<Input, InputColumn, PatternField, CastType> Freeze for MatchExpr<Input, InputColumn, PatternField, CastType>
where Input: Freeze, InputColumn: Freeze, PatternField: Freeze, *const MatchExpr<Input, InputColumn, PatternField, CastType> is !null: Freeze, PhantomData<MatchExpr<Input, InputColumn, PatternField, CastType>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<MatchExprSort<Input, InputColumn, PatternField, CastType>>: Freeze, PhantomData<(MatchExpr<Input, InputColumn, PatternField, CastType>, MatchExpr<Input, InputColumn, PatternField, CastType>)>: Freeze, CastType: Freeze, *const ArcInner<FixedSizeListArray> is !null: Freeze, PhantomData<ArcInner<FixedSizeListArray>>: Freeze, *const ArcInner<GenericListArray<i32>> is !null: Freeze, PhantomData<ArcInner<GenericListArray<i32>>>: Freeze, *const ArcInner<GenericListArray<i64>> is !null: Freeze, PhantomData<ArcInner<GenericListArray<i64>>>: Freeze, *const ArcInner<GenericListViewArray<i32>> is !null: Freeze, PhantomData<ArcInner<GenericListViewArray<i32>>>: Freeze, *const ArcInner<GenericListViewArray<i64>> is !null: Freeze, PhantomData<ArcInner<GenericListViewArray<i64>>>: Freeze, *const ArcInner<StructArray> is !null: Freeze, PhantomData<ArcInner<StructArray>>: Freeze, *const ArcInner<MapArray> is !null: Freeze, PhantomData<ArcInner<MapArray>>: Freeze, *const ArcInner<str> is !null: Freeze, PhantomData<ArcInner<str>>: Freeze, *const ScalarValue is !null: Freeze, PhantomData<ScalarValue>: Freeze, *const ArcInner<[(i8, Arc<Field>)]> is !null: Freeze, PhantomData<ArcInner<[(i8, Arc<Field>)]>>: Freeze, *const DataType is !null: Freeze, PhantomData<DataType>: Freeze, *const ArcInner<Field> is !null: Freeze, PhantomData<ArcInner<Field>>: Freeze,

§

impl<Input, InputColumn, PatternField, CastType> Move for MatchExpr<Input, InputColumn, PatternField, CastType>

§

impl<Input, InputColumn, PatternField, CastType> Send for MatchExpr<Input, InputColumn, PatternField, CastType>
where CastType: Send, PatternField: Send, InputColumn: Send, Input: Send, BoxRaw<MatchExpr<Input, InputColumn, PatternField, CastType>>: Send, RawVecInner: Send, Arc<FixedSizeListArray>: Send, Arc<GenericListArray<i32>>: Send, Arc<GenericListArray<i64>>: Send, Arc<GenericListViewArray<i32>>: Send, Arc<GenericListViewArray<i64>>: Send, Arc<StructArray>: Send, Arc<MapArray>: Send, Arc<str>: Send, BoxRaw<ScalarValue>: Send, Arc<[(i8, Arc<Field>)]>: Send, BoxRaw<DataType>: Send, Arc<Field>: Send,

§

impl<Input, InputColumn, PatternField, CastType> Sync for MatchExpr<Input, InputColumn, PatternField, CastType>
where CastType: Sync, PatternField: Sync, InputColumn: Sync, Input: Sync, BoxRaw<MatchExpr<Input, InputColumn, PatternField, CastType>>: Sync, RawVecInner: Sync, Arc<FixedSizeListArray>: Sync, Arc<GenericListArray<i32>>: Sync, Arc<GenericListArray<i64>>: Sync, Arc<GenericListViewArray<i32>>: Sync, Arc<GenericListViewArray<i64>>: Sync, Arc<StructArray>: Sync, Arc<MapArray>: Sync, Arc<str>: Sync, BoxRaw<ScalarValue>: Sync, Arc<[(i8, Arc<Field>)]>: Sync, BoxRaw<DataType>: Sync, Arc<Field>: Sync,

§

impl<Input, InputColumn, PatternField, CastType> Unpin for MatchExpr<Input, InputColumn, PatternField, CastType>
where CastType: Unpin, PatternField: Unpin, InputColumn: Unpin, Input: Unpin, Box<MatchExpr<Input, InputColumn, PatternField, CastType>>: Unpin, *const u8 is !null: Unpin, Arc<FixedSizeListArray>: Unpin, Arc<GenericListArray<i32>>: Unpin, Arc<GenericListArray<i64>>: Unpin, Arc<GenericListViewArray<i32>>: Unpin, Arc<GenericListViewArray<i64>>: Unpin, Arc<StructArray>: Unpin, Arc<MapArray>: Unpin, Arc<str>: Unpin, Box<ScalarValue>: Unpin, Arc<[(i8, Arc<Field>)]>: Unpin, Box<DataType>: Unpin, Arc<Field>: Unpin,

§

impl<Input, InputColumn, PatternField, CastType> UnsafeUnpin for MatchExpr<Input, InputColumn, PatternField, CastType>
where Input: UnsafeUnpin, InputColumn: UnsafeUnpin, PatternField: UnsafeUnpin, *const MatchExpr<Input, InputColumn, PatternField, CastType> is !null: UnsafeUnpin, PhantomData<MatchExpr<Input, InputColumn, PatternField, CastType>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<MatchExprSort<Input, InputColumn, PatternField, CastType>>: UnsafeUnpin, PhantomData<(MatchExpr<Input, InputColumn, PatternField, CastType>, MatchExpr<Input, InputColumn, PatternField, CastType>)>: UnsafeUnpin, CastType: UnsafeUnpin, *const ArcInner<FixedSizeListArray> is !null: UnsafeUnpin, PhantomData<ArcInner<FixedSizeListArray>>: UnsafeUnpin, *const ArcInner<GenericListArray<i32>> is !null: UnsafeUnpin, PhantomData<ArcInner<GenericListArray<i32>>>: UnsafeUnpin, *const ArcInner<GenericListArray<i64>> is !null: UnsafeUnpin, PhantomData<ArcInner<GenericListArray<i64>>>: UnsafeUnpin, *const ArcInner<GenericListViewArray<i32>> is !null: UnsafeUnpin, PhantomData<ArcInner<GenericListViewArray<i32>>>: UnsafeUnpin, *const ArcInner<GenericListViewArray<i64>> is !null: UnsafeUnpin, PhantomData<ArcInner<GenericListViewArray<i64>>>: UnsafeUnpin, *const ArcInner<StructArray> is !null: UnsafeUnpin, PhantomData<ArcInner<StructArray>>: UnsafeUnpin, *const ArcInner<MapArray> is !null: UnsafeUnpin, PhantomData<ArcInner<MapArray>>: UnsafeUnpin, *const ArcInner<str> is !null: UnsafeUnpin, PhantomData<ArcInner<str>>: UnsafeUnpin, *const ScalarValue is !null: UnsafeUnpin, PhantomData<ScalarValue>: UnsafeUnpin, *const ArcInner<[(i8, Arc<Field>)]> is !null: UnsafeUnpin, PhantomData<ArcInner<[(i8, Arc<Field>)]>>: UnsafeUnpin, *const DataType is !null: UnsafeUnpin, PhantomData<DataType>: UnsafeUnpin, *const ArcInner<Field> is !null: UnsafeUnpin, PhantomData<ArcInner<Field>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V