Enum DslPlan
pub enum DslPlan {
Show 27 variants
PythonScan {
options: PythonOptionsDsl,
},
Filter {
input: Arc<DslPlan>,
predicate: Expr,
},
Cache {
input: Arc<DslPlan>,
id: UniqueId,
},
Scan {
sources: ScanSources,
unified_scan_args: Box<UnifiedScanArgs>,
scan_type: Box<FileScanDsl>,
cached_ir: Arc<Mutex<Option<IR>>>,
},
DataFrameScan {
df: Arc<DataFrame>,
schema: Arc<Schema<DataType, ()>>,
},
Select {
expr: Vec<Expr>,
input: Arc<DslPlan>,
options: ProjectionOptions,
},
GroupBy {
input: Arc<DslPlan>,
keys: Vec<Expr>,
predicates: Vec<Expr>,
aggs: Vec<Expr>,
maintain_order: bool,
options: Arc<GroupbyOptions>,
apply: Option<(PlanCallback<DataFrame, DataFrame>, Arc<Schema<DataType, ()>>)>,
},
Join {
input_left: Arc<DslPlan>,
input_right: Arc<DslPlan>,
condition: JoinCondition,
options: Arc<JoinOptions>,
},
Gather {
input: Arc<DslPlan>,
idxs: Arc<DslPlan>,
null_on_oob: bool,
},
HStack {
input: Arc<DslPlan>,
exprs: Vec<Expr>,
options: ProjectionOptions,
},
MatchToSchema {
input: Arc<DslPlan>,
match_schema: Arc<Schema<DataType, ()>>,
per_column: Arc<[MatchToSchemaPerColumn]>,
extra_columns: ExtraColumnsPolicy,
},
PipeWithSchema {
input: Arc<[DslPlan]>,
callback: PlanCallback<(Vec<DslPlan>, Vec<Arc<Schema<DataType, ()>>>), DslPlan>,
},
Pivot {
input: Arc<DslPlan>,
on: Selector,
on_columns: Arc<DataFrame>,
index: Selector,
values: Selector,
agg: Expr,
maintain_order: bool,
separator: PlSmallStr,
column_naming: PivotColumnNaming,
},
Distinct {
input: Arc<DslPlan>,
options: DistinctOptionsDSL,
},
Sort {
input: Arc<DslPlan>,
by_column: Vec<Expr>,
slice: Option<(i64, usize)>,
sort_options: SortMultipleOptions,
},
Slice {
input: Arc<DslPlan>,
offset: i64,
len: u64,
},
MapFunction {
input: Arc<DslPlan>,
function: DslFunction,
},
Union {
inputs: Vec<DslPlan>,
args: UnionArgs,
},
HConcat {
inputs: Vec<DslPlan>,
options: HConcatOptions,
},
Sink {
input: Arc<DslPlan>,
payload: SinkType,
},
SinkMultiple {
inputs: Vec<DslPlan>,
},
MergeSorted {
input_left: Arc<DslPlan>,
input_right: Arc<DslPlan>,
key: Arc<[PlSmallStr]>,
maintain_order: bool,
},
Recursive {
anchor: Arc<DslPlan>,
step: Arc<DslPlan>,
id: UniqueId,
round_local_caches: Arc<[UniqueId]>,
},
WorkingTable {
id: UniqueId,
schema: Arc<Schema<DataType, ()>>,
},
SQL {
query: Arc<String>,
relations: Vec<(PlSmallStr, DslPlan)>,
catalog_tables: Vec<(Arc<[PlSmallStr]>, Arc<[PlSmallStr]>, DslPlan)>,
cached_stmt: CachedSqlStatement,
},
IR {
dsl: Arc<DslPlan>,
version: u32,
node: Option<Node>,
opt_flags: Option<OptFlags>,
},
Resolver {
resolver: Arc<DslResolver>,
resolver_schema: Arc<Mutex<Option<Arc<Schema<DataType, ()>>>>>,
resolved_cache: Arc<Mutex<IndexMap<ResolveDslArgs, ResolvedDsl, RandomState>>>,
},
}Variants§
PythonScan
python only.Fields
options: PythonOptionsDslFilter
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
Fields
options: Arc<GroupbyOptions>Join
Join operation
Gather
Gathers from this table with the given indices.
HStack
Adding columns to the table without a Join
MatchToSchema
Match / Evolve into a schema
Fields
match_schema: Arc<Schema<DataType, ()>>The schema to match to.
This is also always the output schema.
per_column: Arc<[MatchToSchemaPerColumn]>extra_columns: ExtraColumnsPolicyPipeWithSchema
Fields
Pivot
pivot only.Distinct
Remove duplicates from the table
Sort
Sort the table
Fields
sort_options: SortMultipleOptionsSlice
Slice the table
MapFunction
A (User Defined) Function
Union
Vertical concatenation
HConcat
Horizontal concatenation of multiple plans
Sink
SinkMultiple
MergeSorted
merge_sorted only.Fields
key: Arc<[PlSmallStr]>Recursive
Recursive query (SQL WITH RECURSIVE). The output is the anchor rows followed by the
rows of each round: a round runs step with the WorkingTable of id holding the rows
of the round before. It ends when a round has no rows.
Fields
WorkingTable
The rows of the round before, inside the step of the Recursive with this id.
SQL
A SQL query that is resolved during DSL -> IR conversion.
Fields
relations: Vec<(PlSmallStr, DslPlan)>The named relations that the query may reference.
catalog_tables: Vec<(Arc<[PlSmallStr]>, Arc<[PlSmallStr]>, DslPlan)>The catalog tables the query reads: the name the query wrote, the table’s full name (catalog, namespace, table) and its scan.
cached_stmt: CachedSqlStatementIR
Resolver
Fields
resolver: Arc<DslResolver>resolved_cache: Arc<Mutex<IndexMap<ResolveDslArgs, ResolvedDsl, RandomState>>>Implementations§
§impl DslPlan
impl DslPlan
pub fn describe(&self) -> Result<String, PolarsError>
pub fn describe_tree_format(&self) -> Result<String, PolarsError>
pub fn display(&self) -> Result<impl Display, PolarsError>
pub fn to_alp(self) -> Result<IRPlan, PolarsError>
pub fn serialize_json_into( &self, writer: &mut dyn Write, ) -> Result<(), PolarsError>
serde only.pub fn deserialize_json_from_str(json: &str) -> Result<DslPlan, PolarsError>
serde only.pub fn serialize_versioned<W>(
&self,
writer: W,
ctx: PlanSerializationContext,
) -> Result<(), PolarsError>where
W: Write,
serde only.pub fn deserialize_versioned<R>(reader: R) -> Result<DslPlan, PolarsError>where
R: Read,
serde only.Trait Implementations§
§impl<'de> Deserialize<'de> for DslPlan
impl<'de> Deserialize<'de> for DslPlan
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DslPlan, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DslPlan, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl From<DslPlan> for DslBuilder
impl From<DslPlan> for DslBuilder
§fn from(lp: DslPlan) -> DslBuilder
fn from(lp: DslPlan) -> DslBuilder
§impl<'a> IntoIterator for &'a DslPlan
impl<'a> IntoIterator for &'a DslPlan
§impl PlanCallbackArgs for DslPlan
impl PlanCallbackArgs for DslPlan
§fn into_pyany<'py>(self, _py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_pyany<'py>(self, _py: Python<'py>) -> Result<Py<PyAny>, PyErr>
python only.§impl PlanCallbackOut for DslPlan
impl PlanCallbackOut for DslPlan
§fn from_pyany<'py>(pyany: Py<PyAny>, _py: Python<'py>) -> Result<DslPlan, PyErr>
fn from_pyany<'py>(pyany: Py<PyAny>, _py: Python<'py>) -> Result<DslPlan, PyErr>
python only.§impl Serialize for DslPlan
impl Serialize for DslPlan
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl !Freeze for DslPlan
impl !RefUnwindSafe for DslPlan
impl !UnwindSafe for DslPlan
impl Send for DslPlan
impl Sync for DslPlan
impl Unpin for DslPlan
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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