Reminiscent commented on code in PR #18784: URL: https://github.com/apache/doris/pull/18784#discussion_r1197657007
########## fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java: ########## @@ -464,6 +478,32 @@ private Statistics computeTopN(TopN topN) { return stats.withRowCount(Math.min(stats.getRowCount(), topN.getLimit())); } + private Statistics computePartitionTopN(PartitionTopN partitionTopN) { + Statistics stats = groupExpression.childStatistics(0); + double rowCount = stats.getRowCount(); + List<Expression> partitionKeys = partitionTopN.getPartitionKeys(); + if (!partitionTopN.hasGlobalLimit() && !partitionKeys.isEmpty()) { Review Comment: Maybe it's hard to handle because for the `PartitionTopN` node, we do not get the column for the `rank`. So just add the TODO. -- 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