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

Method Run

cmd/super/dev/csup/command.go:48–77  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

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

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 11

ParseURIFunction · 0.92
NewLocalEngineFunction · 0.92
CopyFunction · 0.92
NewDematerializerFunction · 0.92
NewPullerFunction · 0.92
NewMethod · 0.80
newReaderFunction · 0.70
InitMethod · 0.65
GetMethod · 0.65
CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected