SourabhBadhya commented on code in PR #3528:
URL: https://github.com/apache/hive/pull/3528#discussion_r952191010


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/QueryCompactor.java:
##########
@@ -272,5 +277,23 @@ static void removeFilesForMmTable(HiveConf conf, 
AcidDirectory dir) throws IOExc
         fs.delete(dead, true);
       }
     }
+
+    static void overrideConfProps(HiveConf conf, CompactionInfo ci, 
Map<String, String> properties) {
+      for (String key : properties.keySet()) {
+        if (key.startsWith(COMPACTOR_PREFIX)) {
+          String property = key.substring(10); // 10 is the length of 
"compactor." We only keep the rest.
+          conf.set(property, properties.get(key));
+        }
+      }
+
+      // Give preference to properties coming from compaction
+      // over table properties
+      for (String key : ci.getPropertiesMap().keySet()) {

Review Comment:
   This is required for the `ALTER TABLE <tablename> COMPACT 'major' WITH 
TBLPROPERTIES OVERWRITE (<property list>)` scenario. Here the properties are 
entered into `COMPACTION_QUEUE` and when the table is picked for compaction, 
the table properties which are set in `CQ_TBLPROPERTIES` must also be picked. 
All this information is stored in CompactionInfo, hence the need to set the 
properties as here.
   
   Same behaviour is seen for MR-based compaction as well.



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