Skip to content

chore(warehouse): drop the v2 suffix now v1 is gone - #7418

Merged
achettyiitr merged 3 commits into
masterfrom
chore/clickhouse-promote-v2-names-master
Sep 23, 2026
Merged

achettyiitr merged 3 commits into
masterfrom
chore/clickhouse-promote-v2-names-master

Conversation

@achettyiitr

Copy link
Copy Markdown
Member

Description

Follow-up to #7417, which removes the v1 ClickHouse driver. With v1 gone, the files, the exported type and the config namespace no longer need to say "v2".

Kept separate on purpose: doing the renames in #7417 makes git pair the new clickhouse.go with the deleted one, so the removal reads as a 1,258-line rewrite instead of a delete. Stacked on top, clickhouse.go no longer exists in the base, so every move below shows as a rename.

Renames

From To
clickhousev2.go clickhouse.go
load_v2.go load.go
driver_v2.go driver.go
binder_v2.go binder.go
stats_v2.go stats.go
*_v2_test.go *_test.go
testdata/docker-compose.clickhouse-v2.yml testdata/docker-compose.clickhouse.yml

Type ClickhouseV2 → Clickhouse, NewV2 → New, and the logger drops its v2 child so lines read integrations.clickhouse again.

Config

Settings are read from Warehouse.clickhouse.v2.* first and Warehouse.clickhouse.* second. Config deployed against the v2 namespace keeps winning, while the unprefixed name becomes canonical — nothing has to move in lockstep. Once deployments migrate, the v2. keys can be dropped.

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.

Renames and a config-key fallback only. Credential masking is untouched and still covered by TestS3CredentialsRegexV2.

🤖 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
@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.73%. Comparing base (bd14179) to head (5290d97).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7418      +/-   ##
==========================================
+ Coverage   83.34%   83.73%   +0.39%     
==========================================
  Files         622      622              
  Lines       61987    61991       +4     
==========================================
+ Hits        51660    51911     +251     
+ Misses      10324    10077     -247     
  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-remove-v1-master to master September 23, 2026 10:38
#7417 landed on master as a squash, so this branch's own copy of the
v1 removal conflicted with it. Resolved by taking master's tree and
re-applying the rename diff on top, leaving this PR as purely the
v2-suffix drop plus the unprefixed config-key fallbacks.

🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr
achettyiitr merged commit b759c33 into master Sep 23, 2026
73 checks passed
@achettyiitr
achettyiitr deleted the chore/clickhouse-promote-v2-names-master branch September 23, 2026 11:12
achettyiitr added a commit that referenced this pull request Sep 23, 2026
#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 added a commit that referenced this pull request Sep 23, 2026
# 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

- [x] `go build ./...`, `go vet ./warehouse/...`, `gofmt` clean
- [x] `golangci-lint` (CI-pinned v2.13.2) — 0 issues
- [x] Package unit tests pass
- [x] No `rudderlabs/clickhouse-go` references remain in Go sources,
`go.mod` or `go.sum`
- [ ] Integration suite (`SLOW=1`, docker) in CI
- [ ] Merge after #7417 and #7418

## Linear Ticket

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

## Security

- [x] 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](https://claude.com/claude-code)
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.

3 participants