Skip to content

chore(warehouse): remove the ClickHouse v1 driver - #7410

Closed
achettyiitr wants to merge 3 commits into
release/1.87.xfrom
chore/clickhouse-remove-v1
Closed

achettyiitr wants to merge 3 commits into
release/1.87.xfrom
chore/clickhouse-remove-v1

Conversation

@achettyiitr

@achettyiitr achettyiitr commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

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,550 lines (174 added, 1,724 removed), across 10 files.

The v2 files keep their *_v2 names here. Renaming them in this PR makes git pair the new clickhouse.go with the deleted one, so the removal renders as a 1,258-line rewrite rather than a delete. The renames are stacked in #7416, where clickhouse.go no longer exists in the base and they show as renames.

What changed

Deleted

  • clickhouse.go — the v1 implementation (1,311 lines)
  • clickhouseSelector and useV2Driver in warehouse/integrations/manager — the factory now returns clickhouse.New directly
  • manager_test.go — all three of its tests covered driver selection
  • The v1 test helper (connectClickhouseDB) and its compose file

Extracted rather than deleted — v2 has always depended on symbols that lived in v1's file, so these move to a new schema.go instead of disappearing: rudderDataTypesMapToClickHouse, clickhouseDataTypesMapToRudder, datatypeDefaultValuesMap, clickhouseSpecificColumnNameMappings, clickhouseDefaultDateTime, errorsMappings, the credentials type, generateArgumentString, getClickhouseColumnTypeForSpecificColumn, getSortKeyTuple, and partitionField.

Tests — the CLICKHOUSE_USE_V2 parameterisation 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 the clickhouse-v2 matrix entry, so the suite runs once instead of twice.

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.

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

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, and promotes v2 to be
the ClickHouse integration rather than a variant of it. The shared
schema maps and helpers v1 owned move to schema.go, since v2 has always
depended on them.

Config is read from Warehouse.clickhouse.v2.* first and
Warehouse.clickhouse.* second, so deployed config keeps winning while
the unprefixed name becomes canonical. Nothing has to move in lockstep.

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

🔒 Scanned for secrets using gitleaks 8.29.1
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.35802% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.87%. Comparing base (0eb02d7) to head (c62a049).

Files with missing lines Patch % Lines
warehouse/integrations/clickhouse/clickhouse.go 90.00% 14 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           release/1.87.x    #7410      +/-   ##
==================================================
- Coverage           85.29%   84.87%   -0.43%     
==================================================
  Files                 620      620              
  Lines               63893    62010    -1883     
==================================================
- Hits                54498    52631    -1867     
+ Misses               9392     9376      -16     
  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.

@achettyiitr
achettyiitr marked this pull request as draft September 21, 2026 05:17
Renaming clickhousev2.go to clickhouse.go in the same change makes git
pair the new file with the deleted one, so the removal reads as a
1,258-line rewrite of clickhouse.go rather than a delete. Leave the
names alone here and move them to a follow-up, where clickhouse.go no
longer exists in the base and the rename shows as a rename.

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

🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr
achettyiitr marked this pull request as ready for review September 23, 2026 05:31
golangci-lint caught two leftovers. The credentials struct was v1's
alone: v2 has a method of the same name, which is what made it look
shared when the file was split. connectDB and setupDB took a context
only the v1 branch used, so it goes with the branch.

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

🔒 Scanned for secrets using gitleaks 8.29.1
@achettyiitr

Copy link
Copy Markdown
Member Author

Superseded by #7417, which targets master. This one was cut against release/1.87.x, which is the hotfix line.

@github-actions
github-actions Bot deleted the chore/clickhouse-remove-v1 branch November 24, 2026 01:45
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.

1 participant