xiangfu0 commented on code in PR #20459:
URL: https://github.com/apache/pinot/pull/20459#discussion_r4805772944


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseSingleStageBrokerRequestHandler.java:
##########
@@ -1736,6 +1737,8 @@ private void handleSubquery(Expression expression, long 
requestId, JsonNode json
         throw new 
QueryException(QueryErrorCode.fromErrorCode(exception.getErrorCode()),
             "Caught exception while executing subquery: " + subquery + ": " + 
exception.getMessage());
       }
+      // Recursive requests share the context, so nested scans and their 
lookups accumulate independently.
+      requestContext.addCursorSubqueryTables(response.getTablesQueried());

Review Comment:
   The multi-stage handler also runs IdSet subqueries as separate requests 
(`MultiStageBrokerRequestHandler.runIdSetSubquery`), each with a fresh 
`DefaultRequestContext`, so their tables never reach 
`getCursorSubqueryTables()` on the outer context and aren't part of the stored 
cursor's table scope. Should that path record them as well, so a cursor has the 
same scope on both engines?



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