public void reset() {
        groupingExprs = new ArrayList<>();
        exprGenerated = false;
        if (oriGroupingExprs != null) {
            Expr.resetList(oriGroupingExprs);
            groupingExprs.addAll(oriGroupingExprs);
        }
        if (groupingSetList != null) {
            for (List<Expr> s : groupingSetList) {
                for (Expr e : s) {
                    if (e != null) {
                        e.reset();
                    }
                }
            }
        }
    }
@Test
    public void testReset() {
        ArrayList<Expr> groupingExprs = new ArrayList<>();
        String[] cols = {"k2", "k2", "k3", "k1"};
        for (String col : cols) {
            Expr expr = new SlotRef(new TableName("testdb", "t"), col);
            groupingExprs.add(expr);
        }

        GroupByClause groupByClause = new GroupByClause(Expr.cloneList(groupingExprs),
                GroupByClause.GroupingType.GROUP_BY);
        try {
            groupByClause.analyze(analyzer);
        } catch (AnalysisException execption) {
            Assert.assertTrue(false);
        }
        try {
            groupByClause.reset();
        } catch (Exception e) {
            Assert.fail("reset throw exceptions!" + e);
        }
    }