Skip to content

[USTORAGE-27286] Add metadata-column-naming-scheme flag to tableflow topic commands - #3410

Open
Rajendra Dangwal (rajdangwal) wants to merge 4 commits into
mainfrom
USTORAGE-27286-cli-metadata-column-naming-scheme
Open

[USTORAGE-27286] Add metadata-column-naming-scheme flag to tableflow topic commands#3410
Rajendra Dangwal (rajdangwal) wants to merge 4 commits into
mainfrom
USTORAGE-27286-cli-metadata-column-naming-scheme

Conversation

@rajdangwal

@rajdangwal Rajendra Dangwal (rajdangwal) commented Jul 22, 2026

Copy link
Copy Markdown
Member

Release Notes

Breaking Changes

  • None

New Features

  • Added a --metadata-column-naming-scheme flag to confluent tableflow topic create and confluent tableflow topic update to select the naming scheme (DEFAULT or PORTABLE) for a Tableflow topic's internal metadata columns. PORTABLE uses BigQuery-compatible cflt_metadata_-prefixed names.

Bug Fixes

  • None

Checklist

  • I have successfully built and used a custom CLI binary, without linter issues from this PR.
  • I have clearly specified in the What section below whether this PR applies to Confluent Cloud, Confluent Platform, or both.
  • I have verified this PR in Confluent Cloud pre-prod or production environment, if applicable.
  • I have verified this PR in Confluent Platform on-premises environment, if applicable.
  • I have attached manual CLI verification results or screenshots in the Test & Review section below.
  • I have added appropriate CLI integration or unit tests for any new or updated commands and functionality.
  • I confirm that this PR introduces no breaking changes or backward compatibility issues.
  • I have indicated the potential customer impact if something goes wrong in the Blast Radius section below.
  • I have put checkmarks below confirming that the feature associated with this PR is enabled in:
    • Confluent Cloud prod
    • Confluent Cloud stag
    • Confluent Platform
    • Check this box if the feature is enabled for certain organizations only

What

Applies to Confluent Cloud only (Tableflow).

Adds a --metadata-column-naming-scheme flag to confluent tableflow topic create (alias enable) and update, letting customers choose how a Tableflow topic's internal metadata columns are named in the materialized table:

  • DEFAULT — the existing $-prefixed names.
  • PORTABLE — BigQuery-compatible cflt_metadata_-prefixed names.

The value is sent only when the flag is provided (uppercase-normalized, mirroring --storage-type/--error-handling), and surfaced in describe/list/create/update output (omitted when unset, matching the API). Bumps ccloud-sdk-go-v2/tableflow to v0.7.0, which adds the field to the topic config spec. No client-side allow-list validation, since the API field is x-extensible-enum and the server validates; consistent with --table-formats/--record-failure-strategy.

Blast Radius

Additive, opt-in flag; default behavior is unchanged for anyone not using it.

  • Customers who do not pass --metadata-column-naming-scheme are unaffected — no change to existing tableflow topic commands or output.
  • If the new flag handling regressed, only customers explicitly passing --metadata-column-naming-scheme on tableflow topic create/update could be affected. The value is validated server-side, and PORTABLE is gated behind a LaunchDarkly flag (rejected unless enabled for the org), so a bad value fails the single request rather than affecting existing topics.

References

Test & Review

  • Added CLI integration tests: tableflow topic enable/update with --metadata-column-naming-scheme (mock update handler echoes the scheme; case-normalization exercised via lowercase input), plus regenerated enable-help/update-help goldens. TestTableflowTopic and TestHelp pass; gofmt, go vet, and the CLI flag linter clean.
  • Manually verified in Confluent Cloud devel: built the CLI from this branch, produced an Avro record to register a schema on the topic, then ran tableflow topic enable/update + describe both with and without --metadata-column-naming-scheme. Confirmed PORTABLE is accepted, persisted, and echoed back on describe (and in -o json), while topics without the flag show no scheme.

Existing commands without metadata-column-naming-scheme works fine and the config is not shown during describe:

confluent tableflow topic enable topic_a_2 --cluster lkc-devcw778x0j --storage-type MANAGED

confluent tableflow topic describe topic_a_2 --cluster lkc-devcw778x0j
| Kafka Cluster                 | lkc-devcw778x0j                                                                                                                                                                      |
| Topic Name                    | topic_a_2                                                                                                                                                                            |
| Enable Compaction             | true                                                                                                                                                                                 |
| Enable Partitioning           | true                                                                                                                                                                                 |
| Environment                   | env-devc9yw557                                                                                                                                                                       |
| Record Failure Strategy       | SUSPEND                                                                                                                                                                              |
| Error Handling                | SUSPEND

Commands with metadata-column-naming-scheme works with DEFAULT value and shown during describe:

confluent tableflow topic enable topic_a_3 --cluster lkc-devcw778x0j --storage-type MANAGED --metadata-column-naming-scheme DEFAULT

confluent tableflow topic describe topic_a_3 --cluster lkc-devcw778x0j
| Kafka Cluster                 | lkc-devcw778x0j                                                                                                                                                                      |
| Topic Name                    | topic_a_3                                                                                                                                                                            |
| Enable Compaction             | true                                                                                                                                                                                 |
| Enable Partitioning           | true                                                                                                                                                                                 |
| Environment                   | env-devc9yw557                                                                                                                                                                       |
| Record Failure Strategy       | SUSPEND                                                                                                                                                                              |
| Metadata Column Naming Scheme | DEFAULT                                                                                                                                                                              |
| Error Handling                | SUSPEND

