Code review comment: why need to process FINISHED specially

Code under review:
public List<Comparable> getShowInfo(@Nullable Long tableId) throws AnalysisException {
        List<Comparable> result = Lists.newArrayList();

        result.add(Long.toString(id));

        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
        result.add(TimeUtils.longToTimeString(createTime, dateFormat));
        result.add(startTime != -1L ? TimeUtils.longToTimeString(startTime, dateFormat) : "N/A");
        result.add(finishTime != -1L ? TimeUtils.longToTimeString(finishTime, dateFormat) : "N/A");

        StringBuilder sb = new StringBuilder();
        for (String errorMsg : errorMsgs) {
            sb.append(errorMsg).append("\n");
        }
        result.add(sb.toString());

        int totalTaskNum = 0;
        int finishedTaskNum = 0;
        Map<Long, Set<String>> tblIdToCols = Maps.newHashMap();

        for (StatisticsTask task : tasks) {
            List<StatisticsDesc> statsDescs = task.getStatsDescs();

            if (!statsDescs.isEmpty()) {
                
                StatsCategory statsCategory = statsDescs.get(0).getStatsCategory();
                long tblId = statsCategory.getTableId();

                if (tableId == null || tableId == tblId) {
                    totalTaskNum++;
                    if (task.getTaskState() == StatisticsTask.TaskState.FINISHED) {
                        finishedTaskNum++;
                    }

                    String col = statsCategory.getColumnName();
                    if (Strings.isNullOrEmpty(col)) {
                        continue;
                    }
                    if (tblIdToCols.containsKey(tblId)) {
                        tblIdToCols.get(tblId).add(col);
                    } else {
                        Set<String> cols = Sets.newHashSet();
                        cols.add(col);
                        tblIdToCols.put(tblId, cols);
                    }
                }
            }
        }

        List<String> scope = Lists.newArrayList();
        Database db = Env.getCurrentEnv()
                .getInternalDataSource().getDbOrAnalysisException(dbId);
        for (Long tblId : tblIds) {
            try {
                Table table = db.getTableOrAnalysisException(tblId);
                List<Column> baseSchema = table.getBaseSchema();
                Set<String> cols = tblIdToCols.get(tblId);
                if (cols != null) {
                    if (baseSchema.size() == cols.size()) {
                        scope.add(table.getName() + "(*)");
                    } else {
                        scope.add(table.getName() + "(" + StringUtils.join(cols.toArray(), ",") + ")");
                    }
                }
            } catch (AnalysisException e) {
                
                LOG.info("get table failed, tableId: " + tblId, e);
            }
        }

        result.add(StringUtils.join(scope.toArray(), ","));
        result.add(finishedTaskNum + "/" + totalTaskNum);

        if (totalTaskNum == finishedTaskNum) {
            result.add("FINISHED");
        } else {
            result.add(jobState.toString());
        }

        return result;
    }

Line commented on: if (totalTaskNum == finishedTaskNum) {

Revised code:
public List<Comparable> getShowInfo(@Nullable Long tableId) throws AnalysisException {
        List<Comparable> result = Lists.newArrayList();

        result.add(Long.toString(id));

        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
        result.add(TimeUtils.longToTimeString(createTime, dateFormat));
        result.add(startTime != -1L ? TimeUtils.longToTimeString(startTime, dateFormat) : "N/A");
        result.add(finishTime != -1L ? TimeUtils.longToTimeString(finishTime, dateFormat) : "N/A");

        StringBuilder sb = new StringBuilder();
        for (String errorMsg : errorMsgs) {
            sb.append(errorMsg).append("\n");
        }
        result.add(sb.toString());

        int totalTaskNum = 0;
        int finishedTaskNum = 0;
        Map<Long, Set<String>> tblIdToCols = Maps.newHashMap();

        for (StatisticsTask task : tasks) {
            List<StatisticsDesc> statsDescs = task.getStatsDescs();

            if (!statsDescs.isEmpty()) {
                
                StatsCategory statsCategory = statsDescs.get(0).getStatsCategory();
                long tblId = statsCategory.getTableId();

                if (tableId == null || tableId == tblId) {
                    totalTaskNum++;
                    if (task.getTaskState() == StatisticsTask.TaskState.FINISHED) {
                        finishedTaskNum++;
                    }

                    String col = statsCategory.getColumnName();
                    if (Strings.isNullOrEmpty(col)) {
                        continue;
                    }
                    tblIdToCols.computeIfAbsent(tblId,
                            (key) -> Sets.newHashSet()).add(col);
                }
            }
        }

        List<String> scope = Lists.newArrayList();
        Database db = Env.getCurrentEnv()
                .getInternalDataSource().getDbOrAnalysisException(dbId);
        for (Long tblId : tblIds) {
            try {
                Table table = db.getTableOrAnalysisException(tblId);
                List<Column> baseSchema = table.getBaseSchema();
                Set<String> cols = tblIdToCols.get(tblId);
                if (cols != null) {
                    if (baseSchema.size() == cols.size()) {
                        scope.add(table.getName() + "(*)");
                    } else {
                        scope.add(table.getName() + "(" + StringUtils.join(cols.toArray(), ", ") + ")");
                    }
                }
            } catch (AnalysisException e) {
                
                LOG.info("get table failed, tableId: " + tblId, e);
            }
        }

        result.add(StringUtils.join(scope.toArray(), ","));
        result.add(finishedTaskNum + "/" + totalTaskNum);

        if (totalTaskNum == finishedTaskNum) {
            result.add("FINISHED");
        } else {
            result.add(jobState.toString());
        }

        return result;
    }