// Docs

Reader model

How Refiner readers plan shards and emit rows

A Refiner reader has two jobs:

  1. Plan work into shards.
  2. Read each shard into rows or tabular blocks.

That separation is important. Planning should be lightweight enough to run at submission time. Reading can do the expensive I/O inside workers.

Rows and blocks

Most user code sees rows:

for row in pipeline.take(3):
    print(row)

Internally, readers may emit either:

UnitWhy it exists
RowNatural for Python transforms and episode-level robotics data.
Tabular blockEfficient for Arrow-backed readers and vectorized operations.

You usually do not need to choose. Refiner converts blocks to rows when a row transform needs them and keeps Arrow tables when vectorized transforms can run directly.

Reader arguments you see often

ArgumentMeaning
target_shard_bytesApproximate shard size for byte-splittable inputs.
num_shardsOptional target shard count.
recursiveWhether directory inputs should be scanned recursively.
file_path_columnMetadata column that records the source file path.
dtypesOptional schema hints used by downstream writers and expressions.

See Sharding for how these options affect worker work.

Path inputs

Readers accept local paths and fsspec-backed URLs. Refiner commonly uses:

PrefixExample
Local path/data/episodes/*.hdf5
Hugging Face datasethf://datasets/org/name
Hugging Face buckethf://buckets/org/bucket/path
Cloud/object storage supported by fsspecs3://bucket/path

See Path Formats.