Skip to content

refactor(warehouse): drop the per dialect identifier quoting wrappers - #7421

Merged
achettyiitr merged 3 commits into
masterfrom
refactor/int-6791-drop-dialect-quoting-wrappers
Sep 24, 2026
Merged

achettyiitr merged 3 commits into
masterfrom
refactor/int-6791-drop-dialect-quoting-wrappers

Conversation

@achettyiitr

Copy link
Copy Markdown
Member

Description

warehouse/utils grew both a generic and a per dialect way to build the same SQL:

QuoteQualifiedIdentifier(DoubleQuoteIdentifier, ns, table)   // generic
DoubleQuoteQualifiedIdentifier(ns, table)                    // wrapper

The wrappers only restate the generic helper with the quoting function filled in, so this removes them:

  • DoubleQuoteQualifiedIdentifier, BracketQuoteQualifiedIdentifier, BacktickQuoteQualifiedIdentifier
  • BracketQuoteAndJoinByComma, BacktickQuoteAndJoinByComma

Callers pass the dialect's quoting function to QuoteQualifiedIdentifier or JoinQuotedIdentifiers instead, which is how QuoteCommaSeparatedIdentifiers already works.

What stays:

  • the dialect escapers (DoubleQuoteIdentifier, BracketQuoteIdentifier, BacktickQuoteIdentifier, BigQueryQuoteIdentifier), which is where the dialects genuinely differ
  • BigQueryQuoteTablePath, which quotes a dotted path as one identifier rather than part by part, so it is not the generic helper with an argument filled in
  • DoubleQuoteAndJoinByComma, which predates this work and is used across the warehouse integrations

Nothing on master used the removed wrappers; the INT-6791 integration PRs (#7363, #7364, #7365, #7366, #7367, #7368, #7405, #7420) have been updated to call the generic helpers, so they are unaffected whichever order these merge in.

Tests

  • identifier_test.go: the dialect assertions now go through QuoteQualifiedIdentifier and JoinQuotedIdentifiers, covering the same escaping.

Linear Ticket

Related to INT-6791

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

QuoteQualifiedIdentifier and JoinQuotedIdentifiers already take the dialect's
quoting function, so the DoubleQuote/BracketQuote/BacktickQuote qualified and
comma joined wrappers only restate that. Remove them and let callers pass the
quoting function, leaving one way to build a qualified identifier or an
identifier list.

The dialect specific escapers stay, since they are where the dialects actually
differ, as does BigQueryQuoteTablePath, which quotes a dotted path as a single
identifier rather than part by part.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

🔒 Scanned for secrets using gitleaks 8.29.1
@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.80%. Comparing base (1a7e776) to head (21b598b).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
warehouse/integrations/redshift/redshift.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7421      +/-   ##
==========================================
- Coverage   83.80%   83.80%   -0.01%     
==========================================
  Files         622      622              
  Lines       61991    61979      -12     
==========================================
- Hits        51951    51940      -11     
+ Misses      10037    10036       -1     
  Partials        3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…are the remaining helpers

- Drop DoubleQuoteAndJoinByComma in favour of JoinQuotedIdentifiers with
  DoubleQuoteIdentifier, so the dialect is picked at the call site and there is
  one helper per behaviour rather than one per dialect.
- Add ClickHouseQuoteIdentifier, which backslash escapes the delimiter instead
  of doubling it, because ClickHouse applies string literal escape rules inside
  a double quoted identifier.
- Add TableLocationPath, which builds a table's storage path for the Delta Lake
  LOCATION clause and the Snowflake Iceberg BASE_LOCATION.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

🔒 Scanned for secrets using gitleaks 8.29.1
…ic join helper

It was the last per dialect comma join wrapper and only forwarded to
JoinQuotedIdentifiers, so callers now pass DoubleQuoteIdentifier themselves.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr
achettyiitr merged commit ec0cf52 into master Sep 24, 2026
71 checks passed
@achettyiitr
achettyiitr deleted the refactor/int-6791-drop-dialect-quoting-wrappers branch September 24, 2026 05:31
This was referenced Sep 28, 2026
itsmihir pushed a commit that referenced this pull request Sep 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.89.0-rc.1](v1.88.0...v1.89.0-rc.1)
(2026-09-28)


