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

Function cast_scalar_value

datafusion/expr-common/src/interval_arithmetic.rs:1732–1739  ·  view source on GitHub ↗

Cast scalar value to the given data type using an arrow kernel.

(
    value: &ScalarValue,
    data_type: &DataType,
    cast_options: &CastOptions,
)

Source from the content-addressed store, hash-verified

1730
1731/// Cast scalar value to the given data type using an arrow kernel.
1732fn cast_scalar_value(
1733 value: &ScalarValue,
1734 data_type: &DataType,
1735 cast_options: &CastOptions,
1736) -> Result<ScalarValue> {
1737 let cast_array = cast_with_options(&value.to_array()?, data_type, cast_options)?;
1738 ScalarValue::try_from_array(&cast_array, 0)
1739}
1740
1741/// An [Interval] that also tracks null status using a boolean interval.
1742///

Callers 1

cast_toMethod · 0.85

Calls 2

cast_with_optionsFunction · 0.85
to_arrayMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…