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

Method is_singleton

datafusion/common/src/stats.rs:1092–1100  ·  view source on GitHub ↗

Column contains a single non null value (e.g constant).

(&self)

Source from the content-addressed store, hash-verified

1090impl ColumnStatistics {
1091 /// Column contains a single non null value (e.g constant).
1092 pub fn is_singleton(&self) -> bool {
1093 match (&self.min_value, &self.max_value) {
1094 // Min and max values are the same and not infinity.
1095 (Precision::Exact(min), Precision::Exact(max)) => {
1096 !min.is_null() && !max.is_null() && (min == max)
1097 }
1098 (_, _) => false,
1099 }
1100 }
1101
1102 /// Returns a [`ColumnStatistics`] instance having all [`Precision::Absent`] parameters.
1103 pub fn new_unknown() -> Self {

Callers 1

compute_propertiesMethod · 0.80

Calls 1

is_nullMethod · 0.45

Tested by

no test coverage detected