Struct datafusion::physical_plan::sorts::sort::SortExec
source · pub struct SortExec { /* private fields */ }
Expand description
Sort execution plan.
This operator supports sorting datasets that are larger than the memory allotted by the memory manager, by spilling to disk.
Implementations§
source§impl SortExec
impl SortExec
sourcepub fn try_new(
expr: Vec<PhysicalSortExpr>,
input: Arc<dyn ExecutionPlan>,
fetch: Option<usize>
) -> Result<Self>
👎Deprecated since 22.0.0: use new
and with_fetch
pub fn try_new( expr: Vec<PhysicalSortExpr>, input: Arc<dyn ExecutionPlan>, fetch: Option<usize> ) -> Result<Self>
new
and with_fetch
Create a new sort execution plan
sourcepub fn new(expr: Vec<PhysicalSortExpr>, input: Arc<dyn ExecutionPlan>) -> Self
pub fn new(expr: Vec<PhysicalSortExpr>, input: Arc<dyn ExecutionPlan>) -> Self
Create a new sort execution plan that produces a single, sorted output partition.
sourcepub fn new_with_partitioning(
expr: Vec<PhysicalSortExpr>,
input: Arc<dyn ExecutionPlan>,
preserve_partitioning: bool,
fetch: Option<usize>
) -> Self
👎Deprecated since 22.0.0: use new
, with_fetch
and with_preserve_partioning
instead
pub fn new_with_partitioning( expr: Vec<PhysicalSortExpr>, input: Arc<dyn ExecutionPlan>, preserve_partitioning: bool, fetch: Option<usize> ) -> Self
new
, with_fetch
and with_preserve_partioning
insteadCreate a new sort execution plan with the option to preserve the partitioning of the input plan
sourcepub fn preserve_partitioning(&self) -> bool
pub fn preserve_partitioning(&self) -> bool
Whether this SortExec
preserves partitioning of the children
sourcepub fn with_preserve_partitioning(self, preserve_partitioning: bool) -> Self
pub fn with_preserve_partitioning(self, preserve_partitioning: bool) -> Self
Specify the partitioning behavior of this sort exec
If preserve_partitioning
is true, sorts each partition
individually, producing one sorted strema for each input partition.
If preserve_partitioning
is false, sorts and merges all
input partitions producing a single, sorted partition.
sourcepub fn with_fetch(self, fetch: Option<usize>) -> Self
pub fn with_fetch(self, fetch: Option<usize>) -> Self
Whether this SortExec
preserves partitioning of the children
sourcepub fn input(&self) -> &Arc<dyn ExecutionPlan>
pub fn input(&self) -> &Arc<dyn ExecutionPlan>
Input schema
sourcepub fn expr(&self) -> &[PhysicalSortExpr]
pub fn expr(&self) -> &[PhysicalSortExpr]
Sort expressions
Trait Implementations§
source§impl ExecutionPlan for SortExec
impl ExecutionPlan for SortExec
source§fn output_partitioning(&self) -> Partitioning
fn output_partitioning(&self) -> Partitioning
Get the output partitioning of this plan
source§fn unbounded_output(&self, children: &[bool]) -> Result<bool>
fn unbounded_output(&self, children: &[bool]) -> Result<bool>
Specifies whether this plan generates an infinite stream of records. If the plan does not support pipelining, but its input(s) are infinite, returns an error to indicate this.
source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Any
so that it can be
downcast to a specific implementation.source§fn required_input_distribution(&self) -> Vec<Distribution>
fn required_input_distribution(&self) -> Vec<Distribution>
source§fn children(&self) -> Vec<Arc<dyn ExecutionPlan>>
fn children(&self) -> Vec<Arc<dyn ExecutionPlan>>
source§fn benefits_from_input_partitioning(&self) -> bool
fn benefits_from_input_partitioning(&self) -> bool
true
if this operator would benefit from
partitioning its input (and thus from more parallelism). For
operators that do very little work the overhead of extra
parallelism may outweigh any benefits Read moresource§fn output_ordering(&self) -> Option<&[PhysicalSortExpr]>
fn output_ordering(&self) -> Option<&[PhysicalSortExpr]>
Some(keys)
with the description of how it was sorted. Read moresource§fn equivalence_properties(&self) -> EquivalenceProperties
fn equivalence_properties(&self) -> EquivalenceProperties
source§fn with_new_children(
self: Arc<Self>,
children: Vec<Arc<dyn ExecutionPlan>>
) -> Result<Arc<dyn ExecutionPlan>>
fn with_new_children( self: Arc<Self>, children: Vec<Arc<dyn ExecutionPlan>> ) -> Result<Arc<dyn ExecutionPlan>>
source§fn execute(
&self,
partition: usize,
context: Arc<TaskContext>
) -> Result<SendableRecordBatchStream>
fn execute( &self, partition: usize, context: Arc<TaskContext> ) -> Result<SendableRecordBatchStream>
source§fn metrics(&self) -> Option<MetricsSet>
fn metrics(&self) -> Option<MetricsSet>
source§fn statistics(&self) -> Statistics
fn statistics(&self) -> Statistics
ExecutionPlan
node.source§fn required_input_ordering(&self) -> Vec<Option<Vec<PhysicalSortRequirement>>>
fn required_input_ordering(&self) -> Vec<Option<Vec<PhysicalSortRequirement>>>
source§fn maintains_input_order(&self) -> Vec<bool>
fn maintains_input_order(&self) -> Vec<bool>
false
if this operator’s implementation may reorder
rows within or between partitions. Read more