struct JoinFilterRewriter<'a> {
join_side: JoinSide,
join_side_schema: &'a Schema,
join_side_projections: Vec<(Arc<dyn PhysicalExpr>, String)>,
intermediate_column_indices: Vec<ColumnIndex>,
alias_generator: &'a AliasGenerator,
}Expand description
Implements the push-down machinery.
The rewriter starts at the top of the filter expression and traverses the expression tree. For each (sub-)expression, the rewriter checks whether it only refers to one side of the join. If this is never the case, no subexpressions of the filter can be pushed down. If there is a subexpression that can be computed using only one side of the join, the entire subexpression is pushed down to the join side.
Fields§
§join_side: JoinSide§join_side_schema: &'a Schema§join_side_projections: Vec<(Arc<dyn PhysicalExpr>, String)>§intermediate_column_indices: Vec<ColumnIndex>§alias_generator: &'a AliasGeneratorImplementations§
Source§impl<'a> JoinFilterRewriter<'a>
impl<'a> JoinFilterRewriter<'a>
Sourcefn new(
join_side: JoinSide,
join_side_schema: &'a Schema,
column_indices: Vec<ColumnIndex>,
alias_generator: &'a AliasGenerator,
) -> Self
fn new( join_side: JoinSide, join_side_schema: &'a Schema, column_indices: Vec<ColumnIndex>, alias_generator: &'a AliasGenerator, ) -> Self
Creates a new JoinFilterRewriter.
Sourcefn rewrite(
&mut self,
expr: Arc<dyn PhysicalExpr>,
) -> Result<Transformed<Arc<dyn PhysicalExpr>>>
fn rewrite( &mut self, expr: Arc<dyn PhysicalExpr>, ) -> Result<Transformed<Arc<dyn PhysicalExpr>>>
Executes the push-down machinery on expr.
See the JoinFilterRewriter for further information.
Sourcefn create_new_column(
&mut self,
name: String,
expr: Arc<dyn PhysicalExpr>,
) -> Result<usize>
fn create_new_column( &mut self, name: String, expr: Arc<dyn PhysicalExpr>, ) -> Result<usize>
Creates a new column in the current join side.
Sourcefn depends_on_join_side(
&mut self,
expr: &Arc<dyn PhysicalExpr>,
join_side: JoinSide,
) -> Result<bool>
fn depends_on_join_side( &mut self, expr: &Arc<dyn PhysicalExpr>, join_side: JoinSide, ) -> Result<bool>
Checks whether the entire expression depends on the given join_side.
Auto Trait Implementations§
impl<'a> Freeze for JoinFilterRewriter<'a>
impl<'a> !RefUnwindSafe for JoinFilterRewriter<'a>
impl<'a> Send for JoinFilterRewriter<'a>
impl<'a> Sync for JoinFilterRewriter<'a>
impl<'a> Unpin for JoinFilterRewriter<'a>
impl<'a> !UnwindSafe for JoinFilterRewriter<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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