DarvenDuan commented on code in PR #33630:
URL: https://github.com/apache/doris/pull/33630#discussion_r1565545630


##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -1426,21 +1426,24 @@ private void analyzeAndGenerateQueryPlan(TQueryOptions 
tQueryOptions) throws Use
                 reAnalyze = true;
             }
             if (parsedStmt instanceof SelectStmt) {
-                if (StmtRewriter.rewriteByPolicy(parsedStmt, analyzer)) {
+                if (StmtRewriter.rewriteByPolicy(parsedStmt, analyzer)
+                        || 
StmtRewriter.rewriteForRandomDistribution(parsedStmt, analyzer)) {
                     reAnalyze = true;
                 }
             }
             if (parsedStmt instanceof SetOperationStmt) {
                 List<SetOperationStmt.SetOperand> operands = 
((SetOperationStmt) parsedStmt).getOperands();
                 for (SetOperationStmt.SetOperand operand : operands) {
-                    if (StmtRewriter.rewriteByPolicy(operand.getQueryStmt(), 
analyzer)) {
+                    if (StmtRewriter.rewriteByPolicy(operand.getQueryStmt(), 
analyzer)
+                            || 
StmtRewriter.rewriteForRandomDistribution(operand.getQueryStmt(), analyzer)) {
                         reAnalyze = true;
                     }
                 }
             }
             if (parsedStmt instanceof InsertStmt) {
                 QueryStmt queryStmt = ((InsertStmt) parsedStmt).getQueryStmt();
-                if (queryStmt != null && 
StmtRewriter.rewriteByPolicy(queryStmt, analyzer)) {
+                if (queryStmt != null && 
StmtRewriter.rewriteByPolicy(queryStmt, analyzer)
+                        || 
StmtRewriter.rewriteForRandomDistribution(queryStmt, analyzer)) {

Review Comment:
   fixed



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