Databricks MigrationRoomClickHouse Workshops

Databricks to ClickHouse type map

Map the demo workload's eight Databricks augmentations by semantics rather than spelling.

The table lists every augmentation created by MigrationRoom's current Databricks sample workload. These are design prompts, not automatic one-to-one conversions.

Databricks sourceClickHouse candidatesRequired decision and validation
orders.o_metadata VARIANTJSON, or typed hot-path columns plus retained JSONKeep dynamic paths in JSON; type frequently filtered paths. Validate missing, null, numeric, boolean, array, and nested-object behavior.
lineitem.l_shipping_events ARRAY<STRUCT<status STRING, event_ts TIMESTAMP, location STRING>>Nested(...) or Array(Tuple(...))Choose from element alignment and query semantics. Validate explode/LATERAL VIEW rewrites with ARRAY JOIN or arrayJoin.
lineitem.l_attributes MAP<STRING, STRING>Map(String, String)Check missing-key semantics and map explosion; ClickHouse missing-key lookup can return the value type's default rather than NULL.
lineitem.l_committed_at TIMESTAMPDateTime64(6, 'UTC')State source session/timezone assumptions and validate an instant across timezone settings.
lineitem.l_committed_at_ntz TIMESTAMP_NTZDateTime64(6)Preserve wall-clock semantics separately from an absolute instant; do not silently attach UTC.
lineitem CLUSTER BY (l_shipdate, l_suppkey)Workload-derived MergeTree ORDER BYDo not copy the declaration mechanically. Use selective filters and measured cardinality, then validate with EXPLAIN indexes = 1.
lineitem deletion vectors and Delta historyApplication mutation design, ReplacingMergeTree, ClickPipes/CDC, or deferThere is no copied equivalent for Delta time travel. Define delete/update and audit requirements explicitly before choosing a replacement.
orders.o_orderyear GENERATED ALWAYS AS (year(o_orderdate))MATERIALIZED, ALIAS, or normal columnDecide whether the value is stored, computed on read, or supplied. Validate insert behavior and staged-copy column handling.
daily_order_summary Databricks materialized viewIncremental MV to AggregatingMergeTree, refreshable MV, or normal tableChoose from freshness semantics. For incremental MV, use state/merge functions and separate historical backfill. The source object is optional when serverless requirements are not met.

TIMESTAMP and TIMESTAMP_NTZ form one workload augmentation but require two distinct target choices, so both are shown separately.

Base scalar guidance

Source familyTypical targetGuardrail
DECIMAL(p,s)Decimal(p,s) with supported precisionPreserve exact money arithmetic; do not substitute floating point silently.
DATEDate or Date32Choose from range and validate boundary dates.
Repeated descriptive STRINGLowCardinality(String) candidateMeasure cardinality first; it is not a semantic replacement for arbitrary strings.
Integral keysSigned or unsigned integer sized to observed and future rangePreserve negative-value and overflow semantics rather than choosing by sample alone.

Physical and operational semantics

Type parity is not migration parity. Also decide ordering, partitioning, nullability, mutation behavior, column order for staged imports, and how existing rows enter any insert-triggered materialized view. MigrationRoom's reference DDL is a review aid, not an unquestionable result; the learner's workload and invariants decide acceptance.

本页内容

ZH