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

Function format_case_when

datafusion/expr/src/expr.rs:3905–3913  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3903
3904 #[test]
3905 fn format_case_when() -> Result<()> {
3906 let expr = case(col("a"))
3907 .when(lit(1), lit(true))
3908 .when(lit(0), lit(false))
3909 .otherwise(lit(ScalarValue::Null))?;
3910 let expected = "CASE a WHEN Int32(1) THEN Boolean(true) WHEN Int32(0) THEN Boolean(false) ELSE NULL END";
3911 assert_eq!(expected, format!("{expr}"));
3912 Ok(())
3913 }
3914
3915 #[test]
3916 fn format_cast() -> Result<()> {

Callers

nothing calls this directly

Calls 5

otherwiseMethod · 0.80
whenMethod · 0.80
caseFunction · 0.70
colFunction · 0.70
litFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…