pub struct DefaultPhysicalExprAdapter { /* private fields */ }
Expand description
Default implementation for rewriting physical expressions to match different schemas.
§Example
use datafusion_physical_expr::schema_rewriter::{DefaultPhysicalExprAdapterFactory, PhysicalExprAdapterFactory};
use arrow::datatypes::Schema;
use std::sync::Arc;
let factory = DefaultPhysicalExprAdapterFactory;
let adapter = factory.create(Arc::new(logical_file_schema.clone()), Arc::new(physical_file_schema.clone()));
let adapted_predicate = adapter.rewrite(predicate)?;
Implementations§
Source§impl DefaultPhysicalExprAdapter
impl DefaultPhysicalExprAdapter
Sourcepub fn new(
logical_file_schema: SchemaRef,
physical_file_schema: SchemaRef,
) -> Self
pub fn new( logical_file_schema: SchemaRef, physical_file_schema: SchemaRef, ) -> Self
Create a new instance of the default physical expression adapter.
This adapter rewrites expressions to match the physical schema of the file being scanned, handling type mismatches and missing columns by filling them with default values.
Trait Implementations§
Source§impl Clone for DefaultPhysicalExprAdapter
impl Clone for DefaultPhysicalExprAdapter
Source§fn clone(&self) -> DefaultPhysicalExprAdapter
fn clone(&self) -> DefaultPhysicalExprAdapter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DefaultPhysicalExprAdapter
impl Debug for DefaultPhysicalExprAdapter
Source§impl PhysicalExprAdapter for DefaultPhysicalExprAdapter
impl PhysicalExprAdapter for DefaultPhysicalExprAdapter
Source§fn rewrite(&self, expr: Arc<dyn PhysicalExpr>) -> Result<Arc<dyn PhysicalExpr>>
fn rewrite(&self, expr: Arc<dyn PhysicalExpr>) -> Result<Arc<dyn PhysicalExpr>>
Rewrite a physical expression to match the target schema. Read more
fn with_partition_values( &self, partition_values: Vec<(FieldRef, ScalarValue)>, ) -> Arc<dyn PhysicalExprAdapter>
Auto Trait Implementations§
impl Freeze for DefaultPhysicalExprAdapter
impl !RefUnwindSafe for DefaultPhysicalExprAdapter
impl Send for DefaultPhysicalExprAdapter
impl Sync for DefaultPhysicalExprAdapter
impl Unpin for DefaultPhysicalExprAdapter
impl !UnwindSafe for DefaultPhysicalExprAdapter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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