Jackie-Jiang commented on a change in pull request #4451: Enable 
SegmentCompleteionIntegrationTest
URL: https://github.com/apache/incubator-pinot/pull/4451#discussion_r305549203
 
 

 ##########
 File path: 
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BaseClusterIntegrationTest.java
 ##########
 @@ -398,4 +403,38 @@ protected void testSqlQuery(@Nonnull String sqlQuery, 
@Nullable List<String> sql
     ClusterIntegrationTestUtils
         .testQuery(sqlQuery, "sql", _brokerBaseApiUrl, getPinotConnection(), 
sqlQueries, getH2Connection());
   }
+
+  protected void setUpRealtimeTable(File avroFile)
+      throws Exception {
+    File schemaFile = getSchemaFile();
+    Schema schema = Schema.fromFile(schemaFile);
+    String schemaName = schema.getSchemaName();
+    addSchema(schemaFile, schemaName);
+
+    String timeColumnName = schema.getTimeColumnName();
+    Assert.assertNotNull(timeColumnName);
+    TimeUnit outgoingTimeUnit = schema.getOutgoingTimeUnit();
+    Assert.assertNotNull(outgoingTimeUnit);
+    String timeType = outgoingTimeUnit.toString();
+
+    addRealtimeTable(getTableName(), useLlc(), 
KafkaStarterUtils.DEFAULT_KAFKA_BROKER, KafkaStarterUtils.DEFAULT_ZK_STR,
+        getKafkaTopic(), getRealtimeSegmentFlushSize(), avroFile, 
timeColumnName, timeType, schemaName,
+        getBrokerTenant(), getServerTenant(), getLoadMode(), getSortedColumn(),
+        getInvertedIndexColumns(), getBloomFilterIndexColumns(), 
getRawIndexColumns(), getTaskConfig(),
+        getStreamConsumerFactoryClassName());
+
+    completeTableConfiguration();
+  }
+
+  protected void completeTableConfiguration() {
+    if (isUsingNewConfigFormat()) {
+      CombinedConfig combinedConfig = new CombinedConfig(_offlineTableConfig, 
_realtimeTableConfig, _schema);
+      try {
+        sendPostRequest(_controllerRequestURLBuilder.forNewTableCreate(), 
Serializer.serializeToString(combinedConfig));
+      } catch (IOException e) {
+        throw new RuntimeException(e);
 
 Review comment:
   Allow method to throw Exception?

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