kasakrisz commented on code in PR #5096: URL: https://github.com/apache/hive/pull/5096#discussion_r1516366177
########## ql/src/java/org/apache/hadoop/hive/ql/ddl/view/materialized/show/ShowMaterializedViewsFormatter.java: ########## @@ -136,27 +135,19 @@ void showMaterializedViews(DataOutputStream out, List<Table> materializedViews) @NotNull private static String formatIncrementalRebuildMode(Table materializedView) { - String incrementalRebuild; HiveRelOptMaterialization relOptMaterialization = HiveMaterializedViewsRegistry.get(). - getRewritingMaterializedView(materializedView.getDbName(), materializedView.getTableName(), ALL); - if (relOptMaterialization == null || relOptMaterialization.getRebuildMode() == UNKNOWN) { - incrementalRebuild = "Unknown"; - } else { - switch (relOptMaterialization.getRebuildMode()) { - case AVAILABLE: - incrementalRebuild = "Available"; - break; - case INSERT_ONLY: - incrementalRebuild = "Available in presence of insert operations only"; - break; - case NOT_AVAILABLE: - incrementalRebuild = "Not available"; - break; - default: - incrementalRebuild = "Unknown"; - break; - } + getRewritingMaterializedView(materializedView.getDbName(), materializedView.getTableName(), ALL); + if (relOptMaterialization == null) { + return "Not available"; + } + switch (relOptMaterialization.getRebuildMode()) { + case AVAILABLE: + return "Available"; Review Comment: It is a good idea. I didn't do it earlier because I wanted to detach the formatter from the core logic but probably we'll use these messages in any other formatter and it can be changed anytime if it is needed. -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org