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

Method Run

cmd/super/dev/dig/frames/command.go:50–79  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

48}
49
50func (c *Command) Run(args []string) error {
51 ctx, cleanup, err := c.Init(&c.outputFlags)
52 if err != nil {
53 return err
54 }
55 defer cleanup()
56 if len(args) != 1 {
57 return errors.New("a single file required")
58 }
59 uri, err := storage.ParseURI(args[0])
60 if err != nil {
61 return err
62 }
63 engine := storage.NewLocalEngine()
64 r, err := engine.Get(ctx, uri)
65 if err != nil {
66 return err
67 }
68 defer r.Close()
69 writer, err := c.outputFlags.Open(ctx, engine)
70 if err != nil {
71 return err
72 }
73 sctx := super.NewContext()
74 meta := newMetaReader(sctx, r)
75 if err := vio.Copy(writer, sbuf.NewDematerializer(sctx, sbuf.NewPuller(meta))); err != nil {
76 return err
77 }
78 return writer.Close()
79}
80
81type metaReader struct {
82 reader *reader

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 12

ParseURIFunction · 0.92
NewLocalEngineFunction · 0.92
NewContextFunction · 0.92
CopyFunction · 0.92
NewDematerializerFunction · 0.92
NewPullerFunction · 0.92
newMetaReaderFunction · 0.85
NewMethod · 0.80
InitMethod · 0.65
GetMethod · 0.65
CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected