Polars Lazy API
Polars offers both Eager and Lazy execution. The Lazy API builds a query plan and optimizes it before execution.
Benefits
- Predicate Pushdown: Filters are applied as early as possible.
- Projection Pushdown: Only required columns are read into memory.
Example
q = pl.scan_parquet("data/*.parquet").filter(pl.col("delay") > 0).select(["flight_id", "delay"])
result = q.collect() # Execution happens here