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


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/partition/PartitionUtils.java:
##########
@@ -63,20 +63,28 @@ private PartitionUtils() {
    */
   public static void validatePartitions(HiveConf conf, Map<String, String> 
partitionSpec) throws SemanticException {
     Set<String> reservedPartitionValues = new HashSet<>();
+    Set<String> reservedSuffixPartitionValues = new HashSet<>();
     // Partition can't have this name
     reservedPartitionValues.add(HiveConf.getVar(conf, 
ConfVars.DEFAULT_PARTITION_NAME));
     reservedPartitionValues.add(HiveConf.getVar(conf, 
ConfVars.DEFAULT_ZOOKEEPER_PARTITION_NAME));
     // Partition value can't end in this suffix
-    reservedPartitionValues.add(HiveConf.getVar(conf, 
ConfVars.METASTORE_INT_ORIGINAL));
-    reservedPartitionValues.add(HiveConf.getVar(conf, 
ConfVars.METASTORE_INT_ARCHIVED));
-    reservedPartitionValues.add(HiveConf.getVar(conf, 
ConfVars.METASTORE_INT_EXTRACTED));
+    reservedSuffixPartitionValues.add(HiveConf.getVar(conf, 
ConfVars.METASTORE_INT_ORIGINAL));
+    reservedSuffixPartitionValues.add(HiveConf.getVar(conf, 
ConfVars.METASTORE_INT_ARCHIVED));
+    reservedSuffixPartitionValues.add(HiveConf.getVar(conf, 
ConfVars.METASTORE_INT_EXTRACTED));
 
     for (Entry<String, String> e : partitionSpec.entrySet()) {

Review Comment:
   could we please refactor with 
   ````
   partitionSpec.foreach((key, value) -> {
     if (value != null && reservedPartitionValue.containsKey(value)) {
     ...
     }
   }
   ````
   similar for `reservedPartitionSuffixes`



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