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

Function get_signed_integer

datafusion/functions-window/src/utils.rs:24–34  ·  view source on GitHub ↗
(value: &ScalarValue)

Source from the content-addressed store, hash-verified

22use std::sync::Arc;
23
24pub(crate) fn get_signed_integer(value: &ScalarValue) -> Result<i64> {
25 if value.is_null() {
26 return Ok(0);
27 }
28
29 if !value.data_type().is_integer() {
30 return exec_err!("Expected an integer value");
31 }
32
33 value.cast_to(&DataType::Int64)?.try_into()
34}
35
36pub(crate) fn get_scalar_value_from_args(
37 args: &[Arc<dyn PhysicalExpr>],

Callers 2

partition_evaluatorMethod · 0.85
partition_evaluatorMethod · 0.85

Calls 4

is_integerMethod · 0.80
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…