You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ro...@apache.org on 2023/11/14 18:46:33 UTC

(pinot) branch master updated: [multistage][bugfix] leaf limit refactor issue (#12001)

This is an automated email from the ASF dual-hosted git repository.

rongr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 7217bb9d16 [multistage][bugfix] leaf limit refactor issue (#12001)
7217bb9d16 is described below

commit 7217bb9d16b60074c1e9a9df72984556a7c8dbd5
Author: Rong Rong <ro...@apache.org>
AuthorDate: Tue Nov 14 10:46:27 2023 -0800

    [multistage][bugfix] leaf limit refactor issue (#12001)
    
    * [hotfix] leaf limit refactor - fix default value setting issue
    
    ---------
    
    Co-authored-by: Rong Rong <ro...@startree.ai>
    Co-authored-by: Xiaotian (Jackie) Jiang <17...@users.noreply.github.com>
---
 .../runtime/plan/server/ServerPlanRequestUtils.java   | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/server/ServerPlanRequestUtils.java b/pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/server/ServerPlanRequestUtils.java
index b2ead5a041..832b2a4666 100644
--- a/pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/server/ServerPlanRequestUtils.java
+++ b/pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/server/ServerPlanRequestUtils.java
@@ -95,7 +95,7 @@ public class ServerPlanRequestUtils {
     ServerPlanRequestContext serverContext = new ServerPlanRequestContext(distributedStagePlan, leafQueryExecutor,
         executorService, executionContext.getPipelineBreakerResult());
     // 1. compile the PinotQuery
-    constructPinotQueryPlan(serverContext);
+    constructPinotQueryPlan(serverContext, executionContext.getOpChainMetadata());
     // 2. convert PinotQuery into InstanceRequest list (one for each physical table)
     List<InstanceRequest> instanceRequestList =
         ServerPlanRequestUtils.constructServerQueryRequests(executionContext, serverContext, distributedStagePlan,
@@ -115,10 +115,18 @@ public class ServerPlanRequestUtils {
    * It constructs the content for {@link ServerPlanRequestContext#getPinotQuery()} and set the boundary via:
    *   {@link ServerPlanRequestContext#setLeafStageBoundaryNode(PlanNode)}.
    */
-  private static void constructPinotQueryPlan(ServerPlanRequestContext serverContext) {
+  private static void constructPinotQueryPlan(ServerPlanRequestContext serverContext,
+      Map<String, String> requestMetadata) {
     DistributedStagePlan stagePlan = serverContext.getStagePlan();
     PinotQuery pinotQuery = serverContext.getPinotQuery();
     pinotQuery.setExplain(false);
+    // attach leaf node limit it not set
+    Integer leafNodeLimit = QueryOptionsUtils.getMultiStageLeafLimit(requestMetadata);
+    if (leafNodeLimit != null) {
+      pinotQuery.setLimit(leafNodeLimit);
+    } else {
+      pinotQuery.setLimit(DEFAULT_LEAF_NODE_LIMIT);
+    }
     // visit the plan and create PinotQuery and determine the leaf stage boundary PlanNode.
     ServerPlanRequestVisitor.walkStageNode(stagePlan.getStageRoot(), serverContext);
   }
@@ -177,13 +185,6 @@ public class ServerPlanRequestUtils {
         (executionContext.getRequestId() << 16) + ((long) stageId << 8) + (tableType == TableType.REALTIME ? 1 : 0);
     // 1. make a deep copy of the pinotQuery and modify the PinotQuery accordingly
     PinotQuery pinotQuery = new PinotQuery(serverContext.getPinotQuery());
-    //  - attach leaf node limit
-    Integer leafNodeLimit = QueryOptionsUtils.getMultiStageLeafLimit(executionContext.getOpChainMetadata());
-    if (leafNodeLimit != null) {
-      pinotQuery.setLimit(leafNodeLimit);
-    } else {
-      pinotQuery.setLimit(DEFAULT_LEAF_NODE_LIMIT);
-    }
     //   - attach table type
     DataSource dataSource = pinotQuery.getDataSource();
     String rawTableName = dataSource.getTableName();


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