kasakrisz commented on a change in pull request #2401:
URL: https://github.com/apache/hive/pull/2401#discussion_r657889399



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/view/materialized/alter/rebuild/AlterMaterializedViewRebuildAnalyzer.java
##########
@@ -353,6 +375,23 @@ private RelNode toJoinInsertIncremental(
               basePlan, mdProvider, executorProvider, 
HiveJoinInsertIncrementalRewritingRule.INSTANCE);
     }
 
+    private RelNode toPartitionInsertOverwrite(
+            RelNode basePlan, RelMetadataProvider mdProvider, RexExecutor 
executorProvider,
+            HiveRelOptMaterialization materialization, RelNode 
calcitePreMVRewritingPlan) {
+
+      if (materialization.isSourceTablesUpdateDeleteModified()) {
+        return calcitePreMVRewritingPlan;
+      }
+
+      RelOptHiveTable hiveTable = (RelOptHiveTable) 
materialization.tableRel.getTable();
+      if (!AcidUtils.isInsertOnlyTable(hiveTable.getHiveTableMD())) {
+        return applyPreJoinOrderingTransforms(basePlan, mdProvider, 
executorProvider);
+      }
+
+      return toIncrementalRebuild(
+              basePlan, mdProvider, executorProvider, 
HiveAggregatePartitionIncrementalRewritingRule.INSTANCE);

Review comment:
       I experienced that currently we can handle non-aggregate cases by the 
record level incremental join rules. If those are not applicable we don not 
even have a union based plan to transform further to an incremental one.
   
   However I'm happy to include the non-aggregate variant if a use case is 
found.




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

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