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

Method with_estimated_selectivity

datafusion/common/src/stats.rs:199–202  ·  view source on GitHub ↗

Return the estimate of applying a filter with estimated selectivity `selectivity` to this Precision. A selectivity of `1.0` means that all rows are selected. A selectivity of `0.5` means half the rows are selected. Will always return inexact statistics.

(self, selectivity: f64)

Source from the content-addressed store, hash-verified

197 /// rows are selected. A selectivity of `0.5` means half the rows are
198 /// selected. Will always return inexact statistics.
199 pub fn with_estimated_selectivity(self, selectivity: f64) -> Self {
200 self.map(|v| ((v as f64 * selectivity).ceil()) as usize)
201 .to_inexact()
202 }
203}
204
205impl Precision<ScalarValue> {

Callers 1

statistics_helperMethod · 0.80

Calls 2

to_inexactMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected