dengzhhu653 commented on code in PR #5950:
URL: https://github.com/apache/hive/pull/5950#discussion_r2430919630
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/Msck.java:
##########
@@ -240,6 +244,61 @@ public int repair(MsckInfo msckInfo) throws TException,
MetastoreException, IOEx
}
}
+ // Generate small files warnings only for partsNotInMs
+ try {
+ long threshold = MetastoreConf.getLongVar(getConf(),
MetastoreConf.ConfVars.MSCK_SMALLFILES_AVG_SIZE);
+ Map<String, String> smallFilesStats = new TreeMap<>();
+ for (CheckResult.PartitionResult pr : partsNotInMs) {
+ List<String> statsVals;
+ try {
+ // parse the partition name into a few partition values
+ statsVals = Warehouse.makeValsFromName(pr.getPartitionName(),
null);
+ } catch (MetaException me) {
+ // skip this partition if this somehow failed
+ continue;
+ }
+ Partition p;
+ try {
+ // the newly added partition should exist in metastore
+ p = getMsc().getPartition(table.getCatName(), table.getDbName(),
table.getTableName(), statsVals);
+ } catch (NoSuchObjectException nsoe) {
+ // the partition is not actually added in metastore
+ continue;
+ }
+ Map<String, String> params = p.getParameters();
Review Comment:
can we add a new method `static boolean smallAverageFilesDetected(getConf(),
params)` in `SmallFilesWarningUtil` to include the small average file
validation?
--
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]