morrySnow commented on code in PR #31332:
URL: https://github.com/apache/doris/pull/31332#discussion_r1505630330


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java:
##########
@@ -957,7 +957,11 @@ private Statistics computeIntersect(SetOperation 
setOperation) {
 
     private Statistics computeGenerate(Generate generate) {
         Statistics stats = groupExpression.childStatistics(0);
-        double count = stats.getRowCount() * 
generate.getGeneratorOutput().size() * 5;
+        int statsFactor = 
ConnectContext.get().getSessionVariable().generateStatsFactor;

Review Comment:
   u could set value checker to session variable in its annotation to ensure it 
is valid. refer to session variable `queryTimeoutS`



##########
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java:
##########
@@ -738,6 +740,9 @@ public class SessionVariable implements Serializable, 
Writable {
     @VariableMgr.VarAttr(name = ENABLE_BUCKET_SHUFFLE_DOWNGRADE, needForward = 
true)
     public boolean enableBucketShuffleDownGrade = false;
 
+    @VariableMgr.VarAttr(name = GENERATE_STATS_FACTOR, needForward = true)
+    public int generateStatsFactor = 5;

Review Comment:
   add description to it



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

Reply via email to