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: [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]