MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / Read

Method Read

plugins/destination/file/client/read.go:14–34  ·  view source on GitHub ↗
(_ context.Context, table *schema.Table, res chan<- arrow.RecordBatch)

Source from the content-addressed store, hash-verified

12)
13
14func (c *Client) Read(_ context.Context, table *schema.Table, res chan<- arrow.RecordBatch) error {
15 if !c.spec.NoRotate {
16 return fmt.Errorf("reading is not supported when `no_rotate` is false. Table: %q", table.Name)
17 }
18 if c.spec.PathContainsUUID() {
19 return fmt.Errorf("reading is not supported when `path` contains UUID variable. Table: %q", table.Name)
20 }
21 name := c.spec.ReplacePathVariables(table.Name, uuid.NewString(), time.Time{})
22
23 if syncAfterWrite {
24 time.Sleep(500 * time.Millisecond)
25 }
26
27 f, err := os.Open(name)
28 if err != nil {
29 return err
30 }
31 defer f.Close()
32
33 return c.Client.Read(f, table, res)
34}

Callers 1

readAllFunction · 0.45

Calls 4

ErrorfMethod · 0.80
CloseMethod · 0.65
PathContainsUUIDMethod · 0.45
ReplacePathVariablesMethod · 0.45

Tested by 1

readAllFunction · 0.36