You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is an example of using [StarRocks](https://docs.starrocks.io/docs/data_source/catalog/iceberg/iceberg_catalog/#rest) to connect, query, modify data from R2 Data Catalog (read-write).
7
+
8
+
## Prerequisites
9
+
10
+
- Sign up for a [Cloudflare account](https://dash.cloudflare.com/sign-up/workers-and-pages).
11
+
-[Create an R2 bucket](/r2/buckets/create-buckets/) and [enable the data catalog](/r2/data-catalog/manage-catalogs/#enable-r2-data-catalog-on-a-bucket).
12
+
-[Create an R2 API token](/r2/api/tokens/) with both [R2 and data catalog permissions](/r2/api/tokens/#permissions).
13
+
- A running [StarRocks](https://www.starrocks.io/) frontend instance. You can use the [all-in-one](https://docs.starrocks.io/docs/quick_start/shared-nothing/#launch-starrocks) docker setup.
14
+
15
+
## Example usage
16
+
17
+
In your running StarRocks instance, run these commands:
18
+
19
+
```sql
20
+
-- Create an Iceberg catalog named `r2` and set it as the current catalog
21
+
22
+
CREATE EXTERNAL CATALOG r2
23
+
PROPERTIES
24
+
(
25
+
"type"="iceberg",
26
+
"iceberg.catalog.type"="rest",
27
+
"iceberg.catalog.uri"="<r2_catalog_uri>",
28
+
"iceberg.catalog.security"="oauth2",
29
+
"iceberg.catalog.oauth2.token"="<r2_api_token>",
30
+
"iceberg.catalog.warehouse"="<r2_warehouse_name>"
31
+
);
32
+
33
+
SET CATALOG r2;
34
+
35
+
-- Create a database and display all databases in newly connected catalog
0 commit comments