Enum polars_plan::plans::DslPlan
source · pub enum DslPlan {
Show 18 variants
PythonScan {
options: PythonOptions,
},
Filter {
input: Arc<DslPlan>,
predicate: Expr,
},
Cache {
input: Arc<DslPlan>,
id: usize,
cache_hits: u32,
},
Scan {
paths: Arc<[PathBuf]>,
file_info: Option<FileInfo>,
hive_parts: Option<Arc<[HivePartitions]>>,
predicate: Option<Expr>,
file_options: FileScanOptions,
scan_type: FileScan,
},
DataFrameScan {
df: Arc<DataFrame>,
schema: SchemaRef,
output_schema: Option<SchemaRef>,
filter: Option<Expr>,
},
Select {
expr: Vec<Expr>,
input: Arc<DslPlan>,
options: ProjectionOptions,
},
GroupBy {
input: Arc<DslPlan>,
keys: Vec<Expr>,
aggs: Vec<Expr>,
apply: Option<(Arc<dyn DataFrameUdf>, SchemaRef)>,
maintain_order: bool,
options: Arc<GroupbyOptions>,
},
Join {
input_left: Arc<DslPlan>,
input_right: Arc<DslPlan>,
left_on: Vec<Expr>,
right_on: Vec<Expr>,
options: Arc<JoinOptions>,
},
HStack {
input: Arc<DslPlan>,
exprs: Vec<Expr>,
options: ProjectionOptions,
},
Distinct {
input: Arc<DslPlan>,
options: DistinctOptions,
},
Sort {
input: Arc<DslPlan>,
by_column: Vec<Expr>,
slice: Option<(i64, usize)>,
sort_options: SortMultipleOptions,
},
Slice {
input: Arc<DslPlan>,
offset: i64,
len: IdxSize,
},
MapFunction {
input: Arc<DslPlan>,
function: DslFunction,
},
Union {
inputs: Vec<DslPlan>,
args: UnionArgs,
},
HConcat {
inputs: Vec<DslPlan>,
options: HConcatOptions,
},
ExtContext {
input: Arc<DslPlan>,
contexts: Vec<DslPlan>,
},
Sink {
input: Arc<DslPlan>,
payload: SinkType,
},
IR {
node: Option<Node>,
version: u32,
dsl: Arc<DslPlan>,
},
}
Variants§
PythonScan
Available on crate feature
python
only.Fields
§
options: PythonOptions
Filter
Filter on a boolean mask
Cache
Cache the input at this point in the LP
Scan
DataFrameScan
In memory DataFrame
Select
Polars’ select
operation, this can mean projection, but also full data access.
GroupBy
Groupby aggregation
Join
Join operation
Fields
§
options: Arc<JoinOptions>
HStack
Adding columns to the table without a Join
Distinct
Remove duplicates from the table
Sort
Sort the table
Fields
§
sort_options: SortMultipleOptions
Slice
Slice the table
MapFunction
A (User Defined) Function
Union
Vertical concatenation
HConcat
Horizontal concatenation of multiple plans
ExtContext
This allows expressions to access other tables
Sink
IR
Implementations§
source§impl DslPlan
impl DslPlan
sourcepub fn compute_schema(&self) -> PolarsResult<SchemaRef>
pub fn compute_schema(&self) -> PolarsResult<SchemaRef>
Compute the schema. This requires conversion to IR
and type-resolving.
source§impl DslPlan
impl DslPlan
pub fn describe(&self) -> PolarsResult<String>
pub fn describe_tree_format(&self) -> PolarsResult<String>
pub fn display(&self) -> PolarsResult<impl Display>
pub fn to_alp(self) -> PolarsResult<IRPlan>
Trait Implementations§
source§impl<'de> Deserialize<'de> for DslPlan
impl<'de> Deserialize<'de> for DslPlan
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<DslPlan> for DslBuilder
impl From<DslPlan> for DslBuilder
Auto Trait Implementations§
impl !Freeze for DslPlan
impl !RefUnwindSafe for DslPlan
impl Send for DslPlan
impl Sync for DslPlan
impl Unpin for DslPlan
impl !UnwindSafe for DslPlan
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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