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

Method create_expression_metrics

datafusion/physical-expr/src/projection.rs:542–560  ·  view source on GitHub ↗
(
        &self,
        metrics: &ExecutionPlanMetricsSet,
        partition: usize,
    )

Source from the content-addressed store, hash-verified

540 }
541
542 pub fn create_expression_metrics(
543 &self,
544 metrics: &ExecutionPlanMetricsSet,
545 partition: usize,
546 ) -> ExpressionEvaluatorMetrics {
547 let labels: Vec<String> = self
548 .exprs
549 .iter()
550 .map(|proj_expr| {
551 let expr_sql = fmt_sql(proj_expr.expr.as_ref()).to_string();
552 if proj_expr.expr.to_string() == proj_expr.alias {
553 expr_sql
554 } else {
555 format!("{expr_sql} AS {}", proj_expr.alias)
556 }
557 })
558 .collect();
559 ExpressionEvaluatorMetrics::new(metrics, partition, labels)
560 }
561
562 /// Project statistics according to this projection.
563 /// For example, for a projection `SELECT a AS x, b + 1 AS y`, where `a` is at index 0 and `b` is at index 1,

Callers 1

with_metricsMethod · 0.80

Calls 7

fmt_sqlFunction · 0.85
newFunction · 0.85
collectMethod · 0.80
mapMethod · 0.45
iterMethod · 0.45
to_stringMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected