MCPcopy
hub / github.com/uber/aresdb / VisitGroupBy

Method VisitGroupBy

query/sql/sql_parser.go:551–571  ·  view source on GitHub ↗

VisitGroupBy visits the node

(ctx *antlrgen.GroupByContext)

Source from the content-addressed store, hash-verified

549
550// VisitGroupBy visits the node
551func (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
574func (v *ASTBuilder) VisitSingleGroupingSet(ctx *antlrgen.SingleGroupingSetContext) interface{} {

Callers

nothing calls this directly

Calls 11

getCtxLevelsMethod · 0.95
setCtxLevelsMethod · 0.95
VisitMethod · 0.95
getLocationMethod · 0.95
isDistinctMethod · 0.95
getTextMethod · 0.95
NewGroupByFunction · 0.92
AllGroupingElementMethod · 0.80
DebugfMethod · 0.65
SetValueMethod · 0.65
SetQuantifierMethod · 0.45

Tested by

no test coverage detected