pub struct KeepEdgeOrder;Expand description
Keeps a graph node’s edge rows in the order the plan produces them, and gives them a fixed order where the plan has none.
DataFusion’s EnforceDistribution puts a round-robin repartition under an
operator that benefits from parallel input, such as the FilterExec of a
view with a WHERE (a subgraph) or the ProjectionExec that computes a
weight expression. Draining its partitions in order would then read the
batches out of file order, changing dense ids (and so labels and float
summation order) from what ursa-io gives the Python library. This rule
runs after the default rules and removes every round-robin repartition
below a graph node: a round-robin repartition only adds parallelism, so
removing it never changes a result.
What remains may still not preserve order: a join, an aggregate, a hash
repartition, a merge of partitions or a UNION produces its rows in an
order that can change between runs and thread counts (#263). Over such a
plan, the rule sorts the edge rows by (source, destination), and a
weighted node’s rows by their weights after that, so that rows that tie
are identical in every column the node reads. A traversal’s node-id
inputs over such a plan are sorted by value, and so are a graph’s vertex
keys, which set the order of its nodes. Order-preserving plans
(scans, views over files, filters, projections) are left as they are,
in file order. The sort is a SortExec under the node, so EXPLAIN
shows it.
Trait Implementations§
Source§impl Debug for KeepEdgeOrder
impl Debug for KeepEdgeOrder
Source§impl PhysicalOptimizerRule for KeepEdgeOrder
impl PhysicalOptimizerRule for KeepEdgeOrder
Source§fn optimize(
&self,
plan: Arc<dyn ExecutionPlan>,
_config: &ConfigOptions,
) -> Result<Arc<dyn ExecutionPlan>>
fn optimize( &self, plan: Arc<dyn ExecutionPlan>, _config: &ConfigOptions, ) -> Result<Arc<dyn ExecutionPlan>>
plan to an optimized form. Read moreSource§fn schema_check(&self) -> bool
fn schema_check(&self) -> bool
Source§fn optimize_with_context(
&self,
plan: Arc<dyn ExecutionPlan>,
context: &dyn PhysicalOptimizerContext,
) -> Result<Arc<dyn ExecutionPlan>, DataFusionError>
fn optimize_with_context( &self, plan: Arc<dyn ExecutionPlan>, context: &dyn PhysicalOptimizerContext, ) -> Result<Arc<dyn ExecutionPlan>, DataFusionError>
plan with access to extended context (statistics registry, etc.). Read moreAuto Trait Implementations§
impl Forget for KeepEdgeOrder
impl Freeze for KeepEdgeOrder
impl RefUnwindSafe for KeepEdgeOrder
impl Send for KeepEdgeOrder
impl Sync for KeepEdgeOrder
impl Unpin for KeepEdgeOrder
impl UnsafeUnpin for KeepEdgeOrder
impl UnwindSafe for KeepEdgeOrder
Blanket Implementations§
impl<T> Allocation for T
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> 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