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

Method project

datafusion/physical-expr/src/partitioning.rs:275–294  ·  view source on GitHub ↗

Calculate the output partitioning after applying the given projection.

(
        &self,
        mapping: &ProjectionMapping,
        input_eq_properties: &EquivalenceProperties,
    )

Source from the content-addressed store, hash-verified

273
274 /// Calculate the output partitioning after applying the given projection.
275 pub fn project(
276 &self,
277 mapping: &ProjectionMapping,
278 input_eq_properties: &EquivalenceProperties,
279 ) -> Self {
280 if let Partitioning::Hash(exprs, part) = self {
281 let normalized_exprs = input_eq_properties
282 .project_expressions(exprs, mapping)
283 .zip(exprs)
284 .map(|(proj_expr, expr)| {
285 proj_expr.unwrap_or_else(|| {
286 Arc::new(UnKnownColumn::new(&expr.to_string()))
287 })
288 })
289 .collect();
290 Partitioning::Hash(normalized_exprs, *part)
291 } else {
292 self.clone()
293 }
294 }
295}
296
297impl PartialEq for Partitioning {

Callers 15

evaluateMethod · 0.45
project_orderingsFunction · 0.45
project_orderings2Function · 0.45
project_orderings3Function · 0.45
compute_propertiesMethod · 0.45
partition_statisticsMethod · 0.45
filter_and_projectFunction · 0.45
poll_nextMethod · 0.45
try_newMethod · 0.45
executeMethod · 0.45
compute_propertiesMethod · 0.45

Calls 6

newFunction · 0.85
collectMethod · 0.80
mapMethod · 0.45
project_expressionsMethod · 0.45
to_stringMethod · 0.45
cloneMethod · 0.45

Tested by 4

project_orderings2Function · 0.36
project_orderings3Function · 0.36