SQL: struct support#586
Conversation
✅ Deploy Preview for rp-cloud ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| :learning-objective-2: Query nested fields using ROW field-access syntax | ||
| :learning-objective-3: Recognize and resolve cyclic-reference errors | ||
|
|
||
| When a glossterm:topic[]'s schema includes nested Protobuf or Avro message types, you can map those nested structures as SQL `ROW` columns instead of opaque JSON. This makes nested fields queryable by name, includable in projections, and usable in `WHERE`, `GROUP BY`, and `ORDER BY` clauses, without parsing JSON at query time. |
There was a problem hiding this comment.
That may be a nitpick, but stating that we are mapping as SQL ROW columns is not entirely true.
In PostgreSQL, a ROW is an anonymous record, in which you cannot explicitly set the sub-field names (they contain some generic f1, f2, f<n>... names that you cannot change).
What we do in the COMPOUND mapping is we actually create a User-Defined type, and set the names of the fields according to the schema.
Not sure if that's something that we want to explicitly state here, or maybe the ROW meaning here is something other than PostgreSQL ROW.
There was a problem hiding this comment.
Changed to
When a glossterm:topic[]'s schema includes nested Protobuf, Avro, or JSON message types, you can map those nested structures as user-defined types (UDTs) with named fields, queryable using SQL
ROWfield-access syntax, instead of opaque JSON. This makes nested fields queryable by name, includable in projections, and usable inWHERE,GROUP BY, andORDER BYclauses, without parsing JSON at query time.
@mattschumpert do you have a preference on whether we explicitly mention user defined types?
There was a problem hiding this comment.
No idea. I defer to @pkonrad1229
There was a problem hiding this comment.
I don't see an issue with why we shouldn't. Any user can check that for themselves by using e.g. pg_typeof function.
| } | ||
| ---- | ||
|
|
||
| Redpanda SQL maps the table with three columns: `order_id` (text), `customer` (a `ROW` with fields `customer_id`, `name`, and `region`), and `amount` (double precision). |
There was a problem hiding this comment.
ditto here:
a
ROWwith fields
We may also say something along the lines of:
a structure/UDT with fields
| (1 row) | ||
| ---- | ||
|
|
||
| === Use implicit tuple syntax |
There was a problem hiding this comment.
I'm late to the party, as this was not modified in this PR :D I believe it's worth noting that the implicit tuple syntax works only when there are two or more expressions
There was a problem hiding this comment.
@pkonrad1229 Hm, that may have just surfaced as something related based on the Claude Code research... is it ok to leave on this page? The explanation is currently under the first sectionn https://deploy-preview-586--rp-cloud.netlify.app/redpanda-cloud/reference/sql/sql-data-types/row/#syntax
There was a problem hiding this comment.
yeah sure, it's okay to leave it here. I only meant to say that we follow PostgreSQL rules for the ROW constructor, where the implicit syntax works only when there's more than 1 expression, so:
(col)returnscolextression(col1,col2)returns a ROW/record of those two columns
Postgres mentions this implicit syntax rule directly in their docs .
27ea3c1 to
e1f3231
Compare
|
|
||
| * Enable Redpanda SQL on your Redpanda Bring Your Own Cloud (BYOC) cluster. See xref:sql:get-started/deploy-sql-cluster.adoc[Enable Redpanda SQL]. | ||
| * Connect to Redpanda SQL with `psql` or another PostgreSQL client. See xref:sql:connect-to-sql/index.adoc[Connect to Redpanda SQL]. | ||
| * The topic has a schema registered in glossterm:schema-registry[Schema Registry]. The schema includes one or more nested message types. |
There was a problem hiding this comment.
Shouldn't we be specifying that the schema is registered for the topic using the TopicNamingStrategy naming convention @pkonrad1229 @kbatuigas ? You have to name it correctly for this to work, right? If people are not already familiar with this in SR we should educate them (point them to this naming convention)
There was a problem hiding this comment.
Yes, the correct schema_subject is required for this to work. Not deeply familiar with the SR side, but from Oxla's perspective, the underlying naming strategy doesn't matter; only that the resolved subject matches a registered one. Two cases:
- SR uses Confluent's default TopicNameStrategy →
schema_subjectcan be omitted; Oxla defaults to<topic>-value. - SR uses a different strategy →
schema_subjectmust be set explicitly in theCREATE TABLEoptions.
There was a problem hiding this comment.
Side note: this comment is broad, not specific to nested fields. It's general CREATE TABLE + Kafka topic behavior. Question whether we should explain it inline here or just link to the CREATE TABLE reference docs where schema_subject semantics belong.
| ---- | ||
| CREATE TABLE default_redpanda_catalog=>orders WITH ( | ||
| topic = 'orders', | ||
| schema_subject = 'orders-value', |
There was a problem hiding this comment.
Is schema_subject required or optional?
If it's required then maybe the naming convention is not mandatory @pkonrad1229 ?
There was a problem hiding this comment.
From what I see, it's optional, and when omitted, Oxla resolves the subject to <topic>-value, so in this example it could be left out, and the outcome would be the same
| CREATE TABLE default_redpanda_catalog=>orders WITH ( | ||
| topic = 'orders', | ||
| schema_subject = 'orders-value', | ||
| struct_mapping_policy = 'COMPOUND' |
There was a problem hiding this comment.
It says below this is optional. Comments should explain the same here (what is optional vs not)
|
|
||
| | `JSON` | ||
| | The topic schema is recursive, or you prefer flexible access through JSON functions. | ||
| | Recursive types supported; fields are untyped until extracted with JSON functions. Queries that span the Redpanda topic and its linked Iceberg table do not align cleanly, because Iceberg always exposes nested structures as typed columns. |
There was a problem hiding this comment.
@grzebiel this warning would imply something very important to alert the user of (we dont really support querying iceberg topics with recursive types). However, I don't think this is the correct message here (at least not always), because Iceberg topics has a special handling encoding recursive Protobuf Struct fields as a JSON string in the Iceberg table. SO for protobuf, we do have a story for recursive fields (at least in the protobuf case).
So, how should this be adjusted.
| == Next steps | ||
|
|
||
| * xref:sql:query-data/query-streaming-topics.adoc[Query streaming topics]: query a topic without Iceberg history. | ||
| * xref:sql:query-data/query-iceberg-topics.adoc[Query Iceberg topics]: query the Iceberg-translated history of a topic. Use `struct_mapping_policy = 'COMPOUND'` so nested fields align between the Redpanda topic and the linked Iceberg table. |
There was a problem hiding this comment.
@kbatuigas wrong wording IMO. 'Query a topic with Iceberg history' is better.
What's here is technically incorrect because it makes it sound like you're ONLY querying the iceberg portion (tail). but in fact this link is to how to do a bridge query that queries both the live streaming data and iceberg history.
We should ensure we correct this everywhere.
micheleRP
left a comment
There was a problem hiding this comment.
docs-team-standards review
Critical (must fix before merging to main)
-
Three unresolved
// TODOmarkers in the source, two of which are already answered in the review thread.query-nested-fields.adoc:23—// TODO: Confirm TopicNameStrategy requirement. @pkonrad1229 answered in the review thread: "the underlying naming strategy doesn't matter; only that the resolved subject matches a registered one. (1) Confluent default →schema_subjectcan be omitted, Oxla defaults to<topic>-value. (2) other strategy →schema_subjectmust be set explicitly." Bake this answer into the body (and into the Prerequisites bullet that currently sits above the TODO).query-nested-fields.adoc:42—// TODO: Confirm schema_subject required when struct_mapping_policy=COMPOUND. Same SME reply applies:schema_subjectis optional; resolves to<topic>-valueby default. The bullet at line 41 currently only documentsstruct_mapping_policydefaulting toCOMPOUND— add a parallel bullet forschema_subject.row.adoc:239—// TODO: SME — confirm whether nested array-of-struct access (...) works at GA, and whether wildcard expansion on an empty ROW (`(ROW()).*`) is supported. Tracked under OXLA-9444 and OXLA-9431.Still genuinely open; convert to a follow-up doc ticket so it doesn't ship as a comment.
-
SME terminology fix only partly applied — "ROW columns" framing still in two attributes/sections.
- @pkonrad1229 pushed back on "SQL
ROWcolumns" framing in the review thread: "What we do in the COMPOUND mapping is we actually create a User-Defined type… the page body should say 'a structure/UDT with fields'." The body ofquery-nested-fields.adocwas rewritten to use "user-defined types (UDTs)" — good. - Still leaking the old framing in two places:
query-nested-fields.adoc:2(:description:):Map a topic with nested Protobuf, Avro, or JSON fields to SQL ROW columns, then query those fields directly.row.adoc:243(See also):xref:reference:sql/sql-statements/create-table.adoc[CREATE TABLE]: maps a Redpanda topic to a SQL table. Use`struct_mapping_policy = 'COMPOUND'`to surface nested topic fields as ROW columns.
- Fix: match the body's wording. For example, description →
Map a topic's nested fields to typed SQL columns and query them by name.; row.adoc:243 →...to surface nested topic fields as user-defined types accessible with ROW field-access syntax.
- @pkonrad1229 pushed back on "SQL
Suggestions (should consider)
-
Open thread (@mattschumpert) —
schema_subjectand TopicNameStrategy education.- The review thread has an open question from @mattschumpert about whether the page should explicitly explain Schema Registry's TopicNameStrategy convention. @pkonrad1229 clarified the behavior (Oxla just resolves the subject; default is
<topic>-value). Worth folding that explanation into the Prerequisites or the Map-the-topic-as-a-SQL-table section, even just a one-sentence "If your Schema Registry uses Confluent's default TopicNameStrategy, you can omitschema_subject— Redpanda SQL resolves it to<topic>-value."
- The review thread has an open question from @mattschumpert about whether the page should explicitly explain Schema Registry's TopicNameStrategy convention. @pkonrad1229 clarified the behavior (Oxla just resolves the subject; default is
-
Open thread (@mattschumpert) — Iceberg + recursive types warning may be technically wrong for Protobuf.
- On line 99 of
query-nested-fields.adoc, the warning saysCOMPOUNDcannot map recursive types. @mattschumpert flagged that the related Iceberg behavior is more nuanced — Protobuf recursive fields are encoded as JSON strings in Iceberg, so there is a story for them. This wasn't fully resolved in the thread. Worth a follow-up with @grzebiel (who was tagged) before this lands inmain.
- On line 99 of
-
Wording cleanup carryover ("Query an Iceberg topic" → "Query a topic with Iceberg history").
- @mattschumpert asked for this rename to be applied "everywhere." The new page uses the updated wording (lines 127, 137). The nav still has
*** xref:sql:query-data/query-iceberg-topics.adoc[Query Iceberg Topics](line 357) — pre-existing, not modified by this PR, but consistent with what mattschumpert wants. Either update it now (since nav is already in this diff) or track it as a follow-up.
- @mattschumpert asked for this rename to be applied "everywhere." The new page uses the updated wording (lines 127, 137). The nav still has
f3a6858 to
f945fff
Compare
|
|
||
| === Access by name | ||
|
|
||
| For composite columns with declared field names — for example, columns mapped from a topic with `struct_mapping_policy = 'COMPOUND'` (see xref:reference:sql/sql-statements/create-table.adoc[CREATE TABLE]) — access fields by their declared names: |
There was a problem hiding this comment.
| For composite columns with declared field names — for example, columns mapped from a topic with `struct_mapping_policy = 'COMPOUND'` (see xref:reference:sql/sql-statements/create-table.adoc[CREATE TABLE]) — access fields by their declared names: | |
| For composite columns with declared field names, for example, columns mapped from a topic with `struct_mapping_policy = 'COMPOUND'` (see xref:reference:sql/sql-statements/create-table.adoc[CREATE TABLE]), access fields by their declared names: |
micheleRP
left a comment
There was a problem hiding this comment.
left 3 little style suggestions!
Co-authored-by: Michele Cyran <michele@redpanda.com>
Co-authored-by: Michele Cyran <michele@redpanda.com>
2730222 to
3b589b0
Compare
* Migrate SQL docs (#521) * Add converted SQL reference files * Duplicate file * Add index files * Add SQL reference to Cloud nav * Move reference pages to reference module * Convert remaining docs * Add placeholder index files * Cleanup * Move SQL section after RPCN * Continue cleanup using plugin audit and review * External links open in new window * Minor edit to trigger deploy preview * Migrate degraded state doc * Minor style edits * Address drift from Oxla changes since mid-Oct 2025 * Include CREATE TABLE and DROP changes * Update existing pages with placeholders for pages to be created * Another pass at style fixes * Missing TODO * Add remaining new reference pages to address doc drift * Remove Oxla storage compression references * Remove INSERT/UPDATE/DELETE from psycopg2 supported features * Remove Oxla-specific reasons from java-jdbc unsupported list * Remove DELETE/UPDATE references from php-pdo rowCount * Remove CREATE TABLE/INSERT example from select.adoc Assume that a student_data table is already created and populated with data * Remove table duplication TIP * Fix clumped "SELECTstatement" * Add missing Venn diagrams to JOIN pages * Inconsistent formatting with function names and parentheses * Incorrect COUNT logic with HAVING * Add NULLS FIRST/LAST, fix interval sorting * Replace CREATE TABLE oxlafunctions example in offset.adoc Redpanda SQL does not support CREATE TABLE without an external catalog Example assumes precreated salaryemp table * Unrelated "employees" text * Move column compatibility note to set-operations index Column type compatibility and flexible ordering applies to all set operations (UNION, INTERSECT, EXCEPT) * Both ROWS and RANGE frame modes are supported * Add GEOMETRY/GEOGRAPHY * Create sql-operators section with full operator list * timestamp-with-time-zone formatting * Remove internal memory representation for date type * Add month and day conversion note * Remove internal memory representation from bool type * System catalogs disambiguation note and 7 new pg_* pages * Fix nav * Move bitwise operators * Double check SQL examples and outputs * Remove unix_macros * Reorganize math and trig function pages * Implement some deferred fixes related to old Oxla examples * Fix anchors in xrefs * Apply QA checklist first pass across SQL reference docs Run 11-point QA checklist against all migrated SQL pages (148 files). Fixes applied: remove "Please note" phrasing, fix "here" link text, replace future tense output descriptions with present tense, simplify "allows/enables you to" constructions, remove minimizing language, fix wordy instructions, add missing admonition punctuation, replace verbose output lead-ins, remove "etc.", normalize positional references, and update stale PostgreSQL doc links to /docs/current/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Person 4 edits, including future tense, passive voice * more Person 4 edits * Person 4 edits * Parallelize :description: metadata for SQL language client pages Standardize the Java, PHP, and Python connector pages on the same imperative "Connect to Redpanda SQL from <language> using <tool>" template already used by the C# page and the parent index page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Apply Feediver1 review suggestions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Apply pending PR suggestion comments Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Minor edit - statements index * keywords.adoc - move in nav tree, make table more scannable * alter-table minor edit * create-redpanda-catalog: Improve Options section * create-storage minor edit * Improve CREATE TABLE reference page clarity Clarify NOTE about CREATE TABLE behavior, convert multi-value option descriptions to lists for scannability, and rename ambiguous example heading. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * select: review fixes * set-show: review fixes * show-tables minor edit * show-nodes: review fixes * describe: review fixes * sql-statements review pass * from - review pass * Minor edit * set-operations: review fixes * More review fixes for sql-clauses * other-functions review fixes * Normalize QA fixes * Apply edits based on doc team review * Standardize "To do X, run:" * Structural improvements * Sweep for passive voice * Person 2 style review: aggregate, window, JSON functions Style fixes across 31 files: - Future tense → present tense ("will return" → "returns") - Wordy instructions ("lets you" → direct verb) - Awkward phrasing ("Here's how" → cleaner alternatives) - First person ("we're going to" → "This example") - Passive "It" patterns in tables → active voice - Positional references ("the above query" → "Output:") - Typo fix ("ouput" → "output") Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Pass to standardize QA * Apply suggestions from review * Minor edits --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: micheleRP <michele@redpanda.com> Co-authored-by: Joyce Fee <joyce@redpanda.com> Co-authored-by: JakeSCahill <jake@redpanda.com> * SQL GA nav (#572) * SQL GA nav * DOC-1993: Move Redpanda Catalogs page to sql module under Query data Relocates redpanda-catalogs.adoc from modules/reference/pages/sql/ to modules/sql/pages/query-data/, adds the entry under SQL > Query data in nav.adoc, removes the old entry from Reference > Redpanda SQL Reference, and updates the cross-link in system-catalogs/index.adoc. Structural-only; no content changes (content rewrite is in DOC-2049). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add stub pages to nav * Names sweep * Minor style edit for list items * Revert default_redpanda_catalog rename * SQL: bytea support (#585) * Add bytea reference * Apply suggestions from SME review * Update modules/reference/pages/sql/sql-data-types/bytea.adoc Co-authored-by: Michele Cyran <michele@redpanda.com> * Apply suggestions from doc review * Reorganize SQL reference nav --------- Co-authored-by: Michele Cyran <michele@redpanda.com> * SQL overview (#573) * Draft SQL overview rewrite * DOC-2049: Apply v1 Iceberg scope and Postgres positioning to overview and catalogs Tightens the PostgreSQL framing in the overview (compatible query engine implementing the Postgres wire protocol and a Postgres-based dialect, not a full Postgres database). Aligns Iceberg references with the v1 product scope: only Iceberg tables created from Iceberg-enabled Redpanda topics are queryable; no external Iceberg lakehouses or REST catalogs. Collapses the overview's "Query Iceberg tables" and "Bridge queries" sections into "Query Iceberg topics". Rewrites the Redpanda Catalogs page with the named-collection-of-source-data framing, leads with default_redpanda_connection auto-creation, and adds a storage > catalog > tables hierarchy. Replaces the prior CREATE-flow walkthrough with a smaller demo using default_redpanda_connection. Per PM SME 2026-05-07. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add TODO to flesh out sql v pg * Move why RP SQL up * Minor edits * Review pass * Change to default_redpanda_catalog * Tweak overview learning objectives * Review pass * Intro rephrase * Remove tables not describing meaningful differences with Postgres * Clarify Iceberg benefit of querying data outside of topic retention * Minor edit * Apply suggestions from SME feedback * Apply suggestions from PM review * Minor edit * Apply suggestions from code review Co-authored-by: Michele Cyran <michele@redpanda.com> * Apply suggestions from review --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Michele Cyran <michele@redpanda.com> * SQL GA - Get started (#571) * Add quickstart draft * Add deploy doc (use case 1) * Add to nav * Remove create kafka source * Move show/inspect statements to deploy doc * DOC-1856: Apply 9-node scale cap, admin framing, and GRANT mini-step Updates the Enable Redpanda SQL page so the horizontal-scaling range is 1 to 9 nodes (down from 1 to 12) per the PM SME 2026-05-07. Adds a TODO on the Disable Redpanda SQL section listing the specific behaviors to confirm with engineering before publication: what state is purged, what is deleted from object storage, the effect on topic and Schema Registry data, in-flight query error behavior, and re-enable semantics. Updates the quickstart so it explicitly targets an admin who can view the SQL connection details in the Cloud Console, and adds an optional admin-run mini-section showing how to grant a non-admin user SELECT access on a Redpanda SQL table. Includes a TODO referencing qa-questions.md #21 to refine the role/grant example once engineering confirms whether the SQL GRANT statement alone enforces per-user table access or whether an additional ACL/Kafka-side step is required. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Update modules/sql/pages/get-started/sql-quickstart.adoc Co-authored-by: Andrew Hsu <xuzuan@gmail.com> * Change quickstart path to use UI to produce instead of rpk * Add deployment/connection UI updates * Apply suggestions from SME * Review pass * Add wire protocol option when producing via Console * Edits per SME input * Apply suggestions from SME review * Use JSON in quickstart * Add SQL deployment UI changes * schema subject is optional (default to topic name strategy) * Apply suggestions from code review Co-authored-by: Joyce Fee <102751339+Feediver1@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Andrew Hsu <xuzuan@gmail.com> Co-authored-by: Joyce Fee <102751339+Feediver1@users.noreply.github.com> * SQL: OIDC and access management (#580) * Draft OIDC content * Update draft with source findings and TODO * Review pass * Review pass * Add reference docs for GRANT, REVOKE, ROLE/USER * Preference for USER instead of ROLE * Review pass * Move Connect with OIDC up in nav * Clarify "deny-all" * Change name and title to broaden scope * Update user names * Add learning objectives * Apply suggestions from SME review * Apply suggestions from SME review * Review pass * SQL: Query topics (#574) * Start query RP topics doc * DOC-1990: Move query directory and rewrite streaming-topics how-to Renames modules/sql/pages/query/ to modules/sql/pages/query-data/ and renames the streaming-topic how-to from query-redpanda-topics.adoc to query-streaming-topics.adoc to match the SQL GA IA. Retitles the page "Query streaming topics" and reframes the description and learning objectives around live streaming data; bridge-query and Iceberg content stays out of this page (DOC-2006 owns the Iceberg-topics how-to). Adds a pointer to the Iceberg topics how-to under the intro and lists it under Next steps. Updates the enable-prereq xref to point to the Enable Redpanda SQL page. Drops the CREATE REDPANDA CATALOG link from Next steps to align with the v1 framing that users do not typically create their own Redpanda catalog. Reframes the Query data index page description for v1 Iceberg scope (live and historical data in Redpanda topics; no external Iceberg lakehouse). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Change rp connection to catalog * Add wire protocol option * schema_subject required * Review pass * Review pass * Address review comments * Add info on redpanda and redpanda_raw structs * Review pass * Adjust column widths --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * SQL: Auto union Iceberg and Redpanda topic (#575) * Start reference update for SQL / Iceberg catalog * Draft bridge queries doc * Update query-iceberg-topics per SME feedback * Add new iceberg catalog statements * Clarify Iceberg benefit of querying data aged out of topic retention * Links to Iceberg catalog docs * Update example names * Update based on new-features list * Sync options from source * Apply suggestions from SME feedback * Apply suggestions * Note about default schema * Update page title * Reframe per SME input * Remove TODO * SQL: struct support (#586) * Draft struct support reference * How to query structs/nested fields * Review pass * Apply suggestions from SME review * Apply suggestions from SME review * Apply suggestions from code review Co-authored-by: Michele Cyran <michele@redpanda.com> * Review pass * Apply suggestions from code review Co-authored-by: Michele Cyran <michele@redpanda.com> * Apply suggestions --------- Co-authored-by: Michele Cyran <michele@redpanda.com> * SQL: OOM (#584) * Start OOM doc draft * Review pass * Capitalization * Rename file * Update page attributes * Rename and structure doc per SME feedback * Apply suggestions from review * Apply suggestions from code review Co-authored-by: Michele Cyran <michele@redpanda.com> --------- Co-authored-by: Michele Cyran <michele@redpanda.com> * SQL: Expand virtual tables reference, add SHOW/DESCRIBE for new objects (#590) * Expand virtual tables reference, add SHOW/DESCRIBE for new objects * Title case * Review pass * Apply suggestions from SME review * Fix nav * Apply suggestion from @micheleRP Co-authored-by: Michele Cyran <michele@redpanda.com> * Apply suggestions from review * Update modules/reference/pages/sql/information-schema.adoc Co-authored-by: Michele Cyran <michele@redpanda.com> * Apply suggestions from review --------- Co-authored-by: Michele Cyran <michele@redpanda.com> * SQL: What's New + landing page + style sweep (#597) * Built out SQL landing page * Add SQL to What's New in Cloud * Page title capitalization * Add catalog qualifier * Backticks pass * Edit landing page * Remove index auto page layout * Apply suggestions from code review Co-authored-by: Michele Cyran <michele@redpanda.com> * Apply suggestions from review; sweep * Update modules/get-started/pages/whats-new-cloud.adoc Co-authored-by: Michele Cyran <michele@redpanda.com> * Lowercase subsection headings and xref labels per PG convention - numeric.adoc: H2 subsections use backticked-lowercase type names (`int` type, `bigint` type, etc.) to match numeric-data-type-aliases.adoc. - create-table.adoc, query-nested-fields.adoc: xref labels for type pages (ROW, JSON) now use lowercase backticked form. - aggregate-functions/index.adoc, aggregate-functions/statistics/index.adoc, window-functions/index.adoc: function-name xref labels lowercased to backticked function-call form (sum() instead of SUM, regr_avgx() instead of REGR_AVGX, etc.). DISTINCT xref label preserved as uppercase (SQL keyword, not a function). - substring.adoc, position.adoc: cross-reference labels for substr and strpos lowercased. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * DOC-2207: Document SELECT DISTINCT Add a SELECT DISTINCT section to select.adoc covering the supported form and the unsupported PostgreSQL-specific DISTINCT ON form. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Minor edit * Consolidate substr and substring * Uppercase keyword-syntax and conditional functions per PG/CockroachDB convention Function-like operators that use SQL keyword syntax (EXTRACT, POSITION, SUBSTRING, SUBSTR) and conditional expressions (COALESCE, NULLIF, GREATEST, LEAST) get UPPERCASE in H1, body prose, and xref labels, matching how PostgreSQL and CockroachDB docs classify them. Regular call-syntax functions (sum, count, avg, abs, log, concat, length, etc.) stay lowercase. SQL keyword DISTINCT stays uppercase. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add missing index page --------- Co-authored-by: Michele Cyran <michele@redpanda.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Apply suggestions from code review Co-authored-by: Michele Cyran <michele@redpanda.com> * Address PR 570 review comments - sql/index.adoc: rewrite with AsciiDoc list-continuation format and align order/contents with nav.adoc, adding Operators, System Catalogs, System Virtual Tables, and Transactions entries (per micheleRP). - starts-with.adoc: reconcile the prose, INSERT, and results table for the empty-string-second-argument case. The example uses '' (not an omitted argument or NULL), so update the special-case bullet, section heading, intro, and results-table empty-string row to match (per coderabbitai). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Suggestions from auto review * Audit pass * Apply nav order suggestion * Add new gloss terms * SQL schema reference page rewrite * Minor edit * Nav title case * Update Cloud docs landing page to component-home-v3 (#578) * Update Cloud docs landing page to component-home-v3 Migrates Cloud docs landing page to use the new component-home-v3 layout with configurable content via page attributes. ## Deploy Section - :page-deploy-title: Section heading - :page-deploy-N-title/desc/link/icon: Card content (up to 3) ## Popular Topics Section - :page-popular-title: Section heading - :page-popular-N-title/desc/link/icon: Card content (up to 4) ## Labs Section - :page-labs-title: Section heading - :page-labs-link: Link to all labs - :page-labs-N-title/link: Individual lab links ## Stats Bar - :page-stats: Pipe-separated stats with ;; delimiter Related: redpanda-data/docs-ui#376 * Update component xrefs for unified navigation - Updated xrefs and includes: ROOT → streaming - Updated xrefs: redpanda-connect → connect This allows cloud-docs to correctly include single-sourced content from the renamed streaming component. * Rename Redpanda Self-Managed to Redpanda Streaming Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix cloud landing page hero - add missing page-layout and hero-description Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add product-name attribute for single-sourced content Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Update product-name attributes with clear naming - product-name: Redpanda Streaming (for self-managed references) - cloud-product-name: Redpanda Cloud (for cloud references) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove local product-name attributes (now in shared branch) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Rename page-header-data to component-metadata and remove section field - More accurate name: component-level metadata, not page-level - Remove section field (deprecated - breadcrumbs use page-navigation config) - Update Cloud component configuration Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Update Cloud landing page: hero text, remove deploy section, update labs - Hero: Add "Streaming, Connect, and SQL built in" to clarify offerings - Remove "Get started with Redpanda Cloud" deploy section per PM feedback - Update labs links to use Antora resource IDs (labs:ai-agents:langchain-agent.adoc, etc.) - All labs are Cloud-compatible (have page-cloud: true attribute) - Decision matrix remains for Serverless vs BYOC choice Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix mcp-setup xref to use correct module Change xref:home:streaming:mcp-setup.adoc to xref:home:ROOT:mcp-setup.adoc Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Migrate SQL docs (#521) * Add converted SQL reference files * Duplicate file * Add index files * Add SQL reference to Cloud nav * Move reference pages to reference module * Convert remaining docs * Add placeholder index files * Cleanup * Move SQL section after RPCN * Continue cleanup using plugin audit and review * External links open in new window * Minor edit to trigger deploy preview * Migrate degraded state doc * Minor style edits * Address drift from Oxla changes since mid-Oct 2025 * Include CREATE TABLE and DROP changes * Update existing pages with placeholders for pages to be created * Another pass at style fixes * Missing TODO * Add remaining new reference pages to address doc drift * Remove Oxla storage compression references * Remove INSERT/UPDATE/DELETE from psycopg2 supported features * Remove Oxla-specific reasons from java-jdbc unsupported list * Remove DELETE/UPDATE references from php-pdo rowCount * Remove CREATE TABLE/INSERT example from select.adoc Assume that a student_data table is already created and populated with data * Remove table duplication TIP * Fix clumped "SELECTstatement" * Add missing Venn diagrams to JOIN pages * Inconsistent formatting with function names and parentheses * Incorrect COUNT logic with HAVING * Add NULLS FIRST/LAST, fix interval sorting * Replace CREATE TABLE oxlafunctions example in offset.adoc Redpanda SQL does not support CREATE TABLE without an external catalog Example assumes precreated salaryemp table * Unrelated "employees" text * Move column compatibility note to set-operations index Column type compatibility and flexible ordering applies to all set operations (UNION, INTERSECT, EXCEPT) * Both ROWS and RANGE frame modes are supported * Add GEOMETRY/GEOGRAPHY * Create sql-operators section with full operator list * timestamp-with-time-zone formatting * Remove internal memory representation for date type * Add month and day conversion note * Remove internal memory representation from bool type * System catalogs disambiguation note and 7 new pg_* pages * Fix nav * Move bitwise operators * Double check SQL examples and outputs * Remove unix_macros * Reorganize math and trig function pages * Implement some deferred fixes related to old Oxla examples * Fix anchors in xrefs * Apply QA checklist first pass across SQL reference docs Run 11-point QA checklist against all migrated SQL pages (148 files). Fixes applied: remove "Please note" phrasing, fix "here" link text, replace future tense output descriptions with present tense, simplify "allows/enables you to" constructions, remove minimizing language, fix wordy instructions, add missing admonition punctuation, replace verbose output lead-ins, remove "etc.", normalize positional references, and update stale PostgreSQL doc links to /docs/current/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Person 4 edits, including future tense, passive voice * more Person 4 edits * Person 4 edits * Parallelize :description: metadata for SQL language client pages Standardize the Java, PHP, and Python connector pages on the same imperative "Connect to Redpanda SQL from <language> using <tool>" template already used by the C# page and the parent index page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Apply Feediver1 review suggestions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Apply pending PR suggestion comments Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Minor edit - statements index * keywords.adoc - move in nav tree, make table more scannable * alter-table minor edit * create-redpanda-catalog: Improve Options section * create-storage minor edit * Improve CREATE TABLE reference page clarity Clarify NOTE about CREATE TABLE behavior, convert multi-value option descriptions to lists for scannability, and rename ambiguous example heading. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * select: review fixes * set-show: review fixes * show-tables minor edit * show-nodes: review fixes * describe: review fixes * sql-statements review pass * from - review pass * Minor edit * set-operations: review fixes * More review fixes for sql-clauses * other-functions review fixes * Normalize QA fixes * Apply edits based on doc team review * Standardize "To do X, run:" * Structural improvements * Sweep for passive voice * Person 2 style review: aggregate, window, JSON functions Style fixes across 31 files: - Future tense → present tense ("will return" → "returns") - Wordy instructions ("lets you" → direct verb) - Awkward phrasing ("Here's how" → cleaner alternatives) - First person ("we're going to" → "This example") - Passive "It" patterns in tables → active voice - Positional references ("the above query" → "Output:") - Typo fix ("ouput" → "output") Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Pass to standardize QA * Apply suggestions from review * Minor edits --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: micheleRP <michele@redpanda.com> Co-authored-by: Joyce Fee <joyce@redpanda.com> Co-authored-by: JakeSCahill <jake@redpanda.com> * SQL GA nav (#572) * SQL GA nav * DOC-1993: Move Redpanda Catalogs page to sql module under Query data Relocates redpanda-catalogs.adoc from modules/reference/pages/sql/ to modules/sql/pages/query-data/, adds the entry under SQL > Query data in nav.adoc, removes the old entry from Reference > Redpanda SQL Reference, and updates the cross-link in system-catalogs/index.adoc. Structural-only; no content changes (content rewrite is in DOC-2049). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add component-whats-new attributes for SQL feature * Fix SQL What's New link to use full component prefix * Add page-level What's New attributes for cloud home page - Duplicate component-whats-new attributes as page-whats-new - page-whats-new displays on cloud home page - component-whats-new displays on data-platform aggregation page - Both point to same SQL content * Remove duplicate page-role attribute from cloud home page Only page-layout is needed; page-role is redundant as the layout automatically sets the correct role class. * Add component-specific AI suggestions for chat drawer Defines 4 cloud-specific AI suggestion questions that appear in the Ask AI chat drawer when viewing Cloud documentation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Restructure cloud landing page and fix SQL nav xrefs - Add component cards section (Streaming, Connect, SQL) with NEW and BYOC badges - Add deployment cards section (Serverless, BYOC, Dedicated) - Remove What's New, Features, Labs, and Path comparison sections - Comment out SQL nav items for pages that don't exist yet - Keep only existing SQL pages active in navigation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix component name from ROOT to streaming in includes * Fix broken includes: salesforce inputs path and cloud-topics placeholder * Add stub pages for salesforce_cdc and salesforce_graphql inputs * Add page-aliases to salesforce stub pages for xref resolution * Enable parent context navigation cards Add page-use-parent-context flag to enable hierarchical navigation with parent context cards in the UI. This shows the Data Platform umbrella in the product selector and the Cloud card in navigation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Remove unused page-use-parent-context flag * Update component color to match design system Changed from #0ea5e9 to #1D4ED8 (Cloud blue from color wheel). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Fix home page review feedback - Replace em dashes with commas in descriptions - Change lock icon to book (supported v3 icon) - Use active voice in component and popular descriptions - Soften marketing claims (10x faster → high-performance, 99.99% SLA → enterprise SLA) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix unescaped attributes in AsciiDoc files Escape curly braces to prevent AsciiDoc from interpreting them as attribute references: - concepts.adoc: {server-id} - disable-kc.adoc: {id}, {operation.id} - whats-new-cloud.adoc: {subject} Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add Salesforce connector pages to navigation Added salesforce_cdc and salesforce_graphql input pages to the navigation in alphabetical order. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Remove conflicting page-alias from overview.adoc The alias pointed to what-is-redpanda-sql.adoc which exists as a separate file, causing Antora build failure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Revert "Remove conflicting page-alias from overview.adoc" This reverts commit e20dd61. * Remove conflicting page-alias from SQL overview The alias pointed to what-is-redpanda-sql.adoc which exists as a separate file, causing Antora build failure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove conflicting page-alias from substring.adoc The alias pointed to substr.adoc which exists as a separate file. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Remove unlisted SQL pages not in rp-sql branch These files were introduced during rebase but don't exist in the authoritative rp-sql branch: - substr.adoc (duplicate of substring.adoc) - what-is-redpanda-sql.adoc (replaced by overview.adoc) - numeric-type/index.adoc - time-type/index.adoc Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Kat Batuigas <36839689+kbatuigas@users.noreply.github.com> Co-authored-by: micheleRP <michele@redpanda.com> Co-authored-by: Joyce Fee <joyce@redpanda.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: micheleRP <michele@redpanda.com> Co-authored-by: Joyce Fee <joyce@redpanda.com> Co-authored-by: JakeSCahill <jake@redpanda.com> Co-authored-by: Andrew Hsu <xuzuan@gmail.com> Co-authored-by: Joyce Fee <102751339+Feediver1@users.noreply.github.com> Co-authored-by: Jake Cahill <45230295+JakeSCahill@users.noreply.github.com>
Description
This pull request introduces comprehensive documentation improvements for working with nested fields in Redpanda SQL, focusing on mapping nested Protobuf or Avro structures as SQL ROW columns and querying them directly. It clarifies the use of the
struct_mapping_policyoption, expands the reference for theROWdata type, and adds a dedicated how-to guide for querying nested fields.New documentation and feature explanations:
query-nested-fields.adoc, detailing how to map topics with nested schemas as SQL tables usingstruct_mapping_policy = 'COMPOUND', how to query nested fields with ROW syntax, and how to handle recursive (cyclic) schemas.nav.adoc) to include the new "Query Topics with Nested Fields" guide.Improvements to ROW data type documentation:
ROWdata type reference to document field access (by position and name), wildcard projection, lexicographic comparison, NULL checks, text conversion, and usage inGROUP BY,ORDER BY, andJOINclauses.ROWtype summary to mention its support for field access, comparisons, and use in query clauses.Clarifications to CREATE TABLE options:
struct_mapping_policyoption in theCREATE TABLEdocumentation, emphasizing thatCOMPOUNDmaps nested structures to SQL ROW columns and noting that cyclic types are only supported inJSONmode.Resolves https://github.com/redpanda-data/documentation-private/issues/
Review deadline: 20 May
Page previews
Checks