public SymbolStatsAssertion lowValue(double expected) { assertEstimateEquals(statistics.getLowValue(), expected, "lowValue mismatch"); return this; }
public SymbolStatsAssertion distinctValuesCount(double expected) { assertEstimateEquals(statistics.getDistinctValuesCount(), expected, "distinctValuesCount mismatch"); return this; }
public SymbolStatsAssertion averageRowSize(double expected) { assertEstimateEquals(statistics.getAverageRowSize(), expected, "average row size mismatch"); return this; }
public SymbolStatsAssertion nullsFraction(double expected) { assertEstimateEquals(statistics.getNullsFraction(), expected, "nullsFraction mismatch"); return this; }
public SymbolStatsAssertion highValue(double expected) { assertEstimateEquals(statistics.getHighValue(), expected, "highValue mismatch"); return this; }
private static void assertOverlap(StatisticRange a, StatisticRange b, double expected) { assertEstimateEquals(a.overlapPercentWith(b), expected, "overlapPercentWith"); } }
public PlanNodeStatsAssertion outputRowsCount(double expected) { assertEstimateEquals(actual.getOutputRowCount(), expected, "outputRowsCount mismatch"); return this; }
private void assertSymbolStatsEqual(Symbol symbol, SymbolStatsEstimate actual, SymbolStatsEstimate expected) { assertEstimateEquals(actual.getNullsFraction(), expected.getNullsFraction(), "nullsFraction mismatch for %s", symbol.getName()); assertEstimateEquals(actual.getLowValue(), expected.getLowValue(), "lowValue mismatch for %s", symbol.getName()); assertEstimateEquals(actual.getHighValue(), expected.getHighValue(), "highValue mismatch for %s", symbol.getName()); assertEstimateEquals(actual.getDistinctValuesCount(), expected.getDistinctValuesCount(), "distinct values count mismatch for %s", symbol.getName()); assertEstimateEquals(actual.getAverageRowSize(), expected.getAverageRowSize(), "average row size mismatch for %s", symbol.getName()); } }
public PlanNodeStatsAssertion equalTo(PlanNodeStatsEstimate expected) { assertEstimateEquals(actual.getOutputRowCount(), expected.getOutputRowCount(), "outputRowCount mismatch"); for (Symbol symbol : union(expected.getSymbolsWithKnownStatistics(), actual.getSymbolsWithKnownStatistics())) { assertSymbolStatsEqual(symbol, actual.getSymbolStatistics(symbol), expected.getSymbolStatistics(symbol)); } return this; }