All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

R2 SQL - R2 SQL adds JSON functions, EXPLAIN FORMAT JSON, and unpartitioned table support

2mo ago

Source

CloudflareR2 SQL - R2 SQL adds JSON functions, EXPLAIN FORMAT JSON, and unpartitioned table supportcloudflare.com
Snippet from the RSS feed
R2 SQL is Cloudflare's serverless, distributed, analytics query engine for querying Apache Iceberg tables stored in R2 Data Catalog . R2 SQL now supports functions for querying JSON data stored in Apache Iceberg tables, an easier way to parse query plans with EXPLAIN FORMAT JSON , and querying tables without partition keys stored in R2 Data Catalog . JSON functions extract and manipulate JSON values directly in SQL without client-side processing: SELECT json_get_str(doc, 'name' ) AS name , json_get_int(doc, 'user' , 'profile' , 'level' ) AS level , json_get_bool(doc, 'active' ) AS is_active FROM my_namespace.sales_data WHERE json_contains(doc, 'email' ) For a full list of available functions, refer to JSON functions . EXPLAIN FORMAT JSON returns query execution plans as structured JSON for programmatic analysis and observability integrations: npx wrangler r2 sql query " ${ WAREHOUSE } " "EXPLAIN FORMAT JSON SELECT * FROM logpush.requests LIMIT 10;" โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ plan โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ { โ”‚ โ”‚ "name": "CoalescePartitionsExec", โ”‚ โ”‚ "output_partitions": 1, โ”‚ โ”‚ "rows": 10, โ”‚ โ”‚ "size_approx": "310B", โ”‚ โ”‚ "children": [ โ”‚ โ”‚ { โ”‚ โ”‚ "name": "DataSourceExec", โ”‚ โ”‚ "output_partitions": 4, โ”‚ โ”‚ "rows": 28951, โ”‚ โ”‚ "size_approx": "900.0KB", โ”‚ โ”‚ "table": "logpush.requests", โ”‚ โ”‚ "files": 7, โ”‚ โ”‚ "bytes": 900019, โ”‚ โ”‚ "projection": [ โ”‚ โ”‚ "__ingest_ts", โ”‚ โ”‚ "CPUTimeMs", โ”‚ โ”‚ "DispatchNamespace", โ”‚ โ”‚ "Entrypoint", โ”‚ โ”‚ "Event", โ”‚ โ”‚ "EventTimestampMs", โ”‚ โ”‚ "EventType", โ”‚ โ”‚ "Exceptions", โ”‚ โ”‚ "Logs", โ”‚ โ”‚ "Outcome", โ”‚ โ”‚ "ScriptName", โ”‚ โ”‚ "ScriptTags", โ”‚ โ”‚ "ScriptVersion", โ”‚ โ”‚ "WallTimeMs" โ”‚ โ”‚ ], โ”‚ โ”‚ "limit": 10 โ”‚ โ”‚ } โ”‚ โ”‚ ] โ”‚ โ”‚ } โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ For more details, refer to EXPLAIN . Unpartitioned Iceberg tables can now be queried directly, which is useful for smaller datasets or data without natural time dimensions. For tables with more than 1000 files, partitioning is still recommended for better performance. Refer to Limitations and best practices for the latest guidance on using R2 SQL.

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.