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
Copy file name to clipboardExpand all lines: src/content/docs/r2-sql/reference/limitations-best-practices.mdx
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ R2 SQL is designed for querying **partitioned** Apache Iceberg tables in your R2
33
33
34
34
## Supported SQL Clauses
35
35
36
-
R2 SQL supports a limited set of SQL clauses: `SELECT`, `FROM`, `WHERE`, `ORDER BY`, and `LIMIT`. All other SQL clauses are not supported at the moment. New features will be released in the future, keep an eye on this page and the changelog\[LINK TO CHANGE LOG\]for the latest.
36
+
R2 SQL supports a limited set of SQL clauses: `SELECT`, `FROM`, `WHERE`, `ORDER BY`, and `LIMIT`. All other SQL clauses are not supported at the moment. New features will be released in the future, keep an eye on this page for the latest.
37
37
38
38
---
39
39
@@ -56,14 +56,14 @@ R2 SQL supports a limited set of SQL clauses: `SELECT`, `FROM`, `WHERE`, `ORDER
56
56
57
57
```sql
58
58
-- Valid
59
-
SELECTtimestamp, user_id, status
60
-
SELECT*
59
+
SELECTtimestamp, user_id, statusFROM my_table;
60
+
SELECT*FROM my_table;
61
61
62
62
-- Invalid
63
-
SELECT user_id AS uid, timestampAS ts
64
-
SELECTCOUNT(*) FROM events
65
-
SELECTjson_field.propertyFROMtable
66
-
SELECT1AS synthetic_column
63
+
SELECT user_id AS uid, timestampAS tsFROM my_table;
64
+
SELECTCOUNT(*) FROM eventsFROMFROM my_table;
65
+
SELECTjson_field.propertyFROMmy_table;
66
+
SELECT1AS synthetic_columnFROM my_table;
67
67
```
68
68
69
69
---
@@ -128,7 +128,6 @@ SELECT * FROM logs WHERE status = 200 AND user_type = 'premium'
128
128
SELECT*FROM requests WHERE (method ='GET'OR method ='POST') AND response_time <1000
129
129
130
130
--Invalid
131
-
SELECT*FROM events -- Missing time filter
132
131
SELECT*FROM logs WHERE tags[0] ='error'-- Array filtering
133
132
SELECT*FROM requests WHEREmetadata.user_id='123'-- JSON field filtering
134
133
SELECT*FROM events WHERE col_a = col_b -- Column comparison
@@ -141,8 +140,8 @@ SELECT * FROM logs WHERE response_time + latency > 5000 -- Arithmetic
141
140
142
141
### Supported Features
143
142
144
-
-**ASC**: Ascending order (Default)
145
-
-**DESC**: Descending order
143
+
-**ASC**: Ascending order
144
+
-**DESC**: Descending order (Default, on full partition key)
146
145
147
146
### Limitations
148
147
@@ -153,7 +152,6 @@ SELECT * FROM logs WHERE response_time + latency > 5000 -- Arithmetic
153
152
```sql
154
153
SELECT*FROM table_name WHERE ... ORDER BY partitionKey
155
154
SELECT*FROM table_name WHERE ... ORDER BY partitionKey DESC
156
-
SELECT*FROM table_name WHERE ... ORDER BY partitionKey DESC
157
155
```
158
156
159
157
---
@@ -175,7 +173,7 @@ SELECT * FROM table_name WHERE ... ORDER BY partitionKey DESC
0 commit comments