ayushtkn commented on code in PR #5568:
URL: https://github.com/apache/hive/pull/5568#discussion_r1875047399


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreChecker.java:
##########
@@ -440,12 +440,13 @@ void findUnknownPartitions(Table table, Set<Path> 
missingPartDirs,
       partColNames.add(fSchema.getName());
     }
 
+    String defaultPartName = MetastoreConf.getVar(conf, 
MetastoreConf.ConfVars.DEFAULTPARTITIONNAME);

Review Comment:
   I just had a quick look seems like the problem is coming post HIVE-23347, 
which added this method ``getNormalisedPartitionValue`` which does this parsing 
for numeric values. Before that patch things should have worked & Scenario-1 
would have passed as well, with both values being shown in `show partitions`
   
   This method ``getNormalisedPartitionValue`` looks like is valid only for 
numeric values to sort out some 0s or so. Maybe we can just have a numeric 
check & return rather than this default partition value matching
   
   ```
       if(!NumberUtils.isParsable(partitionValue)) {
         return partitionValue;
       }
   ```
   
   If we check the regular case without MSCK for scenario-1, the show 
partitions would show both the values, I tried locally
   ```
   +------------------------------------------+
   |                partition                 |
   +------------------------------------------+
   | month=12/day=2                           |
   | month=12/day=3                           |
   | month=12/day=__HIVE_DEFAULT_PARTITION__  |
   | month=__ANOTHER_PARTITION__/day=9        |
   | month=__HIVE_DEFAULT_PARTITION__/day=3   |
   +------------------------------------------+
   5 rows selected (0.052 seconds)
   0: jdbc:hive2://localhost:10000/> 
   ```
   
   So, post MSCK also we should show both those values. So, I believe we should 
just check whether the value is numeric or not, if not, just return the value 
as is..
   



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