# iceberg API reference

> The `iceberg` package, from iceberg 0.8.6, as published on mojoshelf (commit ec4f4e07605b), by `mojo doc` from Mojo 1.2.0.

## Modules

- [iceberg.append](https://magmalake.dev/s/iceberg/api/append.md): Fast append: new data files, a new manifest, a new snapshot.
- [iceberg.batch](https://magmalake.dev/s/iceberg/api/batch.md): Building an Arrow `RecordBatch` from Mojo values.
- [iceberg.catalog](https://magmalake.dev/s/iceberg/api/catalog.md): Catalogs: how a table name becomes a `TableMetadata`.
- [iceberg.catalog.filesystem](https://magmalake.dev/s/iceberg/api/catalog/filesystem.md): Filesystem tables: a table is a directory, no catalog service involved.
- [iceberg.catalog.rest](https://magmalake.dev/s/iceberg/api/catalog/rest.md): Iceberg REST catalog — URLs, headers, responses, and the socket.
- [iceberg.catalog.sql](https://magmalake.dev/s/iceberg/api/catalog/sql.md): A JDBC-style SQL catalog, over sqlite.mojo or postgres.mojo — the schema and semantics PyIceberg's `SqlCatalog` uses.
- [iceberg.commit](https://magmalake.dev/s/iceberg/api/commit.md): A snapshot that adds *and* removes files, with the manifest maintenance that implies.
- [iceberg.delete](https://magmalake.dev/s/iceberg/api/delete.md): Row-level delete and overwrite: which rows go, and how they are recorded.
- [iceberg.expressions](https://magmalake.dev/s/iceberg/api/expressions.md): Row filters: unbound and bound predicates, binding, projection, evaluators.
- [iceberg.io](https://magmalake.dev/s/iceberg/api/io.md): File access: locations in, bytes out — over local files, S3, GCS, Azure or plain HTTP.
- [iceberg.json](https://magmalake.dev/s/iceberg/api/json.md): A small, dependency-free JSON reader/writer for Iceberg metadata.
- [iceberg.kernels](https://magmalake.dev/s/iceberg/api/kernels.md): Columnar kernels: the Arrow arrays a scan produces, without a `Datum` in sight.
- [iceberg.maintain](https://magmalake.dev/s/iceberg/api/maintain.md): Expiring snapshots, and deleting the files that nothing points at any more.
- [iceberg.manifest](https://magmalake.dev/s/iceberg/api/manifest.md): Manifest lists and manifests, read through avro.mojo.
- [iceberg.manifest_write](https://magmalake.dev/s/iceberg/api/manifest_write.md): Writing manifests and manifest lists.
- [iceberg.metadata](https://magmalake.dev/s/iceberg/api/metadata.md): `TableMetadata` — the whole of an Iceberg `*.metadata.json`, v1 through v3.
- [iceberg.nested](https://magmalake.dev/s/iceberg/api/nested.md): Nested columns — struct, list and map — as Arrow trees.
- [iceberg.puffin](https://magmalake.dev/s/iceberg/api/puffin.md): Puffin files: the sidecar format Iceberg keeps deletion vectors and sketches in.
- [iceberg.read](https://magmalake.dev/s/iceberg/api/read.md): Reading rows: `TableScan.to_table()` and `to_batches()`.
- [iceberg.scan](https://magmalake.dev/s/iceberg/api/scan.md): Scan planning: which data files a query must read, and which deletes apply.
- [iceberg.schema](https://magmalake.dev/s/iceberg/api/schema.md): `Schema` — an Iceberg struct type with a schema id and identifier fields.
- [iceberg.transforms](https://magmalake.dev/s/iceberg/api/transforms.md): Partition transforms and partition specs.
- [iceberg.types](https://magmalake.dev/s/iceberg/api/types.md): Iceberg data types — primitives, nested types, and their JSON forms.
- [iceberg.update_schema](https://magmalake.dev/s/iceberg/api/update_schema.md): Schema evolution: add columns, rename them, make them optional, widen them.
- [iceberg.util](https://magmalake.dev/s/iceberg/api/util.md): The three things a writer needs from outside itself: the wall clock, a random 64-bit number, and a UUID.
- [iceberg.values](https://magmalake.dev/s/iceberg/api/values.md): Typed single values (`Datum`) and Iceberg's two single-value encodings.
- [iceberg.write](https://magmalake.dev/s/iceberg/api/write.md): Writing data files: Arrow in, Parquet out, a `DataFile` record back.

Native Apache Iceberg: metadata, planning, and rows — the `iceberg` package of iceberg.mojo.

Part of magmalake: data lake building blocks in Mojo.

```mojo
from iceberg.catalog.filesystem import Table

def main() raises:
    var t = Table.load_local("/warehouse/db/orders")
    var rows = t.scan().filter('[">","id",2]').to_table()
    print(rows.to_csv())
```

Reads format versions 1, 2 and 3, and tolerates the parts of v4 the spec
already tells readers to tolerate: metadata, snapshots, partition transforms,
expressions, manifests, scan planning, Puffin deletion vectors, and the data
files themselves — over local files, S3, GCS, Azure or HTTP, from a filesystem
layout or a live REST catalog.

Writes v2 and v3: `create_table`, `append`, `delete_where` (copy-on-write, or
merge-on-read with deletion vectors on v3 and position delete files on v2),
`delete_by_equality`, `overwrite`, `dynamic_partition_overwrite` and
`expire_snapshots`, each committed optimistically against a filesystem layout
or a REST catalog — and schema changes (`UpdateSchema`: add, rename, make
optional, widen) through the same commit paths.
