You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "walterddr (via GitHub)" <gi...@apache.org> on 2023/11/01 00:46:56 UTC

Re: [PR] [draft][multistage] run PhysicalPlanVisitor on leaf for residual nodes [pinot]

walterddr commented on code in PR #11843:
URL: https://github.com/apache/pinot/pull/11843#discussion_r1378287815


##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/plan/server/ServerPlanRequestUtils.java:
##########
@@ -211,13 +261,21 @@ static void attachDynamicFilter(PinotQuery pinotQuery, JoinNode.JoinKeys joinKey
     List<Expression> expressions = new ArrayList<>();
     for (int i = 0; i < leftJoinKeys.size(); i++) {
       Expression leftExpr = pinotQuery.getSelectList().get(leftJoinKeys.get(i));
-      int rightIdx = rightJoinKeys.get(i);
-      Expression inFilterExpr = RequestUtils.getFunctionExpression(FilterKind.IN.name());
-      List<Expression> operands = new ArrayList<>(dataContainer.size() + 1);
-      operands.add(leftExpr);
-      operands.addAll(computeInOperands(dataContainer, dataSchema, rightIdx));
-      inFilterExpr.getFunctionCall().setOperands(operands);
-      expressions.add(inFilterExpr);
+      if (dataContainer.size() == 0) {
+        // put a constant false expression
+        Expression constantFalseExpr = RequestUtils.getFunctionExpression(FilterKind.CONSTANT.name());
+        constantFalseExpr.getFunctionCall().setOperands(Arrays.asList(leftExpr,
+            RequestUtils.getLiteralExpression(false)));
+        expressions.add(constantFalseExpr);

Review Comment:
   this is not actually the right way to go b/c this basically requires the query to be written in the format of
   ```
   SELECT ... WHERE CONSTANT(someCol, false)
   ```
   instead of the right way:
   ```
   SELECT ... WHERE CONSTANT(false)
   ```
   or
   ```
   SELECT ... WHERE false
   ```



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

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


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