Unity Iceberg Rest Api and PyIceberg
Access Unity tables via the Iceberg Rest Api
After working with glue catalog in the previous article, i wanted it to test with Unity Catalog. The opensource catalog from DataBricks.
Installing Unity Catalog
I followed the quickstart steps from: https://docs.unitycatalog.io/quickstart/. It needs java 17, my mac installation had 23 installed by default. I used the following with jenv to switch quickly
Install java 17 from brew with jenv
Clone repo and setup java to 17
Start (and build the first):
Use Uniform tables
Unity is not supporting native iceberg yet. But it does support the uniform delta format which can be used with delta and iceberg
To setup the test environment follow: https://docs.unitycatalog.io/usage/tables/uniform/
Rest Api
The iceberg api is available from: http://127.0.0.1:8080/api/2.1/unity-catalog/iceberg/
According the documentation the tables can be used with the following format, but i had to change this
When querying Iceberg REST Catalog for Unity Catalog, tables are identified using the following pattern iceberg.
Code
By default the local unity catalog doesn’t use authentication. I’ll test this later.
Output
Difference
It seems the implementation is slightly different that the glue iceberg catalog and also not fully features.
Only “issue” is that the setup requests a parameter warehouse in the setup. I pass this in the config with "warehouse": "unity"
Where warehouse is the same as catalog.
After that it responds the same as the glue iceberg catalog rest api. I’m able to list the namespace, tables and view the data.
For the full source code, this can be found here: https://github.com/unitycatalog/unitycatalog/blob/main/server/src/main/java/io/unitycatalog/server/service/IcebergRestCatalogService.java
Next
- Writing data
- Trying real iceberg tables
- Comparing functionality off the rest api’s.