StarRocks
Below is an example of using StarRocks ↗ to connect, query, modify data from R2 Data Catalog (read-write).
- Sign up for a Cloudflare account ↗.
- Create an R2 bucket and enable the data catalog.
- Create an R2 API token with both R2 and data catalog permissions.
- A running StarRocks ↗ frontend instance. You can use the all-in-one ↗ docker setup.
In your running StarRocks instance, run these commands:
-- Create an Iceberg catalog named `r2` and set it as the current catalog
CREATE EXTERNAL CATALOG r2PROPERTIES( "type" = "iceberg", "iceberg.catalog.type" = "rest", "iceberg.catalog.uri" = "<r2_catalog_uri>", "iceberg.catalog.security" = "oauth2", "iceberg.catalog.oauth2.token" = "<r2_api_token>", "iceberg.catalog.warehouse" = "<r2_warehouse_name>");
SET CATALOG r2;
-- Create a database and display all databases in newly connected catalog
CREATE DATABASE testdb;
SHOW DATABASES FROM r2;
+--------------------+| Database |+--------------------+| information_schema || testdb |+--------------------+2 rows in set (0.66 sec)
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark