npawar commented on code in PR #9506:
URL: https://github.com/apache/pinot/pull/9506#discussion_r984850017
##########
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:
actually realized that we can just get tableType directly from config, no
extraction needed. updated
--
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]