MCPcopy Create free account
hub / github.com/apache/datafusion / new

Method new

datafusion/optimizer/src/plan_signature.rs:62–70  ·  view source on GitHub ↗

Returns [`LogicalPlanSignature`] of the given [`LogicalPlan`]. It is a kind of [`LogicalPlan`] hashing with stronger guarantees. # Guarantees Consider two [`LogicalPlan`]s `p1` and `p2`. If `p1` and `p2` have a different number of [`LogicalPlan`]s, then they will have different [`LogicalPlanSignature`]s. If `p1` and `p2` have a different [`Hash`], then they will have different [`LogicalPlanSi

(plan: &LogicalPlan)

Source from the content-addressed store, hash-verified

60 /// the same [`LogicalPlanSignature`]s (due to hash implementation in
61 /// [`LogicalPlan`]).
62 pub fn new(plan: &LogicalPlan) -> Self {
63 let mut hasher = DefaultHasher::new();
64 plan.hash(&mut hasher);
65
66 Self {
67 node_number: get_node_number(plan),
68 plan_hash: hasher.finish(),
69 }
70 }
71}
72
73/// Get total number of [`LogicalPlan`]s in the plan.

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
get_node_numberFunction · 0.85
hashMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected