Supported REST Catalog APIs for accessing the data
To use the Iceberg data in Cloudera, you must employ the REST client to perform specific operations.
The REST APIs from the specification defined by Apache Iceberg are available in the REST Catalog open API specification. Cloudera currently supports the REST APIs that allow read operations on Iceberg tables:
Retrieving the access token
Retrieving the access token works the same for all supported
endpoints:
[***MY-TOKEN-NAME***]=$(curl -k -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "client_id=[***CLIENT ID***]&client_secret=[***CLIENT SECRET***]&grant_type=client_credentials" "https://[***DATALAKE-LOADBALANCER***]/[***DATALAKE-NAME***]/cdp-share-access/hms-api/icecli/v1/oauth/tokens" | jq -r '.access_token')
Using
the endpoints must be always preceded by retrieving the access token.List Databases: /v1/{prefix}/namespaces
List all namespaces at a certain level, optionally starting from a given parent namespace.
curl -ivk -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer $[***MY-TOKEN-NAME***]" https://[***DATALAKE-LOADBALANCER***]/[***DATALAKE-NAME***]/cdp-share-access/hms-api/icecli/v1/namespaces
Example:
My-token-name=$(curl -k -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "client_id=b9efc3dd-3695-4867-9e4c-523389c8a78b&client_secret=WWpsbFptTXpaR1F0TXpZNU5TMDBPRFkzTFRsbE5HTXROVEl6TXpnNVl6aGhOemhpOjpNRGt5TmpneE1HUXRZak00TmkwMFpqTXhMVGczTTJZdFptTXhOekl6TmpVNFlqazI=&grant_type=client_credentials" "https://apr24-LBInternal-1745472822408-fddbd702bfadbe45.elb.us-west-2.amazonaws.com/apr24-env2-dl/cdp-share-access/hms-api/icecli/v1/oauth/tokens" | jq -r '.access_token')
curl -ivk -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer $My-token-name" https://apr24-LB-my-datalake-load-balancer.elb.us-west-2.amazonaws.com/my-datalake-name/cdp-share-access/hms-api/icecli/v1/namespaces
List Tables: /v1/{prefix}/namespaces/{namespace}/tables
List all table identifiers under the specified namespace.
curl -ivk -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer $[***MY-TOKEN-NAME***]" https://[***DATALAKE-LOADBALANCER***]/[***DATALAKE-NAME***]/cdp-share-access/hms-api/icecli/v1/namespaces/<namespace>/tables
Example:
My-token-name=$(curl -k -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "client_id=b9efc3dd-3695-4867-9e4c-523389c8a78b&client_secret=WWpsbFptTXpaR1F0TXpZNU5TMDBPRFkzTFRsbE5HTXROVEl6TXpnNVl6aGhOemhpOjpNRGt5TmpneE1HUXRZak00TmkwMFpqTXhMVGczTTJZdFptTXhOekl6TmpVNFlqazI=&grant_type=client_credentials" "https://apr24-LB-my-datalake-load-balancer.elb.us-west-2.amazonaws.com/my-datalake-name/cdp-share-access/hms-api/icecli/v1/oauth/tokens" | jq -r '.access_token')
curl -ivk -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer $My-token-name" https://apr24-LB-my-datalake-load-balancer.elb.us-west-2.amazonaws.com/my-datalake-name/cdp-share-access/hms-api/icecli/v1/namespaces/hive_rest_airline_orc/tables
Load Tables: /v1/{prefix}/namespaces/{namespace}/tables/{table}
Load a table from the catalog.
curl -ivk -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer $[***MY-TOKEN-NAME***]" https://[***DATALAKE-LOADBALANCER***]/[***DATALAKE-NAME***]/cdp-share-access/hms-api/icecli/v1/namespaces/<namespace>/tables/icebergtable
Example:
My-token-name=$(curl -k -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "client_id=b9efc3dd-3695-4867-9e4c-523389c8a78b&client_secret=WWpsbFptTXpaR1F0TXpZNU5TMDBPRFkzTFRsbE5HTXROVEl6TXpnNVl6aGhOemhpOjpNRGt5TmpneE1HUXRZak00TmkwMFpqTXhMVGczTTJZdFptTXhOekl6TmpVNFlqazI=&grant_type=client_credentials" "https://apr24-LB-my-datalake-load-balancer.elb.us-west-2.amazonaws.com/my-datalake-name/cdp-share-access/hms-api/icecli/v1/oauth/tokens" | jq -r '.access_token')
curl -ivk -X GET -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer $My-token-name" https://apr24-my-datalake-load-balancer.elb.us-west-2.amazonaws.com/my-datalake-name/cdp-share-access/hms-api/icecli/v1/namespaces/hive_rest_airline_orc/tables/airport_iceberg_external