Repository navigation
chore(warehouse): remove the ClickHouse v1 driver - #7417
Merged
Merged
Conversation
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
This was referenced Sep 23, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7417 +/- ##
==========================================
- Coverage 83.86% 83.30% -0.56%
==========================================
Files 621 621
Lines 62690 61967 -723
==========================================
- Hits 52575 51622 -953
- Misses 10112 10342 +230
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
saikumarrs
approved these changes
Sep 23, 2026
achettyiitr
added a commit
that referenced
this pull request
Sep 23, 2026
#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
added a commit
that referenced
this pull request
Sep 23, 2026
# 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 - [x] `go build ./...`, `go vet ./warehouse/...`, `gofmt` clean - [x] Package unit tests pass - [ ] Integration suite (`SLOW=1`, docker) in CI - [ ] Merge after #7417 ## 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. Renames and a config-key fallback only. Credential masking is untouched and still covered by `TestS3CredentialsRegexV2`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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)
achettyiitr
added a commit
that referenced
this pull request
Sep 25, 2026
…7427) ## What Replaces the dead `blockSize: 1000` with `commitEvery: 1000` in the ClickHouse block of `config/config.yaml`. ```diff clickhouse: maxParallelLoads: 3 queryDebugLogs: false - blockSize: 1000 + commitEvery: 1000 poolSize: 10 ``` ## Why `Warehouse.clickhouse.blockSize` is no longer read. The v1 driver was removed in #7417 and the v2 equivalent is `Warehouse.clickhouse.commitEvery`, so the shipped value has had no effect since that merged. The only `blockSize` left in the tree is the `warehouse.clickhouse.blockSize` stats histogram, which is unrelated and untouched. This matters because `config/config.yaml` is live config, not documentation — it deliberately overrides code defaults for self-hosted deployments: | Key | Code default | Shipped | |---|---|---| | `poolSize` | 100 | **10** | | `maxParallelLoads` | 8 | **3** | | `commitEvery` | 1,000,000 | **1,000** (this PR) | Carrying the value across keeps that conservative posture rather than silently handing self-hosted deployments the 1,000,000-row driver default. ## Behaviour change — worth a reviewer's attention This is **not** a no-op. `blockSize` was only ever read by v1, so anyone running v2 has been getting the 1,000,000 default regardless of what this file said. Setting `commitEvery: 1000` brings self-hosted commit size down by three orders of magnitude from what it is today. That means smaller, more frequent inserts: lower peak memory per commit, more round trips. For reference, tuned production values sit between 25,000 and 250,000. If 1,000 is considered too low for a default, the alternatives are a mid-range value or dropping the key entirely and letting the driver default apply. ## Not changed `enableArraySupport` stays — still read at `processor/internal/transformer/destination_transformer/destination_transformer.go:366` and passed to the destination transformer as `chEnableArraySupport`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This was referenced Sep 28, 2026
Merged
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
v2 now carries every ClickHouse destination that has been migrated, so keeping a second implementation costs two files to hold in step, a selector that runs per destination, and an integration suite executed twice. This removes v1 and promotes v2 to be the ClickHouse integration rather than a variant of it.
Net: −1,562 lines (179 added, 1,741 removed), across 10 files.
The v2 files keep their
*_v2names here. Renaming them in this PR makes git pair the newclickhouse.gowith the deleted one, so the removal renders as a 1,258-line rewrite rather than a delete. The renames are stacked in #7416, whereclickhouse.gono longer exists in the base and they show as renames.What changed
Deleted
clickhouse.go— the v1 implementation (1,311 lines)clickhouseSelectoranduseV2Driverinwarehouse/integrations/manager— the factory now returnsclickhouse.Newdirectlymanager_test.go— all three of its tests covered driver selectionconnectClickhouseDB) and its compose fileExtracted rather than deleted — v2 has always depended on symbols that lived in v1's file, so these move to a new
schema.goinstead of disappearing:rudderDataTypesMapToClickHouse,clickhouseDataTypesMapToRudder,datatypeDefaultValuesMap,clickhouseSpecificColumnNameMappings,clickhouseDefaultDateTime,errorsMappings, thecredentialstype,generateArgumentString,getClickhouseColumnTypeForSpecificColumn,getSortKeyTuple, andpartitionField.Tests — the
CLICKHOUSE_USE_V2parameterisation is collapsed: one implementation, one pass. Subtests that skipped on v1 (JSON paths, native JSON columns, temporary credentials, s3Copy settings) now always run. CI drops theclickhouse-v2matrix entry, so the suite runs once instead of twice.useV2Driverdefaults tofalse, so deleting the selector moves every remaining destination onto v2 at once. Fromrudder-devops, 9 namespaces have a ClickHouse block and only 3 referenceuseV2Driver:multi-tenant-us/hostedmtedmtenterprise-us/entusmtprodenterprise-in/rudderstacwqlaenterprise-eu/ivendienterprise-eu/onefootballenterprise-eu/ticketswapjllenterprise-eu/rudderstacstenterprise-us/padletdev-rudder/hostedmt-devblockSizeis the specific hazard. It is a v1-only setting, and four of those namespaces set it —onefootball250000,ticketswapjll250000,padlet250000,rudderstacst25000. v2 has noblockSize; it drives commit cadence withcommitEvery, which defaults to 1,000,000. Those destinations would jump to batches 4-40x larger than they are tuned for, on a code path whose memory scales with batch size.Suggested sequencing rather than merging straight in:
commitEveryfor the fourblockSizenamespaces to match their current tuninguseV2Drivernamespace-wide on the remaining six and let them runThe alternative is to merge and treat the per-destination
useV2Driver: falseescape hatch as the rollback — but that escape hatch is exactly what this PR deletes, so it would not exist.Test plan
go build ./...cleango vet ./warehouse/...clean,gofmtcleanTestS3CopySettings,TestCredentials,TestJSONPaths,TestPartition,TestRetry,TestBinder)SLOW=1, docker) — previously skipped subtests now run on every passblockSizenamespaces have acommitEveryequivalent before this shipsLinear Ticket
https://linear.app/rudderstack/issue/INT-7053/cleanup
Security
Deletions and renames only; no change to credential handling. The s3 credential masking path is untouched and still covered by
TestS3CredentialsRegex.🤖 Generated with Claude Code