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 2022/09/30 18:09:34 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #9506: Fix AddTable for realtime tables

walterddr commented on code in PR #9506:
URL: https://github.com/apache/pinot/pull/9506#discussion_r984838591


##########
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/AddTableCommand.java:
##########
@@ -184,14 +207,38 @@ public boolean execute()
 
     LOGGER.info("Executing command: " + toString());
 
-    TableConfig tableConfig = attempt(() -> JsonUtils.fileToObject(new File(_tableConfigFile), TableConfig.class),
-        "Failed reading table config " + _tableConfigFile);
+    String rawTableName = null;
+    TableConfig offlineTableConfig = null;
+    TableConfig realtimeTableConfig = null;
+    if (_tableConfigFile != null) {
+      TableConfig tableConfig = attempt(() -> JsonUtils.fileToObject(new File(_tableConfigFile), TableConfig.class),
+          "Failed reading table config " + _tableConfigFile);
+      rawTableName = TableNameBuilder.extractRawTableName(tableConfig.getTableName());
+      TableType tableType = TableNameBuilder.getTableTypeFromTableName(tableConfig.getTableName());
+      if (tableType == TableType.OFFLINE) {
+        offlineTableConfig = tableConfig;
+      } else {
+        realtimeTableConfig = tableConfig;
+      }

Review Comment:
   so the table is default to REALTIME if no type is extracted out?



-- 
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: commits-unsubscribe@pinot.apache.org

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