| 12 | ) |
| 13 | |
| 14 | func (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 | } |