@Override
    public ProcResult fetchResult() throws AnalysisException {
        Preconditions.checkNotNull(db);
        Preconditions.checkNotNull(schemaChangeHandler);

        BaseProcResult result = new BaseProcResult();
        result.setNames(TITLE_NAMES);

        List<List<Comparable>> schemaChangeJobInfos = getOptimizeJobInfos();
        for (List<Comparable> infoStr : schemaChangeJobInfos) {
            List<String> oneInfo = new ArrayList<String>(TITLE_NAMES.size());
            for (Comparable element : infoStr) {
                oneInfo.add(element.toString());
            }
            result.addRow(oneInfo);
        }
        return result;
    }
@Test
    public void testFetchResult() throws AnalysisException {
        BaseProcResult result = (BaseProcResult) optimizeProcDir.fetchResult();
        List<List<String>> rows = result.getRows();
        List<String> list1 = rows.get(0);
        Assert.assertEquals(list1.size(), OptimizeProcDir.TITLE_NAMES.size());
        // JobId
        Assert.assertEquals("1", list1.get(0));
        // TableName
        Assert.assertEquals("tb1", list1.get(1));
        // CreateTime
        Assert.assertEquals("2020-01-01", list1.get(2));
        // FinishTime
        Assert.assertEquals("2020-01-01", list1.get(3));
        // Operation
        Assert.assertEquals("ALTER", list1.get(4));
        // TransactionId
        Assert.assertEquals("0", list1.get(5));
        // State
        Assert.assertEquals("FINISHED", list1.get(6));
        // Msg
        Assert.assertEquals("", list1.get(7));
        // Progress
        Assert.assertEquals("100", list1.get(8));
        // Timeout
        Assert.assertEquals("10000", list1.get(9));

        List<String> list2 = rows.get(1);
        Assert.assertEquals(list2.size(), OptimizeProcDir.TITLE_NAMES.size());
        // JobId
        Assert.assertEquals("1", list2.get(0));
        // TableName
        Assert.assertEquals("tb1", list2.get(1));
        // CreateTime
        Assert.assertEquals("2020-01-01", list2.get(2));
        // FinishTime
        Assert.assertEquals("2020-01-01", list2.get(3));
        // Operation
        Assert.assertEquals("ALTER", list2.get(4));
        // TransactionId
        Assert.assertEquals("0", list2.get(5));
        // State
        Assert.assertEquals("FINISHED", list2.get(6));
        // Msg
        Assert.assertEquals("", list2.get(7));
        // Progress
        Assert.assertEquals("100", list2.get(8));
        // Timeout
        Assert.assertEquals("10000", list2.get(9));

    }