kasakrisz commented on code in PR #4951:
URL: https://github.com/apache/hive/pull/4951#discussion_r1434244790


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/view/materialized/alter/rewrite/AlterMaterializedViewRewriteOperation.java:
##########
@@ -64,9 +68,12 @@ public int execute() throws HiveException {
           }
           throw new HiveException(msg);
         }
-        if (!planner.isValidAutomaticRewritingMaterialization()) {
-          throw new HiveException("Cannot enable rewriting for materialized 
view. " +
-              planner.getInvalidAutomaticRewritingMaterializationReason());
+        AutomaticRewritingValidationResult validationResult = 
planner.getAutomaticRewritingValidationResult();
+        String validationErrorMessage = validationResult.getErrorMessage();
+        if (validationResult.getSupportedRewriteAlgorithms().isEmpty()) {
+          throw new HiveException(validationErrorMessage);

Review Comment:
   Changed that create mv not just log the error but also disables rewrite for 
MV.



##########
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestMaterializedViewsCache.java:
##########
@@ -157,7 +157,7 @@ private Table getTable(String db, String tableName, String 
definition) {
   private static HiveRelOptMaterialization createMaterialization(Table table) 
throws ParseException {
     return new HiveRelOptMaterialization(
             new DummyRel(table), new DummyRel(table), null, 
asList(table.getDbName(), table.getTableName()),
-            EnumSet.allOf(HiveRelOptMaterialization.RewriteAlgorithm.class),
+            EnumSet.allOf(RewriteAlgorithm.class),

Review Comment:
   done



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