liveBook · Manning

Apache Arrow

As explained in DuckDB in Action

Apache Arrow is a language-independent specification and software ecosystem for representing columnar data in memory.

Apache Arrow is a language-independent columnar memory format and software ecosystem for flat and hierarchical data. It enables fast interchange between languages and systems through zero-copy reads, avoiding serialization overhead. section 6.5

Arrow connects analytical tools without forcing repeated copying or transformation. DuckDB can read Arrow-shaped data through ADBC, while Python workflows can exchange tables with Polars and other libraries. section 1.7.1 section 6.5

Move a DuckDB relation into Arrow

Convert a DuckDB relation to an Arrow table, then filter and select it with PyArrow. The resulting table retains typed columns such as string and int64 while avoiding a serialization step. section 6.5

import pyarrow.compute as pc

(arrow_table
  .filter(pc.field("Region") == "NEAR EAST")  #1
  .select(["Country", "Region", "Population"])  #2
  .slice(length=5)  #3
)

Filter the Arrow table for one region, select three columns, and inspect the first five rows. section 6.5

import polars

population_table = con.table("population")

(population_table
   .limit(5)  #1
   .pl()  #2
  [["Country", "Region", "Population"]]  #3
)

Convert a DuckDB relation to a Polars DataFrame, limit it to five rows, and select the Country, Region, and Population columns. section 6.5

How DuckDB in Action covers it

How deep it goes
Defines the memory model and demonstrates conversions, filtering, and slicing without detailing Arrow internals.
Examples
Uses DuckDB relations, Polars DataFrames, PyArrow filtering, typed columns, and population records.
What it assumes
Assumes familiarity with Python data tables and DuckDB relations while demonstrating the interchange model through concrete operations.
What you can do after
Apply it via DuckDB, Polars, or PyArrow to exchange, filter, and inspect columnar data in Python workflows.
How it connects
Ties together DuckDB, Polars, pandas, NumPy, PySpark, ADBC, and zero-copy data interchange.

Also explained in

Compare how 3 books explain Apache Arrow →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of DuckDB in Action. The section links point to the parts of the book it draws on.