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 assertion is GT, it's wrong -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org