Get the latest tech news

Paging Through a Parquet File in DuckDB: File_row_number or Offset?


You have a large Parquet file and an API that has to return its contents, but responses have a size ceiling, so the caller pages through it. LIMIT/OFFSET is the obvious way to write that and it is the wrong one. I measured file_row_number against it: 2.53x faster on a file with 163 row groups. Speed is the boring half of the answer. OFFSET will also hand back the wrong rows without telling you.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of DuckDB

DuckDB

Photo of parquet file

parquet file

Photo of file_row_number

file_row_number

Related news:

News photo

Choose DuckDB rather than SQLite

News photo

Quack: The DuckDB Client-Server Protocol

News photo

Full-Text Search with DuckDB