Enum polars_plan::logical_plan::LogicalPlan
source · [−]pub enum LogicalPlan {
Show 22 variants
AnonymousScan {
function: Arc<dyn AnonymousScan>,
schema: SchemaRef,
predicate: Option<Expr>,
options: AnonymousScanOptions,
},
PythonScan {
options: PythonOptions,
},
Selection {
input: Box<LogicalPlan>,
predicate: Expr,
},
Cache {
input: Box<LogicalPlan>,
id: usize,
count: usize,
},
CsvScan {
path: PathBuf,
schema: SchemaRef,
options: CsvParserOptions,
predicate: Option<Expr>,
},
ParquetScan {
path: PathBuf,
schema: SchemaRef,
predicate: Option<Expr>,
options: ParquetOptions,
},
IpcScan {
path: PathBuf,
schema: SchemaRef,
options: IpcScanOptionsInner,
predicate: Option<Expr>,
},
DataFrameScan {
df: Arc<DataFrame>,
schema: SchemaRef,
output_schema: Option<SchemaRef>,
projection: Option<Arc<Vec<String>>>,
selection: Option<Expr>,
},
LocalProjection {
expr: Vec<Expr>,
input: Box<LogicalPlan>,
schema: SchemaRef,
},
Projection {
expr: Vec<Expr>,
input: Box<LogicalPlan>,
schema: SchemaRef,
},
Aggregate {
input: Box<LogicalPlan>,
keys: Arc<Vec<Expr>>,
aggs: Vec<Expr>,
schema: SchemaRef,
apply: Option<Arc<dyn DataFrameUdf>>,
maintain_order: bool,
options: GroupbyOptions,
},
Join {
input_left: Box<LogicalPlan>,
input_right: Box<LogicalPlan>,
schema: SchemaRef,
left_on: Vec<Expr>,
right_on: Vec<Expr>,
options: JoinOptions,
},
HStack {
input: Box<LogicalPlan>,
exprs: Vec<Expr>,
schema: SchemaRef,
},
Distinct {
input: Box<LogicalPlan>,
options: DistinctOptions,
},
Sort {
input: Box<LogicalPlan>,
by_column: Vec<Expr>,
args: SortArguments,
},
Explode {
input: Box<LogicalPlan>,
columns: Vec<String>,
schema: SchemaRef,
},
Slice {
input: Box<LogicalPlan>,
offset: i64,
len: IdxSize,
},
Melt {
input: Box<LogicalPlan>,
args: Arc<MeltArgs>,
schema: SchemaRef,
},
MapFunction {
input: Box<LogicalPlan>,
function: FunctionNode,
},
Union {
inputs: Vec<LogicalPlan>,
options: UnionOptions,
},
Error {
input: Box<LogicalPlan>,
err: Arc<Mutex<Option<PolarsError>>>,
},
ExtContext {
input: Box<LogicalPlan>,
contexts: Vec<LogicalPlan>,
schema: SchemaRef,
},
}
Variants
AnonymousScan
PythonScan
Fields
options: PythonOptions
Selection
Filter on a boolean mask
Cache
Cache the input at this point in the LP
CsvScan
Scan a CSV file
ParquetScan
Available on crate feature
parquet
only.Scan a Parquet file
IpcScan
Available on crate feature
ipc
only.DataFrameScan
Fields
schema: SchemaRef
In memory DataFrame
LocalProjection
Projection
Column selection
Aggregate
Fields
input: Box<LogicalPlan>
schema: SchemaRef
apply: Option<Arc<dyn DataFrameUdf>>
maintain_order: bool
options: GroupbyOptions
Groupby aggregation
Join
Fields
input_left: Box<LogicalPlan>
input_right: Box<LogicalPlan>
schema: SchemaRef
options: JoinOptions
Join operation
HStack
Adding columns to the table without a Join
Distinct
Remove duplicates from the table
Sort
Sort the table
Explode
An explode operation
Slice
Slice the table
Melt
A Melt operation
MapFunction
A (User Defined) Function
Union
Error
Catches errors and throws them later
ExtContext
This allows expressions to access other tables
Implementations
sourceimpl LogicalPlan
impl LogicalPlan
sourcepub fn dot(
&self,
acc_str: &mut String,
id: (usize, usize),
prev_node: DotNode<'_>,
id_map: &mut PlHashMap<String, String>
) -> Result
Available on crate feature dot_diagram
only.
pub fn dot(
&self,
acc_str: &mut String,
id: (usize, usize),
prev_node: DotNode<'_>,
id_map: &mut PlHashMap<String, String>
) -> Result
dot_diagram
only.Arguments
id
- (branch, id)
Used to make sure that the dot boxes are distinct.
branch is an id per join/union branch
id is incremented by the depth traversal of the tree.
sourceimpl LogicalPlan
impl LogicalPlan
Trait Implementations
sourceimpl Clone for LogicalPlan
impl Clone for LogicalPlan
sourcefn clone(&self) -> LogicalPlan
fn clone(&self) -> LogicalPlan
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for LogicalPlan
impl Debug for LogicalPlan
sourceimpl Default for LogicalPlan
impl Default for LogicalPlan
sourceimpl<'de> Deserialize<'de> for LogicalPlan
impl<'de> Deserialize<'de> for LogicalPlan
sourcefn 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
sourceimpl From<LogicalPlan> for LogicalPlanBuilder
impl From<LogicalPlan> for LogicalPlanBuilder
sourcefn from(lp: LogicalPlan) -> Self
fn from(lp: LogicalPlan) -> Self
Converts to this type from the input type.
sourceimpl Serialize for LogicalPlan
impl Serialize for LogicalPlan
Auto Trait Implementations
impl !RefUnwindSafe for LogicalPlan
impl Send for LogicalPlan
impl Sync for LogicalPlan
impl Unpin for LogicalPlan
impl !UnwindSafe for LogicalPlan
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more