vldpyatkov commented on code in PR #13359:
URL: https://github.com/apache/ignite/pull/13359#discussion_r4045788963
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/BufferingWindowNode.java:
##########
@@ -50,39 +55,39 @@ public class WindowNode<Row> extends
MemoryTrackingNode<Row> implements SingleNo
/** */
private Row prevRow;
- /** */
- private final Deque<Row> outBuf = new ArrayDeque<>(IN_BUFFER_SIZE);
-
/** */
private boolean inLoop;
/** */
- public WindowNode(
+ public BufferingWindowNode(
ExecutionContext<Row> ctx,
RelDataType rowType,
Comparator<Row> partCmp,
- Supplier<WindowPartition<Row>> partFactory,
+ BufferingWindowPartition<Row> part,
RowHandler.RowFactory<Row> rowFactory
) {
- super(ctx, rowType, DFLT_ROW_OVERHEAD);
+ super(ctx, rowType);
this.partCmp = partCmp;
- this.partFactory = partFactory;
+ this.part = part;
this.rowFactory = rowFactory;
}
/** {@inheritDoc} */
@Override public void request(int rowsCnt) throws Exception {
assert !F.isEmpty(sources()) && sources().size() == 1;
- assert rowsCnt > 0;
+ assert rowsCnt > 0 && requested == 0;
checkState();
requested = rowsCnt;
- if (waiting == 0 && outBuf.isEmpty())
+ if (inLoop)
+ return;
+
+ if (part.ready() > 0)
Review Comment:
The 'waiting < 0' case is missing. We still need to call 'flush()' to signal
the end of the stream; otherwise, the consumer may hang.
--
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]