Intersect
Describes the intersect relation operator in the multi-stage query engine.
Implementation details
Blocking nature
HashSet<Row> rightRows = new HashSet<>();
Block rightBlock = rightInput.nextBlock();
while (rightBlock is not EOS) {
rightRows.addAll(rightBlock.getRows());
rightBlock = rightInput.nextBlock();
}
Block leftBlock = leftInput.nextBlock();
while (leftBlock is not EOS) {
Block partialResultBlock = new Block();
for (Row row : leftBlock.getRows()) {
if (rightRows.remove(row)) {
partialResultBlock.add(row);
}
}
emit partialResultBlock;
leftBlock = leftInput.nextBlock();
}
emit EOSHints
Stats
executionTimeMs
emittedRows
Explain attributes
all
Tips and tricks
The order of input relations matter
Was this helpful?

