You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "sohardforaname (via GitHub)" <gi...@apache.org> on 2023/06/21 06:26:47 UTC

[GitHub] [doris] sohardforaname opened a new pull request, #21068: [Enhancement](planner)support sql_select_limit for 1.2

sohardforaname opened a new pull request, #21068:
URL: https://github.com/apache/doris/pull/21068

   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #21068: [Enhancement](planner)support sql_select_limit for 1.2

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21068:
URL: https://github.com/apache/doris/pull/21068#issuecomment-1600471019

   PR approved by at least one committer and no changes requested.


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #21068: [Enhancement](planner)support sql_select_limit for 1.2

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21068:
URL: https://github.com/apache/doris/pull/21068#issuecomment-1600471240

   PR approved by anyone and no changes requested.


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morrySnow commented on a diff in pull request #21068: [Enhancement](planner)support sql_select_limit for 1.2

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on code in PR #21068:
URL: https://github.com/apache/doris/pull/21068#discussion_r1236656944


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/QueryStmt.java:
##########
@@ -27,6 +27,7 @@
 import org.apache.doris.common.ErrorReport;
 import org.apache.doris.common.UserException;
 import org.apache.doris.common.util.VectorizedUtil;
+import org.apache.doris.qe.ConnectContext;

Review Comment:
   remove this



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morrySnow commented on a diff in pull request #21068: [Enhancement](planner)support sql_select_limit for 1.2

Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on code in PR #21068:
URL: https://github.com/apache/doris/pull/21068#discussion_r1236565281


##########
fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java:
##########
@@ -282,6 +282,8 @@ private PlanNode createQueryPlan(QueryStmt stmt, Analyzer analyzer, long default
             }
         }
 
+        long sqlSelectLimit = analyzer.getContext().getSessionVariable().sqlSelectLimit;

Review Comment:
   createQueryPlan is called recursively, should make sqlSelectLimit as a parameter of this function just like defaultOrderByLimit



##########
fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java:
##########
@@ -295,7 +297,8 @@ private PlanNode createQueryPlan(QueryStmt stmt, Analyzer analyzer, long default
             ((SortNode) root).setDefaultLimit(limit == -1);
             ((SortNode) root).setOffset(stmt.getOffset());
             if (useTopN) {
-                root.setLimit(limit != -1 ? limit : newDefaultOrderByLimit);
+                // if limit != -1, it means limit clause exists, we get the minimum.
+                root.setLimit(limit != -1 ? limit : Math.min(newDefaultOrderByLimit, sqlSelectLimit));

Review Comment:
   sqlSelectLimit could small than 0, in this case, sqlSelectLimit should not be set to limit



-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei merged pull request #21068: [Enhancement](planner)support sql_select_limit for 1.2

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #21068:
URL: https://github.com/apache/doris/pull/21068


-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org