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

Method Run

cmd/super/dev/vector/copy/command.go:47–77  ·  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("CSUP read: must be run with a single path argument")
55 }
56 uri, err := storage.ParseURI(args[0])
57 if err != nil {
58 return err
59 }
60 local := storage.NewLocalEngine()
61 object, err := vcache.NewObject(ctx, local, uri)
62 if err != nil {
63 return err
64 }
65 defer object.Close()
66 writer, err := c.outputFlags.Open(ctx, local)
67 if err != nil {
68 return err
69 }
70 sctx := super.NewContext()
71 puller := vam.NewProjection(sctx, object, nil)
72 if err := vio.Copy(writer, sbuf.NewDematerializer(sctx, puller)); err != nil {
73 writer.Close()
74 return err
75 }
76 return writer.Close()
77}

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

CloseMethod · 0.95
ParseURIFunction · 0.92
NewLocalEngineFunction · 0.92
NewObjectFunction · 0.92
NewContextFunction · 0.92
NewProjectionFunction · 0.92
CopyFunction · 0.92
NewDematerializerFunction · 0.92
NewMethod · 0.80
InitMethod · 0.65
CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected