zstan commented on code in PR #13311:
URL: https://github.com/apache/ignite/pull/13311#discussion_r3722076036
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/LimitNode.java:
##########
@@ -17,66 +17,79 @@
package org.apache.ignite.internal.processors.query.calcite.exec.rel;
-import java.util.function.Supplier;
import org.apache.calcite.rel.type.RelDataType;
import
org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext;
+import org.apache.ignite.internal.processors.query.calcite.util.IgniteMath;
import org.apache.ignite.internal.util.typedef.F;
-import org.jetbrains.annotations.Nullable;
/** Offset, fetch|limit support node. */
public class LimitNode<Row> extends AbstractNode<Row> implements
SingleNode<Row>, Downstream<Row> {
- /** Offset if its present, otherwise 0. */
- private final int offset;
+ /** */
+ public static final long FETCH_DEFAULT = -1;
- /** Fetch if its present, otherwise 0. */
- private final int fetch;
+ /** */
+ public static final long OFFSET_DEFAULT = 0;
- /** Already processed (pushed to upstream) rows count. */
- private int rowsProcessed;
+ /** Offset param. */
+ private final long offset;
- /** Fetch can be unset, in this case we need all rows. */
- private @Nullable Supplier<Integer> fetchNode;
+ /** How many rows need to be processed, if {@code 0} it depends on {@link
#rowsSummary}. */
+ private final long fetch;
+
+ /** Summary rows to process. */
+ private final long rowsSummary;
+
+ /** Already processed (pushed to downstream) rows count. */
+ private long rowsProcessed;
/** Waiting results counter. */
private int waiting;
+ /** Upper requested rows. */
+ private int requested;
+
/**
* Constructor.
*
* @param ctx Execution context.
* @param rowType Row type.
+ * @param offset How many rows need to be skipped.
+ * @param fetch How many rows need to be processed, {@code -1} if param is
undefined.
Review Comment:
done
--
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]