xiangfu0 commented on code in PR #19799: URL: https://github.com/apache/pinot/pull/19799#discussion_r4224958169
########## pinot-core/src/test/java/org/apache/pinot/core/startree/operator/StarTreeFilterOperatorTest.java: ########## @@ -0,0 +1,130 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.pinot.core.startree.operator; + +import it.unimi.dsi.fastutil.objects.ObjectBooleanPair; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.pinot.common.request.context.predicate.Predicate; +import org.apache.pinot.core.operator.filter.TestUtils; +import org.apache.pinot.core.operator.filter.predicate.PredicateEvaluator; +import org.apache.pinot.core.query.request.context.QueryContext; +import org.apache.pinot.core.startree.CompositePredicateEvaluator; +import org.apache.pinot.segment.spi.datasource.DataSource; +import org.apache.pinot.segment.spi.datasource.DataSourceMetadata; +import org.apache.pinot.segment.spi.index.reader.InvertedIndexReader; +import org.apache.pinot.segment.spi.index.reader.NullValueVectorReader; +import org.apache.pinot.segment.spi.index.startree.StarTree; +import org.apache.pinot.segment.spi.index.startree.StarTreeNode; +import org.apache.pinot.segment.spi.index.startree.StarTreeV2; +import org.apache.pinot.segment.spi.index.startree.StarTreeV2Metadata; +import org.roaringbitmap.buffer.MutableRoaringBitmap; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import static org.testng.Assert.assertEquals; + + +/// Tests star-tree document selection through the public filter result. Each invocation owns its fixture. +public class StarTreeFilterOperatorTest { + @DataProvider(name = "nullHandling") + public Object[][] nullHandling() { + return new Object[][]{{false}, {true}}; + } + + @Test(dataProvider = "nullHandling") + public void testRangesAndAggregatedDocsWithResidualPredicate(boolean nullHandlingEnabled) { + // Early leaves retain the dim1 predicate, while deeper dim1 nodes contribute aggregate document ids. + // Keep the range order deliberately unsorted, overlap two ranges, and cross the 16-bit container boundary. + StarTreeNode firstAggregate = leaf(1, 0, 20, 21, 0); Review Comment: Fixed in c9cedaa462: the first aggregate id is now the distinct non-zero value 50, with the expected membership lists and residual bitmap updated. Losing that stub now produces an unexpected 0 instead of silently matching the fixture. Both null-handling cases pass. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
