alex-plekhanov commented on code in PR #10390:
URL: https://github.com/apache/ignite/pull/10390#discussion_r1042547952


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/CacheIndexImpl.java:
##########
@@ -153,9 +158,43 @@ public Index queryIndex() {
 
             InlineIndex iidx = idx.unwrap(InlineIndex.class);
 
+            BPlusTree.TreeRowClosure<IndexRow, IndexRow> rowFilter = null;
+
+            if (notNull) {
+                boolean nullsFirst = 
collation.getFieldCollations().get(0).nullDirection ==
+                    RelFieldCollation.NullDirection.FIRST;
+
+                BPlusTree.TreeRowClosure<IndexRow, IndexRow> notNullRowFilter 
= IndexScan.createNotNullRowFilter(iidx);
+
+                AtomicBoolean skipCheck = new AtomicBoolean();
+
+                rowFilter = new BPlusTree.TreeRowClosure<IndexRow, IndexRow>() 
{
+                    @Override public boolean apply(
+                        BPlusTree<IndexRow, IndexRow> tree,
+                        BPlusIO<IndexRow> io,
+                        long pageAddr,
+                        int idx
+                    ) throws IgniteCheckedException {
+                        // If we have NULLS-FIRST collation, all values after 
first not-null value will be not-null,
+                        // don't need to check it with notNullRowFilter.

Review Comment:
   Actually it tested in testCountIndexedField (some fields have NULL value), 
but I've added yet another test with NULL and two indexed columns. 



-- 
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]

Reply via email to