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

Function can_evaluate_to_const

datafusion/functions-nested/src/map.rs:61–64  ·  view source on GitHub ↗

Check if we can evaluate the expr to constant directly. # Example ```sql SELECT make_map('type', 'test') from test ``` We can evaluate the result of `make_map` directly.

(args: &[ColumnarValue])

Source from the content-addressed store, hash-verified

59/// ```
60/// We can evaluate the result of `make_map` directly.
61fn can_evaluate_to_const(args: &[ColumnarValue]) -> bool {
62 args.iter()
63 .all(|arg| matches!(arg, ColumnarValue::Scalar(_)))
64}
65
66fn make_map_batch(args: &[ColumnarValue]) -> Result<ColumnarValue> {
67 let [keys_arg, values_arg] = take_function_args("make_map", args)?;

Callers 1

make_map_batchFunction · 0.85

Calls 2

allMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…