Glue Iceberg Rest Api and PyIceberg
Access Glue Iceberg tables via the Iceberg Rest Api
AWS Released silently Iceberg REST-API support. This is a standard API to access iceberg tables on different platforms. More information can be found here https://iceberg.apache.org/concepts/catalog/
PyIceberg is a python library with generic iceberg support. It also supports the rest api. Other tools are pyspark
Example code to use a catalog via the Iceberg Rest API from Glue.
Glue Catalog version
For comparison this is the native glue version in pyiceberg. This uses the boto api.
Output
I’ll add the full debug output here, to show that i only uses the rest api. There are no requests to s3. I run with with the aws credentials with glue and s3 permissions in the environment as AWS_PROFILE.
ListNameSpace
ListTable
Scan Tables
Urls
- https://glue.eu-central-1.amazonaws.com/iceberg/v1/config
- https://glue.eu-central-1.amazonaws.com/iceberg/v1/catalogs/123456789012/namespaces
- https://glue.eu-central-1.amazonaws.com:/iceberg/v1/catalogs/123456789012/namespaces/ibtest/tables
- https://glue.eu-central-1.amazonaws.com/iceberg/v1/catalogs/123456789012/namespaces/ibtest/tables/ibtest1
Curl option
I remembered that curl has a sigv4 option. I tried it with the same iam credentials and the sigv4 sign area of aws:amz:<region>:glue
curl https://glue.eu-central-1.amazonaws.com/iceberg/v1/config --user "$AWS_KEY:$AWS_SEC" --aws-sigv4 "aws:amz:eu-central-1:glue"
Combining this with the urls discovered above shows the output
Get the namespaces
Get the Table Info
Conclusion
With the latest release of Glue you can access Iceberg tables on AWS using the standard iceberg REST_API opening the infrastructure to multiple tools. The only AWS specific call is the signing with sigv4. https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html. This is already used by many tools for the S3 access.
This decouples the code from AWS Specific access and allows you to use more generic tools
Next steps
- Test with more tools (Curl update added)
- Test with the new S3 Tables (iceberg)
- Can we use this with Unity?