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

Function fmt_function

datafusion/expr/src/expr.rs:3725–3742  ·  view source on GitHub ↗
(
    f: &mut Formatter,
    fun: &str,
    distinct: bool,
    args: &[Expr],
    display: bool,
)

Source from the content-addressed store, hash-verified

3723}
3724
3725fn fmt_function(
3726 f: &mut Formatter,
3727 fun: &str,
3728 distinct: bool,
3729 args: &[Expr],
3730 display: bool,
3731) -> fmt::Result {
3732 let args: Vec<String> = match display {
3733 true => args.iter().map(|arg| format!("{arg}")).collect(),
3734 false => args.iter().map(|arg| format!("{arg:?}")).collect(),
3735 };
3736
3737 let distinct_str = match distinct {
3738 true => "DISTINCT ",
3739 false => "",
3740 };
3741 write!(f, "{}({}{})", fun, distinct_str, args.join(", "))
3742}
3743
3744/// The name of the column (field) that this `Expr` will produce in the physical plan.
3745/// The difference from [Expr::schema_name] is that top-level columns are unqualified.

Callers 1

fmtMethod · 0.85

Calls 3

collectMethod · 0.80
mapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…