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


##########
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:
   should we enforce this and throw if table type is unknown?



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