pvary commented on code in PR #3053:
URL: https://github.com/apache/hive/pull/3053#discussion_r888123783
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreChecker.java:
##########
@@ -326,10 +356,29 @@ void checkTable(Table table, PartitionIterable parts,
byte[] filterExp, CheckRes
CheckResult.PartitionResult prFromMetastore = new
CheckResult.PartitionResult();
prFromMetastore.setPartitionName(getPartitionName(table, partition));
prFromMetastore.setTableName(partition.getTableName());
- if (!fs.exists(partPath)) {
- result.getPartitionsNotOnFs().add(prFromMetastore);
- } else {
+ if (allPartDirs.contains(partPath)) {
result.getCorrectPartitions().add(prFromMetastore);
+ allPartDirs.remove(partPath);
+ }
+ // There can be edge case where user can define partition directory
outside of table directory
+ // to avoid eviction of such partitions
+ // we check existence of partition path which are not in table directory
+ // and add to result for getPartitionsNotOnFs.
+ else {
+ if (!partPath.toString().contains(tablePath.toString())) {
+ if(!fs.exists(partPath)) {
+ result.getPartitionsNotOnFs().add(prFromMetastore);
+ }
Review Comment:
nit: `} else {`
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreChecker.java:
##########
@@ -326,10 +356,29 @@ void checkTable(Table table, PartitionIterable parts,
byte[] filterExp, CheckRes
CheckResult.PartitionResult prFromMetastore = new
CheckResult.PartitionResult();
prFromMetastore.setPartitionName(getPartitionName(table, partition));
prFromMetastore.setTableName(partition.getTableName());
- if (!fs.exists(partPath)) {
- result.getPartitionsNotOnFs().add(prFromMetastore);
- } else {
+ if (allPartDirs.contains(partPath)) {
result.getCorrectPartitions().add(prFromMetastore);
+ allPartDirs.remove(partPath);
+ }
+ // There can be edge case where user can define partition directory
outside of table directory
+ // to avoid eviction of such partitions
+ // we check existence of partition path which are not in table directory
+ // and add to result for getPartitionsNotOnFs.
+ else {
+ if (!partPath.toString().contains(tablePath.toString())) {
+ if(!fs.exists(partPath)) {
Review Comment:
nit `if (`
--
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]