dengzhhu653 commented on code in PR #5950:
URL: https://github.com/apache/hive/pull/5950#discussion_r2371013108
##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/misc/msck/MsckOperation.java:
##########
@@ -75,7 +78,25 @@ public int execute() throws HiveException, IOException,
TException, MetastoreExc
MsckInfo msckInfo = new MsckInfo(SessionState.get().getCurrentCatalog(),
tableName.getDb(), tableName.getTable(),
desc.getFilterExp(), desc.getResFile(), desc.isRepairPartitions(),
desc.isAddPartitions(), desc.isDropPartitions(),
partitionExpirySeconds);
- return msck.repair(msckInfo);
+ int result = msck.repair(msckInfo);
+ Map<String, String> smallFilesStats = msckInfo.getSmallFilesStats();
+ if (smallFilesStats != null && !smallFilesStats.isEmpty()) {
+ // keep the small files information in the logs
+ List<String> logInfo = smallFilesStats.entrySet().stream()
+ .map(entry -> String.format(
+ "This table/partition average file size is less than
Hive average file size.%n The partition name is %s. %s",
+ entry.getKey(), entry.getValue()))
+ .collect(Collectors.toList());
+ LOG.info("There are small files exist.\n{}", String.join("\n",
logInfo));
Review Comment:
we just need to keep one log by `ss.getConsole().printInfo`
--
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]