Aggarwal-Raghav commented on code in PR #5943:
URL: https://github.com/apache/hive/pull/5943#discussion_r2240364901


##########
ql/src/java/org/apache/hadoop/hive/ql/plan/DynamicPartitionCtx.java:
##########
@@ -91,7 +91,7 @@ public DynamicPartitionCtx(List<String> partColNames, String 
defaultPartName,
     this.spPath = null;
     String confVal;
     try {
-      confVal = 
Hive.get().getMetaConf(ConfVars.PARTITION_NAME_WHITELIST_PATTERN.getHiveName());
+      confVal = 
Hive.get().getMetaConf(ConfVars.PARTITION_NAME_WHITELIST_PATTERN.getVarname());

Review Comment:
   This change is enough for fixing dynamic partition. Reasoning:
   
   hivename: hive.metastore.partition.name.whitelist.pattern
   varname: metastore.partition.name.whitelist.pattern
   
   As users do `set metaconf:metastore.partition.name.whitelist.pattern=[^9]*`, 
then varname is used not the hivename. I believe it was never working earlier 
also for session level.
   
   NOTE: This also means that in hive-site.xml as well this is now going to be 
picked instead of hivename. 
   ```
     <property>
       <name>metastore.partition.name.whitelist.pattern</name>
       <value>[^9]*</value>
     </property>
   ```
   This shouldn't be an issue because:
   1. in HiveConf this config is deprecated.
   2. If users still uses hive.metastore.partition.name.whitelist.pattern, then 
also MoveTask will fail  (add_partitions_req) which is indireclty the expected 
behaviour 
   ```
   Error: Error while compiling statement: FAILED: Execution Error, return code 
40000 from org.apache.hadoop.hive.ql.exec.MoveTask. 
MetaException(message:Partition value '09' contains a character not matched by 
whitelist pattern '[^9]*'. Configure with 
metastore.partition.name.whitelist.pattern); Query ID: 
raghav_20250729215001_82d33e22-04db-4be3-8b01-189504089bf6 
(state=08S01,code=40000)
   ```
   3. If users uses hive.metastore.partition.name.whitelist.pattern for HMS 
Side operation like alter then it will also work becuase of 
`MetastoreConf#getVar()` which check for hivename as failsafe. That's why q 
file are not required to change.
   



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