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

Function parse_default_value

datafusion/functions-window/src/lead_lag.rs:391–402  ·  view source on GitHub ↗

Handles type coercion and null value refinement for default value argument depending on the data type of the input expression.

(
    input_exprs: &[Arc<dyn PhysicalExpr>],
    input_types: &[FieldRef],
)

Source from the content-addressed store, hash-verified

389/// Handles type coercion and null value refinement for default value
390/// argument depending on the data type of the input expression.
391fn parse_default_value(
392 input_exprs: &[Arc<dyn PhysicalExpr>],
393 input_types: &[FieldRef],
394) -> Result<ScalarValue> {
395 let expr_field = parse_expr_field(input_types)?;
396 let unparsed = get_scalar_value_from_args(input_exprs, 2)?;
397
398 unparsed
399 .filter(|v| !v.data_type().is_null())
400 .map(|v| v.cast_to(expr_field.data_type()))
401 .unwrap_or_else(|| ScalarValue::try_from(expr_field.data_type()))
402}
403
404#[derive(Debug)]
405struct WindowShiftEvaluator {

Callers 1

partition_evaluatorMethod · 0.85

Calls 7

parse_expr_fieldFunction · 0.85
mapMethod · 0.45
filterMethod · 0.45
is_nullMethod · 0.45
data_typeMethod · 0.45
cast_toMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…