MCPcopy Index your code
hub / github.com/uber/aresdb / getOrderBy

Method getOrderBy

query/sql/sql_parser.go:1398–1410  ·  view source on GitHub ↗
(ctx orderByContext)

Source from the content-addressed store, hash-verified

1396}
1397
1398func (v *ASTBuilder) getOrderBy(ctx orderByContext) *tree.OrderBy {
1399 var orderBy *tree.OrderBy
1400 if ctx.ORDER() != nil {
1401 ctxArr := ctx.AllSortItem()
1402 arrSortItem := make([]*tree.SortItem, len(ctxArr))
1403 for i, c := range ctxArr {
1404 arrSortItem[i] = v.Visit(c.(*antlrgen.SortItemContext)).(*tree.SortItem)
1405 }
1406 orderBy = tree.NewOrderBy(v.getLocation(ctx.ORDER()), arrSortItem)
1407 orderBy.SetValue(fmt.Sprintf("OrderBy: (%s)", ctx.ORDER().GetText()))
1408 }
1409 return orderBy
1410}
1411
1412func (v *ASTBuilder) getLocation(input interface{}) *tree.NodeLocation {
1413 var token antlr.Token

Callers 1

VisitQueryNoWithMethod · 0.95

Calls 6

VisitMethod · 0.95
getLocationMethod · 0.95
NewOrderByFunction · 0.92
ORDERMethod · 0.65
AllSortItemMethod · 0.65
SetValueMethod · 0.65

Tested by

no test coverage detected