Vladsz83 commented on code in PR #10117:
URL: https://github.com/apache/ignite/pull/10117#discussion_r916760136


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/IndexScan.java:
##########
@@ -159,6 +162,47 @@ public IndexScan(
         }
     }
 
+    /**
+     * Gets first or last records from all segments.
+     *
+     * @param notNull If {@code true}, null values is skipped.
+     */
+    public List<Row> firstOrLast(boolean first, boolean notNull) {
+        reserve();
+
+        IndexingQueryFilter filter = new IndexingQueryFilterImpl(kctx, topVer, 
parts);
+        BPlusTree.TreeRowClosure<IndexRow, IndexRow> rowFilter = notNull ?
+            new BPlusTree.TreeRowClosure<IndexRow, IndexRow>() {
+                /** {@inheritDoc} */
+                @Override public boolean apply(BPlusTree<IndexRow, IndexRow> 
tree, BPlusIO<IndexRow> io, long pageAddr,
+                    int idx) throws IgniteCheckedException {
+                    return 
!F.isEmptyOrNulls(indexRow2Row(io.getLookupRow(tree, pageAddr, idx)));

Review Comment:
   Fixed



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to