Skip to main content

simplify_coalesce

Function simplify_coalesce 

Source
fn simplify_coalesce(e: &mut MirScalarExpr, column_types: &[ReprColumnType])
Expand description

Simplifies a Coalesce:

  1. If all arguments are null, the result is null.
  2. Drop null arguments (none of them can be the result).
  3. Truncate after the first argument known to be non-null (a literal or a non-nullable column).
  4. Deduplicate arguments (e.g. coalesce(#0, #0) → coalesce(#0)).
  5. Unwrap a single-argument coalesce.