Handle dotted table names in quoted identifiers - #248
Merged
Conversation
A quoted identifier segment may legitimately contain a dot, e.g. the Kafka
topic "KAFKA"."my.event". Several code paths took a bare identifier string and
naively split("\\."), shredding "my.event" into "my" + "event" and breaking
!describe / !graph / !resolve and graph / custom-resource lookups.
Add IdentifierUtils.parseIdentifier, which splits unquoted input directly on
'.' (exact, since an unquoted segment cannot contain a dot — this also covers
the unquoted hyphenated names the CLI commands accept, e.g.
LOGICAL.testevent-graph) and uses the SQL parser only for quoted input so a
dot inside a quoted segment is preserved. Malformed quoted identifiers now
error rather than silently mis-splitting.
Wire it into GraphService.resolve, the !resolve/!describe CLI and quidem
paths, and PipelineGraphBuilder. K8s object names already permit dots, so
canonicalization is left unchanged (backwards compatible with existing dotted
resource names).
Add unit tests for IdentifierUtils, dot-preservation tests for
K8sUtils.canonicalizeName, a GraphService test, and a Kafka integration
script that creates/describes/drops a topic whose name contains a dot.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Code Coverage
|
ryannedolan
reviewed
Aug 11, 2026
|
|
||
| @Test | ||
| void canonicalizeNamePreservesDots() { | ||
| // Dots are intentionally NOT rewritten: K8s object names here are DNS-1123 subdomains, which |
Collaborator
There was a problem hiding this comment.
That might be technically true, but I have never seen periods in CR names, and some linters will complain about them. I think it's probably safer if we replace periods with hyphens.
Collaborator
Author
There was a problem hiding this comment.
I fact checked and unfortunately we have some CRs in prod that use dots in the name. Changing this behavior would effectively orphan them, they’d no longer be able to be updated or dropped and the same view reissued would lead to a duplicate job.
ryannedolan
reviewed
Aug 11, 2026
|
|
||
| @Test | ||
| void canonicalizeNameWithDottedTableAndDatabasePreservesDot() { | ||
| assertEquals("kafka-database-my.event", K8sUtils.canonicalizeName("kafka-database", "my.event")); |
Collaborator
There was a problem hiding this comment.
typical order of operations makes this weird to read
ryannedolan
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A quoted identifier segment can legitimately contain a dot — e.g. the Kafka topic
"KAFKA"."my.event". Calcite parses such statements correctly (a quoted segment stays whole), but several Hoptimator paths took a bare identifier string and naivelysplit("\\."), shreddingmy.eventintomy+event. That broke:!describe/!graph/!resolveCLI commandsGraphService.resolve(graph target resolution)PipelineGraphBuildercustom-resource name lookupsFix
New
IdentifierUtils.parseIdentifier(String)that splits by quoting:.. This is exact (an unquoted segment can't contain a dot) and also covers the unquoted hyphenated names the CLI commands accept but the SQL grammar rejects, e.g.LOGICAL.testevent-graph(which the parser would read as subtraction)."my.table") is preserved. Malformed/mixed quoted forms (e.g."KAFKA".my-topic) now throw rather than silently mis-splitting.Wired into
GraphService.resolve, the!resolve/!describeCLI + quidem paths, andPipelineGraphBuilder.forView/forLogicalTable.Naming is intentionally unchanged. K8s object names here are DNS-1123 subdomains and already permit dots, and resources with dotted names exist in production.
canonicalizeNameis left as-is so derived names stay backwards compatible (create-time and lookup-time both yieldvenice-my.event); rewriting dots would make the operator create duplicates instead of updating existing resources.Tests
IdentifierUtilsTest— quoted dotted segments, escaped quotes, unquoted/hyphenated, and malformed-quoted-throws cases.K8sUtilsTest— dot-preservation cases documenting the backwards-compatible naming behavior.GraphServiceTest— resolves"VENICE"."my.table"as a single table identity.hoptimator-kafkaintegration scriptkafka-ddl-dotted.id— creates,!describes, and drops a topic whose name contains a dot (verified against a live cluster).Unit suites, spotbugs, checkstyle, and the affected integration tests all pass.