XieJiann commented on code in PR #30053:
URL: https://github.com/apache/doris/pull/30053#discussion_r1456763737
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java:
##########
@@ -556,11 +558,16 @@ public Statistics
visitPhysicalGenerate(PhysicalGenerate<? extends Plan> generat
return computeGenerate(generate);
}
- private Statistics computeAssertNumRows(long desiredNumOfRows) {
+ private Statistics computeAssertNumRows(AssertNumRowsElement
assertNumRowsElement) {
Statistics statistics = groupExpression.childStatistics(0);
- statistics.withRowCountAndEnforceValid(Math.min(1,
statistics.getRowCount()));
- statistics = new
StatisticsBuilder(statistics).setWidthInJoinCluster(1).build();
- return statistics;
+ if (assertNumRowsElement.getAssertion() == Assertion.NE
+ || assertNumRowsElement.assertNumber((long)
Math.ceil(statistics.getRowCount()))) {
+ return statistics;
+ } else {
+ Statistics newStatistics = statistics.withRowCountAndEnforceValid(
+ Math.min(assertNumRowsElement.getDesiredNumOfRows(),
statistics.getRowCount()));
Review Comment:
if assetion is GT
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]