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

Method try_cmp

datafusion/common/src/scalar/mod.rs:4597–4601  ·  view source on GitHub ↗

Compare `self` with `other` and return an `Ordering`. This is the same as [`PartialOrd`] except that it returns `Err` if the values cannot be compared, e.g., they have incompatible data types.

(&self, other: &Self)

Source from the content-addressed store, hash-verified

4595 /// This is the same as [`PartialOrd`] except that it returns
4596 /// `Err` if the values cannot be compared, e.g., they have incompatible data types.
4597 pub fn try_cmp(&self, other: &Self) -> Result<Ordering> {
4598 self.partial_cmp(other).ok_or_else(|| {
4599 _internal_datafusion_err!("Uncomparable values: {self:?}, {other:?}")
4600 })
4601 }
4602
4603 /// Estimate size if bytes including `Self`. For values with internal containers such as `String`
4604 /// includes the allocated size (`capacity`) rather than the current length (`len`)

Callers 5

min_max_batch_genericFunction · 0.80
compare_rowsFunction · 0.80
evaluateMethod · 0.80

Calls 1

partial_cmpMethod · 0.45

Tested by 1