deniskuzZ commented on code in PR #6925:
URL: https://github.com/apache/hive/pull/6925#discussion_r4744421600


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/view/materialized/alter/rebuild/NonNativeAcidMaterializedViewASTBuilder.java:
##########
@@ -53,14 +55,24 @@ public void appendDeleteSelectNodes(ASTNode selectNode, 
String tableName) {
       selectedColumns.add(selectExpr.getChild(selectExpr.getChildCount() - 
1).getText());
     }
 
-    for (FieldSchema fieldSchema : 
mvTable.getStorageHandler().acidSelectColumns(mvTable, 
Context.Operation.DELETE)) {
-      if (!selectedColumns.contains(fieldSchema.getName())) {
+    for (String column : deleteSelectColumns()) {
+      if (!selectedColumns.contains(column)) {
         ParseDriver.adaptor.addChild(selectNode, wrapIntoSelExpr(
-            createQualifiedColumnNode(tableName, fieldSchema.getName())));
+            createQualifiedColumnNode(tableName, column)));
       }
     }
   }
 
+  // the incremental rebuild is a MERGE; in merge-on-read, its deletes select 
the virtual columns only
+  private List<String> deleteSelectColumns() {

Review Comment:
   applied #6986 into my branch locally. The Java changes merge cleanly. 
mv_iceberg_orc4/5/7/8.q.out conflict and have to be regenerated by whichever PR 
goes in second, plus mv_iceberg_orc10.q.out if this one goes 2nd, since it 
still has PARTITION__HASH. 
   
   With both, the single delete branch of the incremental rebuild selects only 
PARTITION__SPEC__ID, PARTITION__KEY, FILE__PATH and ROW__POSITION; for V3 it's 
distributed by FILE__PATH, one of the selected columns. 
   
   mv_iceberg_orc4, 5, 7, 8 and 10 return the same rows as your goldens, and 
the plans differ only in the narrower delete projection.



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