MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / rounded

Method rounded

src/transform/src/analysis.rs:1456–1472  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1454 }
1455
1456 pub fn rounded(&self) -> Option<usize> {
1457 match self {
1458 CardinalityEstimate::Estimate(OrderedFloat(f)) => {
1459 let rounded = f.ceil();
1460
1461 if !rounded.is_normal() || rounded < 0.0 {
1462 warn!(
1463 "ignoring denormalized or negative cardinality estimate {f} rounded to {rounded}"
1464 );
1465 }
1466
1467 // if we can't cast, the value is unknown
1468 u64::try_cast_from(rounded).map(usize::cast_from)
1469 }
1470 CardinalityEstimate::Unknown => None,
1471 }
1472 }
1473 }
1474
1475 impl std::ops::Add for CardinalityEstimate {

Callers 1

actionMethod · 0.80

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected