Skip to content

Commit 02bf1b7

Browse files
committed
Add missing methods for table and namespace manipulation
1 parent fe6b6fc commit 02bf1b7

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

mkdocs/docs/api.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ Or, list existing namespaces:
8080
ns = catalog.list_namespaces()
8181
8282
assert ns == [("docs_example",)]
83+
84+
# Load namespace properties
85+
properties = catalog.load_namespace_properties("docs_example")
86+
87+
# Update namespace properties
88+
catalog.update_namespace_properties("docs_example", updates={"owner": "iceberg"})
89+
90+
# Drop a namespace
91+
# catalog.drop_namespace("docs_example")
8392
```
8493

8594
## Create a table
@@ -165,6 +174,17 @@ with catalog.create_table_transaction(identifier="docs_example.bids", schema=sch
165174
update_spec.add_identity("symbol")
166175
167176
txn.set_properties(test_a="test_aa", test_b="test_b", test_c="test_c")
177+
178+
## Register a table
179+
180+
To register a table using existing metadata:
181+
182+
```python
183+
catalog.register_table(
184+
identifier="docs_example.bids",
185+
metadata_location="s3://warehouse/path/to/metadata.json"
186+
)
187+
```
168188
```
169189
170190
## Load a table
@@ -216,6 +236,31 @@ catalog.table_exists("docs_example.bids")
216236

217237
Returns `True` if the table already exists.
218238

239+
## Rename a table
240+
241+
To rename a table:
242+
243+
```python
244+
catalog.rename_table(
245+
from_identifier="docs_example.bids",
246+
to_identifier="docs_example.bids_backup"
247+
)
248+
```
249+
250+
## Drop a table
251+
252+
To drop a table:
253+
254+
```python
255+
catalog.drop_table("docs_example.bids")
256+
```
257+
258+
To drop a table and purge all data and metadata files:
259+
260+
```python
261+
catalog.purge_table("docs_example.bids")
262+
```
263+
219264
## Write to a table
220265

221266
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:

0 commit comments

Comments
 (0)