Skip to content

Allow commas in namespace names - #3111

Open
kalra-mohit wants to merge 1 commit into
MarquezProject:mainfrom
kalra-mohit:fix/3110-allow-commas-in-namespace-names
Open

Allow commas in namespace names#3111
kalra-mohit wants to merge 1 commit into
MarquezProject:mainfrom
kalra-mohit:fix/3110-allow-commas-in-namespace-names

Conversation

@kalra-mohit

@kalra-mohit kalra-mohit commented Jul 22, 2026

Copy link
Copy Markdown

Namespace values that contain a comma get rejected with IllegalArgumentException. Showed up in practice with SQL Server/JDBC connection-string style namespaces, which use commas to separate options — e.g. sqlserver://host;databaseName=DB1,DB2.

Root cause is boring: NamespaceName's validation regex just never allowed , in the character class:

Pattern.compile(String.format("^[a-zA-Z:;=/0-9_\\-\\.@+]{%d,%d}$", MIN_SIZE, MAX_SIZE));

Before adding it I checked whether , is used as a delimiter anywhere that a newly-permitted comma could break something — namespace lists in query params, NodeId-style token splitting, that sort of thing. NodeId only parses on : and #, and there's no comma-delimited namespace query param anywhere, so there's nothing for this to collide with.

flowchart TD
    In["Namespace value containing a comma
e.g. sqlserver://host;databaseName=DB1,DB2"]
    In --> Old["Old PATTERN: comma not in allowed char class"]
    Old --> OldOut["No match -> IllegalArgumentException"]
    In --> New["New PATTERN: comma added to allowed char class"]
    New --> NewOut["Match -> NamespaceName created"]
Loading

Fix: added , to NamespaceName.PATTERN and updated the validation error message to mention commas as an allowed character.

Testing: added three regression cases to NamespaceNameTest#testValidNamespaceName — a comma-containing name, a bare ,, and a realistic SQL Server connection-string namespace. Confirmed all three throw before the fix and pass after:

./gradlew :api:test --tests "marquez.common.models.NamespaceNameTest"

3 failures before the fix, 15/15 passing after.

Fixes #3110.

@boring-cyborg boring-cyborg Bot added the api API layer changes label Jul 22, 2026
@boring-cyborg

boring-cyborg Bot commented Jul 22, 2026

Copy link
Copy Markdown

Thanks for opening your first pull request in the Marquez project! Please check out our contributing guidelines (https://github.com/MarquezProject/marquez/blob/main/CONTRIBUTING.md).

NamespaceName's validation regex disallowed commas, even though
commas are commonly present in real-world namespace values (e.g.
JDBC/ODBC connection strings with comma-separated options, such as
SQL Server connection strings using multiple properties). No other
part of the codebase uses commas as a delimiter for namespace
values (NodeId uses ':' and '#'; there is no comma-separated
namespace query param), so there is no delimiter conflict from
allowing them.

Adds ',' to the allowed character set in NamespaceName.PATTERN and
updates the validation error message to mention commas.

Adds regression test cases in NamespaceNameTest covering a bare
comma, a namespace containing a comma, and a realistic connection
string containing commas - all of which threw
IllegalArgumentException before this change.

Fixes MarquezProject#3110

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Mohit Kalra <mohit2494@gmail.com>
@kalra-mohit
kalra-mohit force-pushed the fix/3110-allow-commas-in-namespace-names branch from cec344f to 34ce4fc Compare July 22, 2026 01:16
@kalra-mohit
kalra-mohit marked this pull request as ready for review July 22, 2026 02:30
@kalra-mohit

Copy link
Copy Markdown
Author

@merobi-hub whenever you get a chance to take a look, happy to address any feedback!

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

Labels

api API layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Commas not allowed in namespace names

1 participant