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

Function fmt_sql

datafusion/physical-expr-common/src/physical_expr.rs:617–630  ·  view source on GitHub ↗

Prints a [`PhysicalExpr`] in a SQL-like format # Example ``` # // The boilerplate needed to create a `PhysicalExpr` for the example use std::collections::HashMap; # use std::fmt::Formatter; # use std::sync::Arc; # use arrow::array::RecordBatch; # use arrow::datatypes::{DataType, Field, FieldRef, Schema}; # use datafusion_common::Result; # use datafusion_expr_common::columnar_value::ColumnarValue;

(expr: &dyn PhysicalExpr)

Source from the content-addressed store, hash-verified

615/// );
616/// ```
617pub fn fmt_sql(expr: &dyn PhysicalExpr) -> impl Display + '_ {
618 struct Wrapper<'a> {
619 expr: &'a dyn PhysicalExpr,
620 }
621
622 impl Display for Wrapper<'_> {
623 fn fmt(&self, f: &mut Formatter) -> fmt::Result {
624 self.expr.fmt_sql(f)?;
625 Ok(())
626 }
627 }
628
629 Wrapper { expr }
630}
631
632/// Take a snapshot of the given `PhysicalExpr` if it is dynamic.
633///

Callers 15

test_fmt_sql_1Function · 0.85
test_fmt_sql_2Function · 0.85
test_fmt_sql_3Function · 0.85
test_fmt_sql_4Function · 0.85
test_fmt_sqlFunction · 0.85
test_fmt_sqlFunction · 0.85
test_fmt_sqlFunction · 0.85
test_fmt_sqlFunction · 0.85
test_fmt_sqlFunction · 0.85
test_fmt_sqlFunction · 0.85
test_fmt_sqlFunction · 0.85

Calls

no outgoing calls

Tested by 14

test_fmt_sql_1Function · 0.68
test_fmt_sql_2Function · 0.68
test_fmt_sql_3Function · 0.68
test_fmt_sql_4Function · 0.68
test_fmt_sqlFunction · 0.68
test_fmt_sqlFunction · 0.68
test_fmt_sqlFunction · 0.68
test_fmt_sqlFunction · 0.68
test_fmt_sqlFunction · 0.68
test_fmt_sqlFunction · 0.68
test_fmt_sqlFunction · 0.68
test_fmt_sqlFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…