Databricks MigrationRoomClickHouse Workshops

03 Migrate, validate, and rewrite

Drive the copy, parity gate, and SQL rewrites from the MigrationRoom UI.

Outcome

The dashboard shows a completed native copy, passing per-table validation, and reviewed ClickHouse rewrites for the analytical workload.

Step 2 — Migrate Data

MigrationRoom supports two data paths. Use the first tab for this workshop; the second shows how the same step can scale through object-storage staging.

Use this path in the workshop. Click Migrate Data. MigrationRoom builds and dispatches a migrationkit job that reads Databricks in batches and writes directly to ClickHouse Cloud through the built-in migration runner.

This path needs no staging bucket, cloud-storage credentials, Unity Catalog external location, or additional Terraform resources. It still provides batching, per-batch checkpoints, pause/resume/cancel, and live progress in the KPI dashboard. Direct migration works at any table size, although S3 staging can be faster for large tables.

The agent may show generated Python in its tool activity. That is MigrationRoom's internal execution plan; do not copy it into a terminal or start a second migration.

MigrationRoom Step 2 explaining the migrationkit direct and S3-staging paths before dispatching the data migration

When the agent says the migration is running, use the dashboard as the authoritative status view:

  1. Open the active run in the KPI dashboard.
  2. In the Migration view, watch each table move from queued/running to done.
  3. Record the run ID and confirm that each table uses the direct path for this workshop.
  4. Do not repeatedly prompt the agent while chat is quiet—the background runner reports progress in the dashboard.

MigrationRoom running Step 2 with live throughput, ETA, overall progress, per-table progress, and the migration milestone log

Wait until every required table is done. A failed or partial table blocks validation. The completed run should show 8/8 tables, 100% overall progress, and the banner that unlocks Step 3.

MigrationRoom showing a completed direct migration with 8,972,342 rows migrated, all eight tables done, and Step 3 unlocked

Step 3 — Validate

Click Validate only after the migration completes. The agent reuses the migration run ID and writes source/target counts into the dashboard's Validation view.

A validator execution error is not a successful parity check—even when the agent can retrieve the target counts through another query. In this example, the target counting query fails with a driver syntax error and all eight tables are marked errored.

MigrationRoom reporting that validation encountered a target-driver syntax error on all eight tables

Do not continue to Step 4 or rerun the data copy for a validator-only failure. Copy this request into chat so the agent repairs the counting query and reruns validation:

Fix the validation script error and rerun validation. Do not proceed until the
dashboard reports 8 matched, 0 mismatched, and 0 errored.

The repaired run must leave the durable result in the Validation view—not only in a chat response.

MigrationRoom Validation view showing equal source and target counts for all eight tables after the counting query is repaired

Every required row must pass. If a count genuinely differs, stop and ask the agent to diagnose the source snapshot, target schema, transform, and failed batch. Repair that data issue and re-fire Migrate Data, then Validate. Never insert or delete target rows by hand merely to make the screen green.

Step 4 — Rewrite Queries

After validation passes, click Rewrite Queries. Review the original Databricks SQL, the ClickHouse rewrite, the reason for each dialect change, and the returned row count.

MigrationRoom Step 4 showing the validated Databricks analytical workload that will be rewritten and checked in ClickHouse

Pay particular attention to:

  • QUALIFY becoming a subquery and WHERE;
  • LATERAL VIEW explode becoming ARRAY JOIN;
  • VARIANT paths becoming JSON access or typed columns;
  • aggregate/filter becoming ClickHouse array functions;
  • divide-by-zero and missing-map-key semantics; and
  • three-level Unity names becoming ClickHouse database/table names.

The materialized-view query is an important semantic checkpoint. The Databricks query reads the source view directly; the ClickHouse rewrite reads the AggregatingMergeTree target and finalizes stored aggregate states with functions such as countMerge and sumMerge.

MigrationRoom showing the Databricks materialized-view query, its ClickHouse AggregatingMergeTree rewrite, the semantic change note, and matching returned rows

Ask the agent to correct any semantic difference rather than merely producing runnable SQL. When the set is accepted, open Edit · OLAP, replace the source pack with the approved ClickHouse rewrites, and save. Step 5 benchmarks these exact statements.

UI checkpoint

Keep the conversation link plus screenshots of the completed Migration and Validation views. Your checkpoint must show the selected run ID, all required tables completed, passing parity, and the final rewritten query set—never credentials or signed URLs.

  • One authoritative migration run completed in the dashboard.
  • Every required source/target count passed in Validation.
  • Rewrites preserve result shape and semantics, not just syntax.
  • The accepted ClickHouse queries were saved through Edit · OLAP.
  • The conversation link and redacted UI checkpoints were retained.

Continue after the break to 04 Benchmark the baseline.

Trên trang này

Track your progress?

Optional. We email a link to confirm your address; progress records once you open it.

Please use your work email address, not a personal one.

Progress tracking also requires accepting the current Terms of Service in Privacy settings.

VI