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


##########
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:
   got it, tnx! however, could we please deduplicate this part of the code? 
something like:
   ````
   static void overrideConfProps(HiveConf conf, CompactionInfo ci, Map<String, 
String> properties) {
         Stream.of(properties, new StringableMap(ci.properties))
           .filter(Objects::nonNull)
           .flatMap(map -> map.entrySet().stream())
           .filter(entry -> entry.getKey().startsWith(COMPACTOR_PREFIX))
           .forEach(entry -> {
             String property = 
entry.getKey().substring(COMPACTOR_PREFIX.length());
             conf.set(property, entry.getValue());
           });
       }
   ````  



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to