abstractdog commented on code in PR #5096: URL: https://github.com/apache/hive/pull/5096#discussion_r1515794350
########## 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: nit: does it make sense to extend the IncrementalRebuildMode enum with the return message for clarity? like: ``` AVAILABLE ("Available"), INSERT_ONLY("Available for insert operations only"), ... ``` -- 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