VisitGroupBy visits the node
(ctx *antlrgen.GroupByContext)
| 549 | |
| 550 | // VisitGroupBy visits the node |
| 551 | func (v *ASTBuilder) VisitGroupBy(ctx *antlrgen.GroupByContext) interface{} { |
| 552 | v.Logger.Debugf("VisitGroupBy: %s", ctx.GetText()) |
| 553 | |
| 554 | level, levelWith, levelQuery := v.getCtxLevels(v.SQL2AqlCtx) |
| 555 | |
| 556 | ctxArr := ctx.AllGroupingElement() |
| 557 | groupingElements := make([]tree.IGroupingElement, len(ctxArr)) |
| 558 | for i, c := range ctxArr { |
| 559 | v.setCtxLevels(v.SQL2AqlCtx, level, levelWith, levelQuery) |
| 560 | groupingElements[i], _ = v.Visit(c).(tree.IGroupingElement) |
| 561 | } |
| 562 | |
| 563 | groupBy := tree.NewGroupBy( |
| 564 | v.getLocation(ctx), |
| 565 | v.isDistinct(ctx.SetQuantifier()), |
| 566 | groupingElements) |
| 567 | groupBy.SetValue(fmt.Sprintf("GroupBy: (%s)", v.getText(ctx.BaseParserRuleContext))) |
| 568 | |
| 569 | v.setCtxLevels(v.SQL2AqlCtx, level-1, levelWith, levelQuery) |
| 570 | return groupBy |
| 571 | } |
| 572 | |
| 573 | // VisitSingleGroupingSet visits the node |
| 574 | func (v *ASTBuilder) VisitSingleGroupingSet(ctx *antlrgen.SingleGroupingSetContext) interface{} { |
nothing calls this directly
no test coverage detected