Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions mkdocs/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ ns = catalog.list_namespaces()
assert ns == [("docs_example",)]
```

Next, update the namespace properties.

```python
# Load namespace properties
properties = catalog.load_namespace_properties("docs_example")
# Update namespace properties with additions and removals.
catalog.update_namespace_properties("docs_example", removals={"remove-meee!"}, updates={"owner": "iceberg"})
```

Finally, drop the namespace (if you want!)

```python
# Drop a namespace
catalog.drop_namespace("docs_example")
```

## Create a table

To create a table from a catalog:
Expand Down Expand Up @@ -167,6 +185,17 @@ with catalog.create_table_transaction(identifier="docs_example.bids", schema=sch
txn.set_properties(test_a="test_aa", test_b="test_b", test_c="test_c")
```

## Register a table

To register a table using existing metadata:

```python
catalog.register_table(
identifier="docs_example.bids",
metadata_location="s3://warehouse/path/to/metadata.json"
)
```

## Load a table

There are two ways of reading an Iceberg table; through a catalog, and by pointing at the Iceberg metadata directly. Reading through a catalog is preferred, and directly pointing at the metadata is read-only.
Expand Down Expand Up @@ -216,6 +245,31 @@ catalog.table_exists("docs_example.bids")

Returns `True` if the table already exists.

## Rename a table

To rename a table:

```python
catalog.rename_table(
from_identifier="docs_example.bids",
to_identifier="docs_example.bids_backup"
)
```

## Drop a table

To drop a table:

```python
catalog.drop_table("docs_example.bids")
```

To drop a table and purge all data and metadata files:

```python
catalog.purge_table("docs_example.bids")
```

## Write to a table

Reading and writing is being done using [Apache Arrow](https://arrow.apache.org/). Arrow is an in-memory columnar format for fast data interchange and in-memory analytics. Let's consider the following Arrow Table:
Expand Down