You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/08/15 03:20:25 UTC

[GitHub] [incubator-pinot] icefury71 opened a new pull request #5870: Adding integration test for null handling from realtime source

icefury71 opened a new pull request #5870:
URL: https://github.com/apache/incubator-pinot/pull/5870


   ## Description
   Adding an end-end integration test for creating a Pinot table with Kafka records including null values and running queries against this table (with the IS NOT NULL predicate). Related to #4230
   
   ## Upgrade Notes
   Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
   No
   
   Does this PR fix a zero-downtime upgrade introduced earlier?
   No
   
   Does this PR otherwise need attention when creating release notes?
   No
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] Jackie-Jiang merged pull request #5870: Adding integration test for null handling from realtime source

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang merged pull request #5870:
URL: https://github.com/apache/incubator-pinot/pull/5870


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #5870: Adding integration test for null handling from realtime source

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #5870:
URL: https://github.com/apache/incubator-pinot/pull/5870#discussion_r471653282



##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTest.java
##########
@@ -241,6 +242,10 @@ protected IngestionConfig getIngestionConfig() {
     return null;
   }
 
+  protected boolean getNullHandlingEnabledConfig() {

Review comment:
       (nit) 
   ```suggestion
     protected boolean getNullHandlingEnabled() {
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #5870: Adding integration test for null handling from realtime source

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #5870:
URL: https://github.com/apache/incubator-pinot/pull/5870#discussion_r471074067



##########
File path: pinot-spi/src/main/java/org/apache/pinot/spi/utils/builder/TableConfigBuilder.java
##########
@@ -255,6 +256,11 @@ public TableConfigBuilder setSegmentPartitionConfig(SegmentPartitionConfig segme
     return this;
   }
 
+  public TableConfigBuilder setNullHandlingEnabledConfig(boolean nullHandlingEnabled) {

Review comment:
       ```suggestion
     public TableConfigBuilder setNullHandlingEnabled(boolean nullHandlingEnabled) {
   ```

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/NullHandlingIntegrationTest.java
##########
@@ -0,0 +1,149 @@
+/**
+ * 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 org.apache.commons.io.FileUtils;
+import org.apache.pinot.util.TestUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+
+
+/**
+ * Integration test that creates a Kafka broker, creates a Pinot cluster that consumes from Kafka and queries Pinot.
+ * The data pushed to Kafka includes null values.
+ */
+public class NullHandlingIntegrationTest extends BaseClusterIntegrationTestSet {
+
+  @BeforeClass
+  public void setUp()
+      throws Exception {
+    TestUtils.ensureDirectoriesExistAndEmpty(_tempDir);
+
+    // Start the Pinot cluster
+    startZk();
+    startController();
+    startBroker();
+    startServer();
+
+    // Start Kafka
+    startKafka();
+
+    // Unpack the Avro files
+    List<File> avroFiles = unpackAvroData(_tempDir);
+
+    // Create and upload the schema and table config
+    addSchema(createSchema());
+    addTableConfig(createRealtimeTableConfig(avroFiles.get(0)));
+
+    // Push data into Kafka
+    pushAvroIntoKafka(avroFiles);
+
+    // Set up the H2 connection
+    setUpH2Connection(avroFiles);
+
+    // Initialize the query generator
+    setUpQueryGenerator(avroFiles);
+
+    // Wait for all documents loaded
+    waitForAllDocsLoaded(10_000L);
+  }
+
+  @Override
+  protected String getAvroTarFileName() {
+    return "avro_data_with_nulls.tar.gz";
+  }
+
+  @Override
+  protected String getSchemaFileName() {
+    return "test_null_handling.schema";
+  }
+
+  @Override
+  @Nullable
+  protected String getSortedColumn() {
+    return null;
+  }
+
+  @Override
+  @Nullable
+  protected List<String> getInvertedIndexColumns() {
+    return null;
+  }
+
+  @Override
+  @Nullable
+  protected List<String> getNoDictionaryColumns() {
+    return null;
+  }
+
+  @Override
+  @Nullable
+  protected List<String> getRangeIndexColumns() {
+    return null;
+  }
+
+  @Override
+  @Nullable
+  protected List<String> getBloomFilterColumns() {
+    return null;
+  }
+
+  @Override
+  @Nullable
+  protected boolean getNullHandlingEnabledConfig() {
+    return true;
+  }
+
+  @Override
+  protected long getCountStarResult() {
+    return 100;
+  }
+
+  @Test
+  public void testTotalCount()
+      throws Exception {
+    String pqlQuery = "SELECT count(*) FROM " + getTableName();
+    String sqlQuery = "SELECT count(*) FROM " + getTableName();

Review comment:
       (nit) Simplify into the same string?
   ```suggestion
       String query = "SELECT count(*) FROM " + getTableName();
   ```

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTest.java
##########
@@ -241,6 +242,11 @@ protected IngestionConfig getIngestionConfig() {
     return null;
   }
 
+  @Nullable

Review comment:
       Remove this annotation

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/NullHandlingIntegrationTest.java
##########
@@ -0,0 +1,149 @@
+/**
+ * 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 org.apache.commons.io.FileUtils;
+import org.apache.pinot.util.TestUtils;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import javax.annotation.Nullable;
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Random;
+
+
+/**
+ * Integration test that creates a Kafka broker, creates a Pinot cluster that consumes from Kafka and queries Pinot.
+ * The data pushed to Kafka includes null values.
+ */
+public class NullHandlingIntegrationTest extends BaseClusterIntegrationTestSet {
+
+  @BeforeClass
+  public void setUp()
+      throws Exception {
+    TestUtils.ensureDirectoriesExistAndEmpty(_tempDir);
+
+    // Start the Pinot cluster
+    startZk();
+    startController();
+    startBroker();
+    startServer();
+
+    // Start Kafka
+    startKafka();
+
+    // Unpack the Avro files
+    List<File> avroFiles = unpackAvroData(_tempDir);
+
+    // Create and upload the schema and table config
+    addSchema(createSchema());
+    addTableConfig(createRealtimeTableConfig(avroFiles.get(0)));
+
+    // Push data into Kafka
+    pushAvroIntoKafka(avroFiles);
+
+    // Set up the H2 connection
+    setUpH2Connection(avroFiles);
+
+    // Initialize the query generator
+    setUpQueryGenerator(avroFiles);
+
+    // Wait for all documents loaded
+    waitForAllDocsLoaded(10_000L);
+  }
+
+  @Override
+  protected String getAvroTarFileName() {
+    return "avro_data_with_nulls.tar.gz";
+  }
+
+  @Override
+  protected String getSchemaFileName() {
+    return "test_null_handling.schema";
+  }
+
+  @Override
+  @Nullable
+  protected String getSortedColumn() {
+    return null;
+  }
+
+  @Override
+  @Nullable
+  protected List<String> getInvertedIndexColumns() {
+    return null;
+  }
+
+  @Override
+  @Nullable
+  protected List<String> getNoDictionaryColumns() {
+    return null;
+  }
+
+  @Override
+  @Nullable
+  protected List<String> getRangeIndexColumns() {
+    return null;
+  }
+
+  @Override
+  @Nullable
+  protected List<String> getBloomFilterColumns() {
+    return null;
+  }
+
+  @Override
+  @Nullable

Review comment:
       Remove this annotation




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org