### Features

* **warehouse:** add shared SQL identifier and string literal quoting
helpers
([#7406](#7406))
([814f6db](814f6db))


### Bug Fixes

* **warehouse:** quote azure synapse identifiers
([#7363](#7363))
([d399fd1](d399fd1))
* **warehouse:** quote bigquery identifiers
([#7366](#7366))
([89de526](89de526))
* **warehouse:** quote clickhouse identifiers
([#7420](#7420))
([490c097](490c097))
* **warehouse:** quote deltalake identifiers
([#7368](#7368))
([08f2f1e](08f2f1e))
* **warehouse:** quote mssql identifiers
([#7364](#7364))
([695b881](695b881))
* **warehouse:** quote postgres load column list and bind schema
existence check
([#7405](#7405))
([2ff81c1](2ff81c1))
* **warehouse:** quote redshift identifiers
([#7365](#7365))
([a3e2a3c](a3e2a3c))
* **warehouse:** quote snowflake identifiers
([#7367](#7367))
([53d4891](53d4891))


### Miscellaneous

* sync release v1.88.0 to main branch
([#7415](#7415))
([130bdd3](130bdd3))
* **warehouse:** drop the per dialect identifier quoting wrappers
([#7421](#7421))
([ec0cf52](ec0cf52))
* **warehouse:** drop the v2 suffix now v1 is gone
([#7418](#7418))
([b759c33](b759c33))
* **warehouse:** move back to upstream clickhouse-go
([#7419](#7419))
([1a7e776](1a7e776))
* **warehouse:** remove the ClickHouse v1 driver
([#7417](#7417))
([bd14179](bd14179))
* **warehouse:** replace dead clickhouse blockSize with commitEvery
([#7427](#7427))
([0806478](0806478))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
itsmihir pushed a commit that referenced this pull request Sep 29, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.89.0](v1.88.0...v1.89.0)
(2026-09-28)


### Features

* **warehouse:** add shared SQL identifier and string literal quoting
helpers
([#7406](#7406))
([814f6db](814f6db))


### Bug Fixes

* **warehouse:** quote azure synapse identifiers
([#7363](#7363))
([d399fd1](d399fd1))
* **warehouse:** quote bigquery identifiers
([#7366](#7366))
([89de526](89de526))
* **warehouse:** quote clickhouse identifiers
([#7420](#7420))
([490c097](490c097))
* **warehouse:** quote deltalake identifiers
([#7368](#7368))
([08f2f1e](08f2f1e))
* **warehouse:** quote mssql identifiers
([#7364](#7364))
([695b881](695b881))
* **warehouse:** quote postgres load column list and bind schema
existence check
([#7405](#7405))
([2ff81c1](2ff81c1))
* **warehouse:** quote redshift identifiers
([#7365](#7365))
([a3e2a3c](a3e2a3c))
* **warehouse:** quote snowflake identifiers
([#7367](#7367))
([53d4891](53d4891))


### Miscellaneous

* sync release v1.88.0 to main branch
([#7415](#7415))
([130bdd3](130bdd3))
* **warehouse:** drop the per dialect identifier quoting wrappers
([#7421](#7421))
([ec0cf52](ec0cf52))
* **warehouse:** drop the v2 suffix now v1 is gone
([#7418](#7418))
([b759c33](b759c33))
* **warehouse:** move back to upstream clickhouse-go
([#7419](#7419))
([1a7e776](1a7e776))
* **warehouse:** remove the ClickHouse v1 driver
([#7417](#7417))
([bd14179](bd14179))
* **warehouse:** replace dead clickhouse blockSize with commitEvery
([#7427](#7427))
([0806478](0806478))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
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