NextPage wraps pages.ReadPage and helps reuse already open buffers.
()
| 32 | |
| 33 | // NextPage wraps pages.ReadPage and helps reuse already open buffers. |
| 34 | func (h *ColumnChunkHelper) NextPage() (parquet.Page, error) { |
| 35 | if h.err != nil { |
| 36 | return nil, h.err |
| 37 | } |
| 38 | |
| 39 | if h.firstPage != nil { |
| 40 | // Clear and return the already buffered first page. |
| 41 | // Caller takes ownership of it. |
| 42 | pg := h.firstPage |
| 43 | h.firstPage = nil |
| 44 | return pg, nil |
| 45 | } |
| 46 | |
| 47 | if h.pages == nil { |
| 48 | h.pages = h.Pages() |
| 49 | } |
| 50 | |
| 51 | return h.pages.ReadPage() |
| 52 | } |
| 53 | |
| 54 | func (h *ColumnChunkHelper) Close() error { |
| 55 | if h.firstPage != nil { |
no outgoing calls
no test coverage detected