Currently, when converting a parquet page to an arrow record, all the writers would repeat the slow path of allocating a parquet.Values slice, read all values, and write them to their underlying builder. However, this code already existed one level above and is more efficient since it reuses a parquet.Values slice.
This commit removes the repetition from the writers and leaves only the concrete implementation of writing existing values to an arrow builder. Callers can also check if the ValueWriter implements the PageWriter interface, which can also offer a fast path for writing a parquet page directly.
The improvement is especially noticeable in Query/Values since the slow path would previously fall back to write all the page values, rather than just the dictionary values.
Currently, when converting a parquet page to an arrow record, all the writers would repeat the slow path of allocating a parquet.Values slice, read all values, and write them to their underlying builder. However, this code already existed one level above and is more efficient since it reuses a parquet.Values slice.
This commit removes the repetition from the writers and leaves only the concrete implementation of writing existing values to an arrow builder. Callers can also check if the ValueWriter implements the PageWriter interface, which can also offer a fast path for writing a parquet page directly.
The improvement is especially noticeable in Query/Values since the slow path would previously fall back to write all the page values, rather than just the dictionary values.