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

Method Run

cmd/super/dev/vector/search/command.go:47–84  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

45}
46
47func (c *Command) Run(args []string) error {
48 ctx, cleanup, err := c.Init(&c.outputFlags)
49 if err != nil {
50 return err
51 }
52 defer cleanup()
53 if len(args) != 1 {
54 return errors.New("usage: filter expression")
55 }
56 db, err := c.dbFlags.Open(ctx)
57 if err != nil {
58 return err
59 }
60 root := db.Root()
61 if root == nil {
62 return errors.New("remote databases not supported")
63 }
64 head, err := c.poolFlags.HEAD()
65 if err != nil {
66 return err
67 }
68 text := args[0]
69 sctx := super.NewContext()
70 rctx := runtime.NewContext(ctx, sctx)
71 puller, err := compiler.VectorFilterCompile(rctx, text, exec.NewEnvironment(nil, root), head)
72 if err != nil {
73 return err
74 }
75 writer, err := c.outputFlags.Open(ctx, storage.NewLocalEngine())
76 if err != nil {
77 return err
78 }
79 if err := vio.Copy(writer, sbuf.NewDematerializer(sctx, puller)); err != nil {
80 writer.Close()
81 return err
82 }
83 return writer.Close()
84}

Callers

nothing calls this directly

Implementers 15

Displaypkg/display/display.go
Serverpkg/httpd/server.go
Commandcmd/gentoken/main.go
Commandcmd/super/dev/command.go
Commandcmd/super/dev/vector/command.go
Commandcmd/super/dev/vector/copy/command.go
Commandcmd/super/dev/vector/project/command.g
Commandcmd/super/dev/vector/search/command.go
Commandcmd/super/dev/dig/command.go
Commandcmd/super/dev/dig/frames/command.go
Commandcmd/super/dev/dig/slice/command.go
Commandcmd/super/dev/csup/command.go

Calls 13

NewContextFunction · 0.92
NewContextFunction · 0.92
VectorFilterCompileFunction · 0.92
NewEnvironmentFunction · 0.92
NewLocalEngineFunction · 0.92
CopyFunction · 0.92
NewDematerializerFunction · 0.92
NewMethod · 0.80
HEADMethod · 0.80
InitMethod · 0.65
RootMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected