MCPcopy Create free account
hub / github.com/brimdata/super / ParseSortKeys

Function ParseSortKeys

order/sortkey.go:40–62  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

38}
39
40func ParseSortKeys(s string) (SortKeys, error) {
41 if s == "" {
42 return nil, nil
43 }
44 which := Asc
45 parts := strings.Split(s, ":")
46 if len(parts) > 1 {
47 if len(parts) > 2 {
48 return nil, errors.New("only one order clause allowed in sortkey description")
49 }
50 var err error
51 which, err = Parse(parts[1])
52 if err != nil {
53 return nil, err
54 }
55 }
56 keys := field.DottedList(parts[0])
57 var sortKeys []SortKey
58 for _, k := range keys {
59 sortKeys = append(sortKeys, NewSortKey(which, k))
60 }
61 return sortKeys, nil
62}

Callers 1

RunMethod · 0.92

Calls 5

DottedListFunction · 0.92
NewSortKeyFunction · 0.85
SplitMethod · 0.80
NewMethod · 0.80
ParseFunction · 0.70

Tested by

no test coverage detected