gortiz commented on code in PR #13591:
URL: https://github.com/apache/pinot/pull/13591#discussion_r1677961002
##########
pinot-query-runtime/src/main/java/org/apache/pinot/query/runtime/operator/FilterOperator.java:
##########
@@ -96,20 +96,21 @@ public String toExplainString() {
@Override
protected TransferableBlock getNextBlock() {
TransferableBlock block = _input.nextBlock();
- if (block.isEndOfStreamBlock()) {
- if (block.isErrorBlock()) {
- return block;
- }
+ if (block.isErrorBlock()) {
+ return block;
+ }
+ if (block.isSuccessfulEndOfStreamBlock()) {
return updateEosBlock(block, _statMap);
}
- List<Object[]> resultRows = new ArrayList<>();
+ assert block.isDataBlock();
+ List<Object[]> rows = new ArrayList<>();
for (Object[] row : block.getContainer()) {
Object filterResult = _filterOperand.apply(row);
if (BooleanUtils.isTrueInternalValue(filterResult)) {
- resultRows.add(row);
+ rows.add(row);
}
}
- return new TransferableBlock(resultRows, _dataSchema, DataBlock.Type.ROW);
+ return rows.isEmpty() ? getNextBlock() : new TransferableBlock(rows,
_dataSchema, DataBlock.Type.ROW);
Review Comment:
This may be a bit difficult to read, but I guess the idea is that next block
will always be a EOS, right?
--
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]