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

Function searchForSuperSQL

compiler/parser/parser_test.go:20–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18)
19
20func searchForSuperSQL() ([]string, error) {
21 var queries []string
22 pattern := fmt.Sprintf(`.*ztests\%c.*\.yaml$`, filepath.Separator)
23 re := regexp.MustCompile(pattern)
24 err := filepath.Walk("..", func(path string, info os.FileInfo, err error) error {
25 if !info.IsDir() && strings.HasSuffix(path, ".yaml") && re.MatchString(path) {
26 ztests, err := ztest.FromYAMLFile(path)
27 if err != nil {
28 return fmt.Errorf("%s: %w", path, err)
29 }
30 for _, z := range ztests {
31 if s := z.SPQ; s != "" {
32 queries = append(queries, s)
33 }
34 }
35 }
36 return err
37 })
38 return queries, err
39}
40
41func parseOp(z string) ([]byte, error) {
42 ast, err := parser.ParseText(z)

Callers 1

TestZtestSuperSQLFunction · 0.85

Calls 2

FromYAMLFileFunction · 0.92
WalkMethod · 0.80

Tested by

no test coverage detected