vrajat commented on code in PR #14110:
URL: https://github.com/apache/pinot/pull/14110#discussion_r1895703900


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/CursorIntegrationTest.java:
##########
@@ -0,0 +1,432 @@
+/**
+ * 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.integration.tests;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonNode;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import org.apache.pinot.common.exception.HttpErrorStatusException;
+import org.apache.pinot.common.response.CursorResponse;
+import org.apache.pinot.common.response.broker.CursorResponseNative;
+import org.apache.pinot.controller.cursors.ResponseStoreCleaner;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.utils.CommonConstants;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.util.TestUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+
+public class CursorIntegrationTest extends BaseClusterIntegrationTestSet {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(CursorIntegrationTest.class);
+  private static final int NUM_OFFLINE_SEGMENTS = 8;
+  private static final int COUNT_STAR_RESULT = 79003;
+  private static final String TEST_QUERY_ONE =
+      "SELECT SUM(CAST(CAST(ArrTime AS varchar) AS LONG)) FROM mytable WHERE 
DaysSinceEpoch <> 16312 AND Carrier = "
+          + "'DL'";
+  private static final String TEST_QUERY_TWO =
+      "SELECT CAST(CAST(ArrTime AS varchar) AS LONG) FROM mytable WHERE 
DaysSinceEpoch <> 16312 AND Carrier = 'DL' "
+          + "ORDER BY ArrTime DESC";
+  private static final String TEST_QUERY_THREE =
+      "SELECT ArrDelay, CarrierDelay, (ArrDelay - CarrierDelay) AS diff FROM 
mytable WHERE ArrDelay > CarrierDelay "
+          + "ORDER BY diff, ArrDelay, CarrierDelay LIMIT 100000";
+  private static final String EMPTY_RESULT_QUERY =
+      "SELECT SUM(CAST(CAST(ArrTime AS varchar) AS LONG)) FROM mytable WHERE 
DaysSinceEpoch <> 16312 AND 1 != 1";
+
+  private static int _resultSize;
+
+  @Override
+  protected void overrideControllerConf(Map<String, Object> properties) {
+    
properties.put(CommonConstants.CursorConfigs.RESPONSE_STORE_CLEANER_FREQUENCY_PERIOD,
 "5m");
+  }
+
+  @Override
+  protected void overrideBrokerConf(PinotConfiguration configuration) {
+    
configuration.setProperty(CommonConstants.CursorConfigs.PREFIX_OF_CONFIG_OF_RESPONSE_STORE
 + ".type", "memory");
+  }
+
+  protected long getCountStarResult() {
+    return COUNT_STAR_RESULT;
+  }
+
+  @BeforeClass
+  public void setUp()
+      throws Exception {
+    TestUtils.ensureDirectoriesExistAndEmpty(_tempDir, _segmentDir, _tarDir);
+
+    // Start Zk, Kafka and Pinot
+    startZk();
+    startController();
+    startBroker();
+    startServer();
+
+    List<File> avroFiles = getAllAvroFiles();
+    List<File> offlineAvroFiles = getOfflineAvroFiles(avroFiles, 
NUM_OFFLINE_SEGMENTS);
+
+    // Create and upload the schema and table config
+    Schema schema = createSchema();
+    getControllerRequestClient().addSchema(schema);
+    TableConfig offlineTableConfig = createOfflineTableConfig();
+    addTableConfig(offlineTableConfig);
+
+    // Create and upload segments
+    ClusterIntegrationTestUtils.buildSegmentsFromAvro(offlineAvroFiles, 
offlineTableConfig, schema, 0, _segmentDir,
+        _tarDir);
+    uploadSegments(getTableName(), _tarDir);
+
+    // Initialize the query generator
+    setUpQueryGenerator(avroFiles);
+
+    // Wait for all documents loaded
+    waitForAllDocsLoaded(100_000L);
+  }
+
+  protected String getBrokerGetAllQueryStoresApiUrl(String brokerBaseApiUrl) {

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

Reply via email to