Skip to content

chore(warehouse): move back to upstream clickhouse-go - #7419

Merged
achettyiitr merged 5 commits into
masterfrom
chore/clickhouse-upstream-driver
Sep 23, 2026
Merged

achettyiitr merged 5 commits into
masterfrom
chore/clickhouse-upstream-driver

Conversation

@achettyiitr

Copy link
Copy Markdown
Member

Description

Moves the ClickHouse driver import from the RudderStack fork back to upstream github.com/ClickHouse/clickhouse-go/v2, and drops the v1 dependency.

Why the fork existed

From the fork's own README:

rudder-server still depends on v1 (github.com/ClickHouse/clickhouse-go) while the ClickHouse warehouse integration migrates to v2. Both upstream versions register the driver name clickhouse in init(), so linking them into one binary panics with sql: Register called twice for driver clickhouse before main [...] It is temporary. Once every destination is on v2 and the v1 dependency is dropped, rudder-server moves its import back to upstream and this fork is retired.

That condition is now met. #7417 removes the v1 implementation, so nothing links v1 any more and the driver-name collision cannot happen.

The fork was 4 commits ahead of upstream v2.48.0 and 0 behind: the module path rename, the clickhouse-v2 driver registration, a README note, and a CI runner change. Only the registration was functional, and it is precisely what is no longer needed.

What changed

  • driver.go: import swapped to github.com/ClickHouse/clickhouse-go/v2
  • clickhouse_test.go: same swap; clickhouseExceptionCode dropped its v1 branch, which was the last thing importing github.com/ClickHouse/clickhouse-go
  • go.mod / go.sum: the fork and the v1 driver are gone; upstream v2.48.0 is now a direct dependency (it was already present indirectly at v2.36.0)

The registered driver name is not a concern. Both call sites use clickhouse.OpenDB(opts), which constructs a *sql.DB directly and never looks up a name in database/sql's registry, so upstream registering clickhouse rather than clickhouse-v2 changes nothing here.

Once this merges, rudderlabs/clickhouse-go can be archived.

Test plan

Linear Ticket

https://linear.app/rudderstack/issue/INT-7053/cleanup

Security

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

Swapping a fork for its upstream at the same version reduces what we carry; the fork's only functional patch was a driver-registration name. TLS and credential handling are upstream's and unchanged.

🤖 Generated with Claude Code

v2 carries every destination that has been migrated, so the second
implementation is now dead weight: two files to keep in step, a selector
per destination, and a test suite run twice.

Deletes the v1 implementation and the selector. The shared schema maps
and helpers v1 owned move to schema.go, since v2 has always depended on
them. The v2 files keep their names here; renaming them in the same
change would make git read the removal as a rewrite of clickhouse.go
rather than a delete.

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

🔒 Scanned for secrets using gitleaks 8.29.1
v2 is the only ClickHouse implementation, so the files, the type and the
config namespace no longer need to say so.

Config is read from Warehouse.clickhouse.v2.* first and
Warehouse.clickhouse.* second, so config deployed against the v2
namespace keeps winning while the unprefixed name becomes canonical.

.golangci.yml silences clickhouse-go's deprecated Options.Debug by path,
so the exclusion follows driver_v2.go to its new name.

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

🔒 Scanned for secrets using gitleaks 8.29.1
The fork existed for one reason: rudder-server linked both clickhouse-go
v1 and v2, and each registers the database/sql driver name "clickhouse"
in init(), so a single binary panicked before main. The fork registered
v2 as "clickhouse-v2" so the two could coexist while the warehouse
integration migrated.

v1 is gone, so the collision is gone with it. The only v1 use left was a
test helper that accepted either version's Exception type; it now takes
v2's alone.

Nothing referenced the registered driver name — both call sites use
OpenDB, which does not go through the registry — so the swap is the
import path and the dependency.

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

🔒 Scanned for secrets using gitleaks 8.29.1
gci sorts imports into standard, third-party, rudderlabs and module
sections. Swapping the path in place left the driver in the rudderlabs
block, which is where the fork belonged but upstream does not.

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

🔒 Scanned for secrets using gitleaks 8.29.1
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.79%. Comparing base (b759c33) to head (5052cfe).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7419      +/-   ##
==========================================
+ Coverage   83.77%   83.79%   +0.01%     
==========================================
  Files         622      622              
  Lines       61991    61991              
==========================================
+ Hits        51936    51944       +8     
+ Misses      10052    10044       -8     
  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.

Base automatically changed from chore/clickhouse-promote-v2-names-master to master September 23, 2026 11:12
#7418 merged to master as a squash, so this branch's own copies of the
v1 removal and the rename no longer matched master's history. Merging
master in resolves it; the branch's remaining change is just the move
to the upstream clickhouse-go driver.

🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr
achettyiitr merged commit 1a7e776 into master Sep 23, 2026
73 checks passed
@achettyiitr
achettyiitr deleted the chore/clickhouse-upstream-driver branch September 23, 2026 11:53
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