public List<TStatisticData> queryStatisticSync(ConnectContext context, String tableUUID, Table table,
                                                   List<String> columnNames) throws AnalysisException {
        if (table == null) {
            // Statistical information query is an unlocked operation,
            // so it is possible for the table to be deleted while the code is running
            return Collections.emptyList();
        }
        List<Type> columnTypes = Lists.newArrayList();
        for (String colName : columnNames) {
            columnTypes.add(StatisticUtils.getQueryStatisticsColumnType(table, colName));
        }
        String sql = StatisticSQLBuilder.buildQueryExternalFullStatisticsSQL(tableUUID, columnNames, columnTypes);
        return executeStatisticDQL(context, sql);
    }
@Test
    public void testEmpty() throws Exception {
        StatisticExecutor statisticExecutor = new StatisticExecutor();
        Database db = GlobalStateMgr.getCurrentState().getDb("test");
        OlapTable olapTable = (OlapTable) db.getTable("t0");

        GlobalStateMgr.getCurrentState().getAnalyzeMgr().addBasicStatsMeta(new BasicStatsMeta(db.getId(), olapTable.getId(), null,
                StatsConstants.AnalyzeType.FULL,
                LocalDateTime.of(2020, 1, 1, 1, 1, 1),
                Maps.newHashMap()));

        Assert.assertThrows(SemanticException.class,
                () -> statisticExecutor.queryStatisticSync(
                        StatisticUtils.buildConnectContext(), db.getId(), olapTable.getId(), Lists.newArrayList("foo", "bar")));
    }