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


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/view/materialized/alter/rebuild/AlterMaterializedViewRebuildAnalyzer.java:
##########
@@ -636,7 +647,17 @@ private void fixUpASTAggregateIncrementalRebuild(
     // We bypass the OR clause and select the first disjunct for the Update 
branch
     ParseDriver.adaptor.setChild(whereClauseInUpdate, 0, 
disjuncts.get(Context.DestClausePrefix.UPDATE));
     ASTNode updateDeleteNode = (ASTNode) 
ParseDriver.adaptor.dupTree(updateInsertNode);
-    // 4.2) Adding acid sort columns (ROW__ID in case of native acid query 
StorageHandler otherwise)
+    // 4.2) The rows of the groups which became empty are deleted by the same 
branch as the old version of the
+    // updated rows, so that all deletes of a data file reach the same DV 
writer
+    ASTNode deleteDisjunct = disjuncts.get(Context.DestClausePrefix.DELETE);
+    if (deleteDisjunct != null) {
+      ASTNode whereClauseInUpdateDelete = findWhereClause(updateDeleteNode);
+      ASTNode orNode = (ASTNode) ParseDriver.adaptor.create(HiveParser.KW_OR, 
"or");

Review Comment:
   I made this change to align with the MERGE statement behavior, though it 
made the code slightly more complex.



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