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

Function NewReader

sio/csupio/reader.go:29–46  ·  view source on GitHub ↗
(sctx *super.Context, r io.Reader, fields []field.Path)

Source from the content-addressed store, hash-verified

27}
28
29func NewReader(sctx *super.Context, r io.Reader, fields []field.Path) (sio.Reader, error) {
30 ra, ok := r.(io.ReaderAt)
31 if !ok {
32 return nil, errors.New("Super Columnar requires a seekable input")
33 }
34 // CSUP autodetection requires that we return error on open if invalid format.
35 if _, err := csup.ReadHeader(ra); err != nil {
36 return nil, err
37 }
38 ctx, cancel := context.WithCancel(context.Background())
39 return &reader{
40 sctx: sctx,
41 stream: &stream{ctx: ctx, r: ra},
42 projection: field.NewProjection(fields),
43 readerAt: ra,
44 cancel: cancel,
45 }, nil
46}
47
48func (r *reader) Read() (*super.Value, error) {
49again:

Callers 6

ReadCSUPFunction · 0.92
RunQueryCSUPFunction · 0.92
TestCSUPBatchBugFunction · 0.92
NewReaderFunction · 0.92
lookupReaderFunction · 0.92

Calls 3

ReadHeaderFunction · 0.92
NewProjectionFunction · 0.92
NewMethod · 0.80

Tested by 2

TestCSUPBatchBugFunction · 0.74