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: [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]