morningman commented on code in PR #12478:
URL: https://github.com/apache/doris/pull/12478#discussion_r1025907970


##########
fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java:
##########
@@ -232,7 +232,14 @@ private PlanNode createQueryPlan(QueryStmt stmt, Analyzer 
analyzer, long default
             throws UserException {
         long newDefaultOrderByLimit = defaultOrderByLimit;
         if (newDefaultOrderByLimit == -1) {
-            newDefaultOrderByLimit = 65535;
+            if (analyzer.getContext().getSessionVariable().defaultOrderByLimit 
<= -1) {
+                newDefaultOrderByLimit = Long.MAX_VALUE;
+                LOG.warn("The current default Order By Limit number is the 
maximum value of Long.");
+            } else {
+                newDefaultOrderByLimit = 
analyzer.getContext().getSessionVariable().defaultOrderByLimit;
+                LOG.warn("The current default Order By Limit number is {}." + 
newDefaultOrderByLimit);

Review Comment:
   remove warn log



##########
fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java:
##########
@@ -232,7 +232,14 @@ private PlanNode createQueryPlan(QueryStmt stmt, Analyzer 
analyzer, long default
             throws UserException {
         long newDefaultOrderByLimit = defaultOrderByLimit;
         if (newDefaultOrderByLimit == -1) {
-            newDefaultOrderByLimit = 65535;
+            if (analyzer.getContext().getSessionVariable().defaultOrderByLimit 
<= -1) {
+                newDefaultOrderByLimit = Long.MAX_VALUE;
+                LOG.warn("The current default Order By Limit number is the 
maximum value of Long.");
+            } else {
+                newDefaultOrderByLimit = 
analyzer.getContext().getSessionVariable().defaultOrderByLimit;

Review Comment:
   you can just call 
`analyzer.getContext().getSessionVariable().defaultOrderByLimit` once



##########
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java:
##########
@@ -230,6 +232,10 @@ public class SessionVariable implements Serializable, 
Writable {
     @VariableMgr.VarAttr(name = ENABLE_EXCHANGE_NODE_PARALLEL_MERGE)
     public boolean enableExchangeNodeParallelMerge = false;
 
+    // Default Order By Limit
+    @VariableMgr.VarAttr(name = DEFAULT_ORDER_BY_LIMIT)
+    public long defaultOrderByLimit = -1;

Review Comment:
   add document



##########
fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java:
##########
@@ -232,7 +232,14 @@ private PlanNode createQueryPlan(QueryStmt stmt, Analyzer 
analyzer, long default
             throws UserException {
         long newDefaultOrderByLimit = defaultOrderByLimit;
         if (newDefaultOrderByLimit == -1) {
-            newDefaultOrderByLimit = 65535;
+            if (analyzer.getContext().getSessionVariable().defaultOrderByLimit 
<= -1) {
+                newDefaultOrderByLimit = Long.MAX_VALUE;
+                LOG.warn("The current default Order By Limit number is the 
maximum value of Long.");

Review Comment:
   remove the warn log



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

Reply via email to