fx19880617 commented on a change in pull request #5163: Optimization for 
selection only queries: Allow early termination
URL: https://github.com/apache/incubator-pinot/pull/5163#discussion_r394121884
 
 

 ##########
 File path: 
pinot-core/src/test/java/org/apache/pinot/queries/SelectionOnlyEarlyTerminationTest.java
 ##########
 @@ -0,0 +1,71 @@
+/**
+ * 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.queries;
+
+import java.io.IOException;
+import org.apache.pinot.common.response.broker.BrokerResponseNative;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+
+/**
+ * Tests selection only queries
+ */
+public class SelectionOnlyEarlyTerminationTest extends 
BaseSingleValueQueriesTest {
+  private int numSegmentDataManagers = Math.max(1, Math.min(10, 
Runtime.getRuntime().availableProcessors() / 2)) * 2;
+
+  protected int getNumSegmentDataManagers() {
+    return numSegmentDataManagers;
+  }
+
+  /**
+   * With early termination, Selection Only query is scheduled with 
${numSegmentDataManagers} threads,
+   * total segment processed is same at num threads.
+   */
+  @Test
+  public void testSelectOnlyQuery() {
+    String query = "SELECT column1, column6 FROM testTable";
+    BrokerResponseNative brokerResponse = getBrokerResponseForPqlQuery(query);
+    Assert.assertNotNull(brokerResponse.getSelectionResults());
+    Assert.assertNull(brokerResponse.getResultTable());
+    Assert.assertTrue(brokerResponse.getNumSegmentsMatched() == 
numSegmentDataManagers);
 
 Review comment:
   I think  this is because that we skipped the rest blocks to merge which 
don't have those information to be collected.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to