xzj7019 commented on code in PR #49096: URL: https://github.com/apache/doris/pull/49096#discussion_r2055590700
########## fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/algebra/Aggregate.java: ########## @@ -106,4 +109,27 @@ default boolean isDistinct() { return getOutputExpressions().stream().allMatch(e -> e instanceof Slot) && getGroupByExpressions().stream().allMatch(e -> e instanceof Slot); } + + default boolean hasSkewHint() { + return getAggregateFunctions().stream().anyMatch(f -> f instanceof Count && ((Count) f).isSkew()); + } + + /**canSkewRewrite*/ + default boolean canSkewRewrite() { + ConnectContext connectContext = ConnectContext.get(); + int bucketNum = connectContext.getSessionVariable().aggDistinctSkewBucketNum; + if (bucketNum <= 0 || bucketNum >= 65536) { Review Comment: 65536 the value seems to be tested and dyn-tuned based on instance number in the future? -- 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