|
1 | 1 | --- |
2 | 2 | title: Announcing R2 SQL |
3 | 3 | description: Run SQL queries against Apache Iceberg tables in R2 Data Catalog |
4 | | -date: 2025-09-25 |
| 4 | +date: 2025-09-25T13:00:00 |
5 | 5 | products: |
6 | 6 | - r2-sql |
7 | 7 | hidden: true |
8 | 8 | --- |
9 | 9 |
|
10 | 10 | import { LinkCard} from "~/components"; |
11 | 11 |
|
12 | | -Today, we're launching the **open beta** for R2 SQL: A serverless, distributed query engine that can efficiently analyze petabytes of data in Apache Iceberg tables managed by [R2 Data Catalog](/r2/data-catalog). |
| 12 | +Today, we're launching the **open beta** for [R2 SQL](/r2-sql/): A serverless, distributed query engine that can efficiently analyze petabytes of data in [Apache Iceberg](https://iceberg.apache.org/) tables managed by [R2 Data Catalog](/r2/data-catalog). |
13 | 13 |
|
14 | | -## What makes R2 SQL special? |
15 | | -R2 SQL was built from the ground up to take advantage of Cloudflare's globally distributed compute, network and storage. Just some of the innovations and optimizations this enabled us to make include: |
16 | | -- **Intelligent Query Planner**: R2 SQL utilizes R2 Data Catalog's metadata to reduce reading unnecessary files before reading a single byte, reducing I/O overhead and latency. |
17 | | -- **Streaming execution pipeline**: R2 SQL begins processing data immediately as metadata continues to stream to the query planner, minimizing latency and allowing work to be efficiently parallelized. |
18 | | -- **Truly serverless**: There's no infrastructure to manage or compute to scale. Just submit a query and Cloudflare's global compute infrastructure takes care of the rest. |
| 14 | +R2 SQL is ideal for exploring analytical and time-series data stored in R2, such as logs, events from [Pipelines](/pipelines/), or clickstream and user behavior data. |
19 | 15 |
|
20 | | -There's so much more that went into building R2 SQL - check out the [technical deep dive blog post](https://blog.cloudflare.com/r2-sql-deep-dive/) that goes into more details. |
21 | | - |
22 | | -# Give it a try |
23 | | - |
24 | | -Give our[getting started guide](/r2-sql/getting-started) a try. If you already have tables in R2 Data Catalog, running queries is as simple as: |
| 16 | +If you already have a table in R2 Data Catalog, running queries is as simple as: |
25 | 17 |
|
26 | 18 | ```bash |
27 | | -export WRANGLER_R2_SQL_AUTH_TOKEN=<R2_API_TOKEN> |
28 | | - |
29 | | -npx wrangler r2 sql query "YOUR_WAREHOUSE" " |
| 19 | +npx wrangler r2 sql query YOUR_WAREHOUSE " |
30 | 20 | SELECT |
31 | 21 | user_id, |
32 | 22 | event_type, |
33 | | - value, |
34 | | - __ingest_ts |
| 23 | + value |
35 | 24 | FROM events.user_events |
36 | | -WHERE (event_type = 'CHANGELOG' or event_type = 'BLOG') |
37 | | - AND __ingest_ts BETWEEN '2025-09-24T01:00:00Z' AND '2025-09-25T01:00:00Z' |
| 25 | +WHERE event_type = 'CHANGELOG' or event_type = 'BLOG' |
| 26 | + AND __ingest_ts > '2025-09-24T00:00:00Z' |
38 | 27 | ORDER BY __ingest_ts DESC |
39 | | -LIMIT 1000" |
| 28 | +LIMIT 100" |
40 | 29 | ``` |
41 | 30 |
|
42 | | -## Learn more |
43 | | - |
44 | | -<LinkCard |
45 | | - title="Getting started" |
46 | | - href="/r2-sql/getting-started" |
47 | | - description="Learn how to query tables in R2 Data Catalog with R2 SQL" |
48 | | -/> |
49 | | - |
50 | | -<LinkCard |
51 | | - title="SQL Reference" |
52 | | - href="/r2-sql/sql-reference" |
53 | | - description="Learn more about what features are available today" |
54 | | -/> |
| 31 | +To get started with R2 SQL, check out our [getting started guide](/r2-sql/get-started/) or learn more about supported features in the [SQL reference](/r2-sql/reference/sql-reference/). For a technical deep dive into how we built R2 SQL, read our [blog post](https://blog.cloudflare.com/r2-sql-deep-dive/). |
0 commit comments