Lay out a shrimp pond data lake so real DuckDB reads little: Parquet, row groups, partitions. 13 levels, played right in the browser with nothing to install.
A data lake keeps data as plain files on disk, not inside a database server. An engine like DuckDB reads those files directly with SQL. How a file is written decides how much has to be read. CSV and JSON Lines write one whole row and then the next, as text. Parquet writes each column side by side, compressed, and stores each column’s type. The scale beside the hut weighs how many bytes DuckDB really read, and its clock records the time on this PC.
When reading a CSV, DuckDB guesses each column’s type from sample rows at the start of the file (sniffing). If the sample holds only whole numbers, the column is read as BIGINT. If there is text like -, the column becomes VARCHAR. You can replace that guess: types sets a column’s type, nullstr names the text that means empty, and ignore_errors drops rows that fail to read.
Parquet writes each column in pages. Each page can be packed twice. Encoding changes how values are written, for example dictionary: a list of distinct values, then a number for each row. Compression like snappy and zstd packs the page once it is written. Snappy is fast and middling. Zstd is tighter and a little slower to open.
A Parquet file is split into row groups: slices of many rows. For each row group and each column, the file’s footer keeps the smallest and largest value. Before reading a row group, DuckDB can look at its label first. If the range being searched is not between min and max, the row group is skipped without being read.
Hive-style partitioning splits files into folders named column=value, for example musim=2026-I/. When reading with hive_partitioning = true, that folder name turns back into a column. If WHERE filters on the partition column, DuckDB matches it against the folder names and never opens the other folders at all. This is called partition pruning.
Data that flows all the time, like a sensor’s, is usually written a little at a time: one small file every minute (micro-batch). That gets data in quickly, but fills the lake with small files. Compaction joins those small files into a few big ones, say once a day, so a query that reads a lot of data opens only a few files.