DanielZhu58 commented on code in PR #5950:
URL: https://github.com/apache/hive/pull/5950#discussion_r2443587638
##########
ql/src/java/org/apache/hadoop/hive/ql/stats/BasicStatsNoJobTask.java:
##########
@@ -181,6 +185,21 @@ public void run() {
}
parameters.putAll(basicStatistics);
StatsSetupConst.setBasicStatsState(parameters, StatsSetupConst.TRUE);
+ try {
+ String who = (partish.getPartition() == null) ? ("table " +
partish.getTable().getFullyQualifiedName())
+ : ("partition " + partish.getPartition().getName());
+ long threshold =
conf.getLongVar(HiveConf.ConfVars.HIVE_MERGE_MAP_FILES_AVG_SIZE);
+ SmallFilesWarningUtil.smallFilesWarnings(parameters, 100L,
threshold, who, "[ANALYZE][NOSCAN]")
+ .ifPresent(msg -> {
+ LOG.info(msg);
+ SessionState ss = SessionState.get();
+ if (ss != null && ss.getConsole() != null) {
+ ss.getConsole().printInfo(msg);
+ }
+ });
+ } catch (Throwable t) {
Review Comment:
Actually there is no chance that `SmallFilesWarningUtil.smallFilesWarnings`
will throw exception.
The util does no I/O and no RPC—it just reads a Map, parses two longs, and
formats a string. And all the possible failures haven been considered.
params == null → returns Optional.empty()
missing keys → returns Optional.empty()
bad numbers → caught as NumberFormatException and returns Optional.empty()
--
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]