Skip to content

Fix quoted table names rejected as invalid#182

Open
shurarama wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
shurarama:fix/quoted-table-names
Open

Fix quoted table names rejected as invalid#182
shurarama wants to merge 1 commit intoGoogleCloudPlatform:mainfrom
shurarama:fix/quoted-table-names

Conversation

@shurarama
Copy link
Copy Markdown

@shurarama shurarama commented Apr 15, 2026

Fixes #184

Summary

  • Bug: ParseTable() in translators/common/utils.go did not call TrimDoubleQuotes() before validating the table name, causing all queries with double-quoted table names to fail with invalid table name: "..."
  • Root cause: ParseKeyspace() (line 832) and ParseColumnContext() (line 343) already strip quotes — ParseTable() was simply missing the same call
  • Fix: Add TrimDoubleQuotes() call in ParseTable() before validation

Affected queries

All DML/DDL with quoted table names across all translators (SELECT, INSERT, DELETE, UPDATE, CREATE, ALTER, DROP, TRUNCATE):

SELECT * FROM "bigtable"."employees_target" LIMIT 1;

Test plan

  • New test: Quoted table and keyspace names — verifies quoted identifiers are accepted and stripped
  • Verified test fails without fix: invalid table name: "test_table"
  • Full select translator test suite passes (38/38)

ParseTable() did not strip double quotes from identifiers before
validation, unlike ParseKeyspace() and ParseColumnContext() which
already called TrimDoubleQuotes(). This caused all queries with
quoted table names (e.g. "employees_target") to fail.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for quoted table and keyspace names in the Cassandra-Bigtable proxy. The ParseTable function now utilizes TrimDoubleQuotes to sanitize table names, and a new test case has been added to validate this behavior in SELECT queries. I have no feedback to provide.

@brandtnewton
Copy link
Copy Markdown
Collaborator

Hi @shurarama, thanks for the contribution! Same as the other PR: please squash your commits an use a conventional commit message that starts with fix:

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.

Quoted table names rejected with 'invalid table name'

2 participants