RussellSpitzer commented on code in PR #17940: URL: https://github.com/apache/iceberg/pull/17940#discussion_r3928343175
########## docs/docs/rest-catalog.md: ########## @@ -0,0 +1,228 @@ +--- +title: "REST Catalog" +--- +<!-- + - Licensed to the Apache Software Foundation (ASF) under one or more + - contributor license agreements. See the NOTICE file distributed with + - this work for additional information regarding copyright ownership. + - The ASF licenses this file to You under the Apache License, Version 2.0 + - (the "License"); you may not use this file except in compliance with + - the License. You may obtain a copy of the License at + - + - http://www.apache.org/licenses/LICENSE-2.0 + - + - Unless required by applicable law or agreed to in writing, software + - distributed under the License is distributed on an "AS IS" BASIS, + - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + - See the License for the specific language governing permissions and + - limitations under the License. + --> + +# Iceberg REST Catalog + +The REST catalog is a client for any catalog service that implements the +[Iceberg REST Catalog API specification](../../rest-catalog-spec.md). Instead of +requiring a catalog-specific client in every engine and language, the catalog +logic lives behind an HTTP API, and a single client implementation works with +any compliant server. + +This page describes how to configure the REST catalog client and the protocol +features it supports. For the protocol definition itself, see the +[spec page](../../rest-catalog-spec.md). To try the protocol locally, the +community publishes the +[`apache/iceberg-rest-fixture`](https://hub.docker.com/r/apache/iceberg-rest-fixture) +Docker image, which serves the REST API backed by an in-memory catalog; see its +[README](https://github.com/apache/iceberg/blob/main/docker/iceberg-rest-fixture/README.md) +for how to run and configure it, or the +[Spark quickstart](../../spark-quickstart.md). + +## Configuring a REST catalog + +A REST catalog needs at minimum a `uri` pointing at the server. Most +deployments also configure authentication; see +[REST auth properties](catalog-properties.md#auth-properties) for the +supported mechanisms (Basic, OAuth2, SigV4, and Google). The full list of +client properties is in +[REST catalog properties](catalog-properties.md#rest-catalog-properties). + +### Java + +```java +import java.util.HashMap; +import java.util.Map; +import org.apache.iceberg.CatalogProperties; +import org.apache.iceberg.rest.RESTCatalog; + +Map<String, String> properties = new HashMap<>(); +properties.put(CatalogProperties.URI, "https://catalog-service/api/catalog"); + +RESTCatalog catalog = new RESTCatalog(); +catalog.initialize("prod", properties); +``` + +Engines that load catalogs through `CatalogUtil.buildIcebergCatalog` select the +REST catalog with `type=rest`. + +### Spark + +```ini +spark.sql.catalog.prod = org.apache.iceberg.spark.SparkCatalog +spark.sql.catalog.prod.type = rest +spark.sql.catalog.prod.uri = https://catalog-service/api/catalog +``` + +See [Spark catalog configuration](spark-configuration.md#catalog-configuration) +for details. + +### Flink + +```sql +CREATE CATALOG prod WITH ( + 'type'='iceberg', + 'catalog-type'='rest', + 'uri'='https://catalog-service/api/catalog' +); +``` + +See the [Flink catalog documentation](flink.md#rest-catalog) for details. + +## Endpoint discovery and server-provided configuration Review Comment: I am not sure this is really required for user facing documentation. It's pretty low level and the user won't really be able to change anything about this anyway. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
