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

Method simplify

datafusion/functions/src/string/concat_ws.rs:385–394  ·  view source on GitHub ↗

Simply the `concat_ws` function by 1. folding to `null` if the delimiter is null 2. filtering out `null` arguments 3. using `concat` to replace `concat_ws` if the delimiter is an empty string 4. concatenating contiguous literals if the delimiter is a literal.

(
        &self,
        args: Vec<Expr>,
        _info: &SimplifyContext,
    )

Source from the content-addressed store, hash-verified

383 /// 3. using `concat` to replace `concat_ws` if the delimiter is an empty string
384 /// 4. concatenating contiguous literals if the delimiter is a literal.
385 fn simplify(
386 &self,
387 args: Vec<Expr>,
388 _info: &SimplifyContext,
389 ) -> Result<ExprSimplifyResult> {
390 match &args[..] {
391 [delimiter, vals @ ..] => simplify_concat_ws(delimiter, vals),
392 _ => Ok(ExprSimplifyResult::Original(args)),
393 }
394 }
395
396 fn documentation(&self) -> Option<&Documentation> {
397 self.doc()

Callers

nothing calls this directly

Calls 1

simplify_concat_wsFunction · 0.85

Tested by

no test coverage detected