Commands with metadata-column-naming-scheme fails with PORTABLE value if it is not enabled via LD, works when enabled:

confluent tableflow topic enable topic_a_4 --cluster lkc-devcdooryyz --storage-type MANAGED --metadata-column-naming-scheme PORTABLE
Error: Bad Request: setting metadata_column_naming_scheme=PORTABLE is not supported for your tableflow topic at this time. Please contact support if you think this is a mistake


confluent tableflow topic enable topic_a_4 --cluster lkc-devcw778x0j --storage-type MANAGED --metadata-column-naming-scheme PORTABLE
| Kafka Cluster                 | lkc-devcw778x0j                                                                                                                                                                      |
| Topic Name                    | topic_a_4                                                                                                                                                                            |
| Enable Compaction             | true                                                                                                                                                                                 |
| Enable Partitioning           | true                                                                                                                                                                                 |
| Environment                   | env-devc9yw557                                                                                                                                                                       |
| Record Failure Strategy       | SUSPEND                                                                                                                                                                              |
| Metadata Column Naming Scheme | PORTABLE                                                                                                                                                                             |
| Error Handling                | SUSPEND

Similarly, the update commands work for the DEFAULT <-> PORTABLE switch, if the LD allows it.

…opic commands

Add a --metadata-column-naming-scheme flag to `tableflow topic enable` (create)
and `tableflow topic update`, sending it on the config only when the user
provides it, and surface the value in describe/list/enable/update output
(omitted when unset). Bumps ccloud-sdk-go-v2/tableflow to v0.7.0, which adds the
field to the topic config spec.

Adds integration test cases for enable/update with the flag (with a mock update
handler that echoes the scheme) and regenerates the affected help goldens.
Copilot AI review requested due to automatic review settings July 22, 2026 10:26
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Tableflow topic enable/update commands with a new --metadata-column-naming-scheme flag to let users choose the naming scheme for Tableflow’s internal metadata columns, and surfaces that value in topic outputs. It also updates the Tableflow SDK dependency and refreshes integration test fixtures/goldens to cover the new flag.

Changes:

  • Add --metadata-column-naming-scheme to confluent tableflow topic enable and confluent tableflow topic update, passing it through only when explicitly provided.
  • Surface metadata_column_naming_scheme in human/JSON/YAML output for topic list/describe/enable/update.
  • Bump ccloud-sdk-go-v2/tableflow to v0.7.0 (and golang.org/x/oauth2 to v0.36.0) and add/refresh integration test coverage + help/output goldens.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/tableflow/command_topic_enable.go Adds the new flag and sends it on create requests when provided.
internal/tableflow/command_topic_update.go Adds the new flag and sends it on patch requests when provided.
internal/tableflow/command_topic.go Adds a new output field to the shared topic output struct and populates it for describe/enable/update output.
internal/tableflow/command_topic_list.go Includes the new field in list output.
test/test-server/tableflow_handlers.go Updates the mock update handler to echo back the metadata naming scheme in responses.
test/tableflow_test.go Adds integration test cases for enable/update with the new flag.
test/fixtures/output/tableflow/topic/enable-topic-managed-metadata-column-naming-scheme.golden New golden output for enable with metadata naming scheme set.
test/fixtures/output/tableflow/topic/update-topic-managed-metadata-column-naming-scheme.golden New golden output for update with metadata naming scheme set.
test/fixtures/output/tableflow/topic/enable-help.golden Updates help output to include the new flag.
test/fixtures/output/tableflow/topic/update-help.golden Updates help output to include the new flag.
go.mod Bumps ccloud-sdk-go-v2/tableflow and golang.org/x/oauth2 dependency versions.
go.sum Updates module checksums for the dependency bumps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/tableflow/command_topic_enable.go
Comment thread internal/tableflow/command_topic_update.go
Comment thread internal/tableflow/command_topic.go
Address review feedback:
- Uppercase-normalize --metadata-column-naming-scheme before sending, so values
  like "portable" work (consistent with --storage-type/--error-handling). The
  field is x-extensible-enum, so we deliberately don't hard-reject unknown values
  client-side; the server validates and returns a clear error.
- Fix the pre-existing trailing space in the storage_region serialized tag
  ("storage_region ,omitempty"), which produced a malformed JSON/YAML key; regen
  the affected JSON goldens.
- Regenerate list-topic.golden to include the Metadata Column Naming Scheme
  column (list output shows all columns).
…ame linter

The flag name exceeds the default 20-char / 2-delimiter limits. Add it to both
ExcludeFlag allowlists (length and delimiter), matching the sibling
record-failure-strategy flag, so the name stays aligned with the API/SDK field
metadata_column_naming_scheme rather than abbreviating it.
…st coverage

Revert the storage_region serialized-tag change: renaming a serialized field is a
breaking change per AGENTS.md and is unrelated to this feature, so it shouldn't
ride along in a minor PR.

Set metadata_column_naming_scheme on the Azure mock topic so the describe and
list goldens exercise a non-empty value read back from the API (previously only
the enable/update echo paths covered it, leaving command_topic_list.go's read
untested).
@rajdangwal Rajendra Dangwal (rajdangwal) changed the title USTORAGE-27286: Add metadata-column-naming-scheme flag to tableflow topic commands [USTORAGE-27286] Add metadata-column-naming-scheme flag to tableflow topic commands Jul 22, 2026
@rajdangwal
Rajendra Dangwal (rajdangwal) marked this pull request as ready for review July 22, 2026 14:28
@rajdangwal
Rajendra Dangwal (rajdangwal) requested a review from a team as a code owner July 22, 2026 14:28
@sonarqube-confluent

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants