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

Function NewSplit

sio/emitter/split.go:30–49  ·  view source on GitHub ↗
(ctx context.Context, engine storage.Engine, dir *storage.URI, prefix string, unbuffered bool, opts anyio.WriterOpts)

Source from the content-addressed store, hash-verified

28var _ vio.Pusher = (*Split)(nil)
29
30func NewSplit(ctx context.Context, engine storage.Engine, dir *storage.URI, prefix string, unbuffered bool, opts anyio.WriterOpts) (*Split, error) {
31 e := sio.Extension(opts.Format)
32 if e == "" {
33 return nil, fmt.Errorf("unknown format: %s", opts.Format)
34 }
35 if prefix != "" {
36 prefix = prefix + "-"
37 }
38 return &Split{
39 ctx: ctx,
40 dir: dir,
41 prefix: prefix,
42 unbuffered: unbuffered,
43 ext: e,
44 opts: opts,
45 writers: make(map[super.Type]vio.PushCloser),
46 seen: make(map[string]struct{}),
47 engine: engine,
48 }, nil
49}
50
51func (s *Split) Push(vec vector.Any) error {
52 if vec, ok := vec.(*vector.Dynamic); ok {

Callers 2

OpenMethod · 0.92
TestDirS3SourceFunction · 0.85

Calls 1

ExtensionFunction · 0.92

Tested by 1

TestDirS3SourceFunction · 0.68