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

Method width

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

Computes the width of this interval; i.e. the difference between its bounds. For unbounded intervals, this function will return a `NULL` `ScalarValue` If the underlying data type doesn't support subtraction, this function will return an error.

(&self)

Source from the content-addressed store, hash-verified

892 /// `ScalarValue` If the underlying data type doesn't support subtraction,
893 /// this function will return an error.
894 pub fn width(&self) -> Result<ScalarValue> {
895 let dt = self.data_type();
896 let width_dt =
897 BinaryTypeCoercer::new(&dt, &Operator::Minus, &dt).get_result_type()?;
898 Ok(sub_bounds::<true>(&width_dt, &self.upper, &self.lower))
899 }
900
901 /// Returns the cardinality of this interval, which is the number of all
902 /// distinct points inside it. This function returns `None` if:

Callers 1

varianceMethod · 0.80

Calls 3

newFunction · 0.85
get_result_typeMethod · 0.80
data_typeMethod · 0.45

Tested by

no test coverage detected