pvary commented on code in PR #3053:
URL: https://github.com/apache/hive/pull/3053#discussion_r895497824
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreChecker.java:
##########
@@ -309,7 +309,37 @@ void checkTable(Table table, PartitionIterable parts,
byte[] filterExp, CheckRes
return;
}
- Set<Path> partPaths = new HashSet<>();
+ // now check the table folder and see if we find anything
+ // that isn't in the metastore
+ Set<Path> allPartDirs = new HashSet<>();
+ List<FieldSchema> partColumns = table.getPartitionKeys();
+ checkPartitionDirs(tablePath, allPartDirs,
Collections.unmodifiableList(getPartColNames(table)));
+ String tablePathStr = tablePath.toString();
+ int tablePathLength = tablePathStr.length();
+
+ if (filterExp != null) {
+ PartitionExpressionProxy expressionProxy = createExpressionProxy(conf);
+ List<String> partitions = new ArrayList<>();
+ Set<Path> partDirs = new HashSet<Path>();
+ boolean tablePathStrEndsWith = tablePathStr.endsWith("/");
+ allPartDirs.stream().forEach(path -> {
+ if (tablePathStrEndsWith) {
Review Comment:
We can move this check out of the loop:
```
int tablePathStrLen = tablePathStr.endsWith("/") ? tablePathStr.length() :
tablePathStr.length() + 1;
allPartDirs.stream().forEach(path ->
partitions.add(path.toString().substring(tablePathStrLen)));
```
--
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]