Skip to main content

Renderer

The renderer turns one manifest object into the statements that create it on one ClickHouse platform, and is one part of dfe-schemas.

FactValue
Repohyperi-io/dfe-schemas, module dfe_schemas.render
Packagethe dfe-schemas wheel on PyPI, class Renderer
Configthe platform, the data database, the default TTL, the broker count and Kafka tiered storage, all passed by dfe-engine
Endpointsnone, it is a library
Metricsnone. make render renders every object for both platforms

The renderer runs inside dfe-engine and only builds statements. Applying them is the engine's job.

Figure 1. L4 Detail -- Renderer. Up: L3 Components -- dfe-schemas. Down: none.

How it works​

  1. Table DDL builds the columns, sorting key, skip indexes and TTL. Each index comes from the column's use case in registries/ddl.yaml.
  2. Platform DDL writes the argumentless Replicated<variant> engine with no ON CLUSTER, through engine_clause(). Cloud rewrites it to SharedMergeTree, and a self-hosted server without Keeper is rejected rather than given a plain form. The CREATE DATABASE and a JSON table's platform-only settings are written once per platform in dfe_schemas/sql/platform.sql, and the Platform probe picks the block, once per connection.
  3. Checksum is a sha256 over the statements with the platform token removed and whitespace collapsed.

A table with an engine that stores no rows is the one exception to step 2. usage_events is a Merge table over dfe-engine's all_sources, so it takes the engine it names.

Interfaces​

CallReturns
Renderer(manifest, platform=..., data_database=..., default_ttl_days=..., broker_count=..., kafka_tiered_storage=...)A renderer bound to one deployment
render_table(...)The statements for one table
checksum(statements)The platform-free sha256 dfe-engine records
PlatformProbeThe platform behind one connection, asked at most once

The checksum leaves out the database's ON CLUSTER and ENGINE, a table's Replicated prefix and empty argument list, and the platform-only settings. One schema reads as one checksum on Cloud and self-hosted, so the applier's ledger answers "has this object changed" rather than "was it applied somewhere else". A .sql view's opening comment block is stripped first, so a reworded comment never reads as a changed view.

Scaling and failure​

A render runs once per object at engine boot, and nothing in it grows with data volume. An object that breaks a check raises rather than render. The checks are listed in CONTRIBUTING.md Context.