pub struct ProjectionPlan {
pub physical_projection: Projection,
pub must_add_row_offset: bool,
pub requested_output_expr: Vec<OutputColumn>,
}Fields§
§physical_projection: ProjectionThe physical schema that must be loaded from the dataset
must_add_row_offset: boolNeeds the row address converted into a row offset
requested_output_expr: Vec<OutputColumn>The desired output columns
Implementations§
Source§impl ProjectionPlan
impl ProjectionPlan
Sourcepub fn from_expressions(
base: Arc<dyn Projectable>,
columns: &[(impl AsRef<str>, impl AsRef<str>)],
blob_version: BlobVersion,
) -> Result<Self>
pub fn from_expressions( base: Arc<dyn Projectable>, columns: &[(impl AsRef<str>, impl AsRef<str>)], blob_version: BlobVersion, ) -> Result<Self>
Set the projection from SQL expressions
Sourcepub fn from_schema(
base: Arc<dyn Projectable>,
projection: &Schema,
blob_version: BlobVersion,
) -> Result<Self>
pub fn from_schema( base: Arc<dyn Projectable>, projection: &Schema, blob_version: BlobVersion, ) -> Result<Self>
Set the projection from a schema
This plan will have no complex expressions, the schema must be a subset of the dataset schema.
With this approach it is possible to refer to portions of nested fields.
For example, if the schema is:
{
"metadata": {
"location": {
"x": f32,
"y": f32,
},
"age": i32,
}
}It is possible to project a partial schema that drops y like:
{
"metadata": {
"location": {
"x": f32,
},
"age": i32,
}
}This is something that cannot be done easily using expressions.
pub fn full( base: Arc<dyn Projectable>, blob_version: BlobVersion, ) -> Result<Self>
Sourcepub fn to_physical_exprs(
&self,
current_schema: &ArrowSchema,
) -> Result<Vec<(Arc<dyn PhysicalExpr>, String)>>
pub fn to_physical_exprs( &self, current_schema: &ArrowSchema, ) -> Result<Vec<(Arc<dyn PhysicalExpr>, String)>>
Convert the projection to a list of physical expressions
This is used to apply the final projection (including dynamic expressions) to the data.
Sourcepub fn include_row_id(&mut self)
pub fn include_row_id(&mut self)
Include the row id in the output
Sourcepub fn include_row_addr(&mut self)
pub fn include_row_addr(&mut self)
Include the row address in the output
Sourcepub fn has_output_cols(&self) -> bool
pub fn has_output_cols(&self) -> bool
Check if the projection has any output columns
This doesn’t mean there is a physical projection. For example, we may someday support
something like SELECT 1 AS foo which would have an output column (foo) but no physical projection
pub fn output_schema(&self) -> Result<ArrowSchema>
pub async fn project_batch(&self, batch: RecordBatch) -> Result<RecordBatch>
Trait Implementations§
Source§impl Clone for ProjectionPlan
impl Clone for ProjectionPlan
Source§fn clone(&self) -> ProjectionPlan
fn clone(&self) -> ProjectionPlan
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ProjectionPlan
impl !RefUnwindSafe for ProjectionPlan
impl Send for ProjectionPlan
impl Sync for ProjectionPlan
impl Unpin for ProjectionPlan
impl !UnwindSafe for ProjectionPlan
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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>
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