Dataset
ClickHouse event table datasets for AI training
A ClickHouse dataset is an export of chosen tables from a business's ClickHouse database: MergeTree event tables of product analytics, ad impressions, logs, metrics or traces, the materialized views that roll them up, each table's CREATE statement and, where the analysts' SQL is wanted, rows of system.query_log. SourceX sources it to a buyer's spec from established businesses that run ClickHouse, self-managed or on ClickHouse Cloud. Each dataset is de-identified, including user identifiers, IP addresses and device IDs in event rows, and licensed for an agreed permitted use.
Dataset manifest
Sourced to your spec- What it is
- Rows of chosen tables and materialized view targets with their CREATE statements, engines, part metadata and, optionally, the query log
- Typical systems
- ClickHouse, self-managed or ClickHouse Cloud: MergeTree-family tables, materialized views and their targets, dictionaries, Distributed tables, and system.query_log where in scope
- Typical history
- Set by each table's TTL rules and dropped partitions; raw event tables often hold a recent window, rollup tables more
- Modality
- Wide append-only event rows with typed columns, arrays, maps and Nested structures; SQL text in the query log
- Delivery formats
- Parquet or ClickHouse Native files per table and partition, with SHOW CREATE TABLE output and row counts per partition
- Preparation
- User IDs, IP addresses, device IDs and free text removed or replaced with stable pseudonyms; query literals screened; aggregate states finalized or kept in Native
- Licensing
- Scoped per database, table and partition range; permitted use agreed per license; end users' consent and third-party fed tables checked
- Availability
- Sourced to your spec; depth of raw history depends on TTL rules, and supply is not guaranteed
What a delivery contains
Fields vary by source system and are fixed per order. A typical delivery includes:
| Field | Type | What it holds |
|---|---|---|
| table | string | The database and table name from system.tables; for a materialized view, the view and its target table are both named. |
| engine | string | The table engine from system.tables, such as MergeTree, ReplacingMergeTree, AggregatingMergeTree or Distributed. |
| create_table_query | string | The full statement SHOW CREATE TABLE returns, with column types, codecs, ORDER BY, PARTITION BY, TTL and SETTINGS. |
| sorting_key | string | The table's ORDER BY expression, which in the Replacing, Summing and Aggregating engines is also the key rows collapse on. |
| partition_id | string | The value of the PARTITION BY expression for the parts the row was read from, such as a month, from system.parts. |
| ttl_rules | array | Table and column TTL expressions from the CREATE statement, each with its action: delete, move, recompress, roll up or reset a column. |
| read_mode | object | Whether the SELECT read rows as stored, with FINAL or through -Merge combinators, and through a Distributed table or one shard's local table. |
| column_types | object | The ClickHouse type of each column, including DateTime time zones, LowCardinality and AggregateFunction signatures. |
| row | object | One row under the table's own column names; a Nested column arrives as parallel arrays named parent.child. |
| mv_source | object | For a materialized view target, the source table and the view's SELECT, and whether it was backfilled. |
| dictionaries | array | Dictionaries that queries and views call through dictGet, from system.dictionaries, with source and layout, delivered as a snapshot. |
| parts_summary | object | From system.parts for the partition: active part count, rows, min_time, max_time and modification_time, which show how far merges had run. |
| query_log_entry | object | Where licensed, a system.query_log row: type, event_time, query, query_kind, query_duration_ms, read_rows, result_rows, memory_usage and exception. |
Field names from the table above; values are masked placeholders.
Example record
{
"table": "analytics.events_local",
"engine": "ReplicatedReplacingMergeTree",
"create_table_query": "CREATE TABLE analytics.events_local (`event_id` UUID, `event_time` DateTime64(3, 'UTC'), `event_name` LowCardinality(String), `user_id` String, `props` Map(String, String), `items.sku` Array(String), `items.qty` Array(UInt16), `ver` UInt64) ENGINE = ReplicatedReplacingMergeTree('/clickhouse/tables/{shard}/analytics/events_local', '{replica}', ver) PARTITION BY toYYYYMM(event_time) ORDER BY (event_name, user_id, event_time, event_id) TTL toDateTime(event_time) + toIntervalMonth(13)",
"sorting_key": "event_name, user_id, event_time, event_id",
"partition_id": "202405",
"ttl_rules": [
{
"scope": "table",
"action": "DELETE"
}
],
"read_mode": {
"select": "FINAL",
"via": "analytics.events (Distributed)",
"shards_read": 4
},
"column_types": {
"event_time": "DateTime64(3, 'UTC')",
"items.qty": "Array(UInt16)"
},
"row": {
"event_id": "6f1c2a9e-4b7d-4c31-9a52-0d8e7b3f5a10",
"event_time": "2024-05-14T09:21:07.412",
"event_name": "checkout_completed",
"user_id": "u_7f3a91c2",
"props": {
"plan": "annual",
"ip": "[IP_REMOVED]"
},
"items.sku": [
"sku_4410",
"sku_0932"
],
"items.qty": [
1,
2
],
"ver": 1715678467
},
"mv_source": null,
"dictionaries": [
{
"name": "analytics.sku_dict",
"layout": "hashed"
}
],
"parts_summary": {
"active_parts": 3,
"rows": 48211937,
"min_time": "2024-05-01T00:00:02",
"max_time": "2024-05-31T23:59:58",
"modification_time": "2024-06-02T03:14:55"
},
"query_log_entry": {
"type": "QueryFinish",
"event_time": "2024-05-20T14:02:11",
"query_kind": "Select",
"query": "SELECT toDate(event_time) AS d, uniqExact(user_id) FROM analytics.events FINAL WHERE event_name = 'checkout_completed' GROUP BY d",
"query_duration_ms": 1840,
"read_rows": 9120344,
"result_rows": 30
}
}Synthetic record for illustration. Field names, structure and format are agreed per order.
What AI teams use it for
Train text-to-SQL on the ClickHouse dialect
Query log text paired with CREATE statements teaches arrayJoin, argMax, -If and -Merge combinators and FINAL as analysts use them.
Model behavior from event sequences
Event rows ordered by user and time support next-event, churn and anomaly models.
Teach agents to design tables and rollups
Sorting keys, partition keys and materialized views, read beside the queries they served, show which designs made which queries cheap.
Predict query cost
Each finished query carries its duration, rows read and memory, labeling SQL text with its cost on a known schema.
Evaluate analytics agents
Questions over a Replacing or Aggregating table have one right result, and an agent that forgets FINAL or -Merge gets a checkably wrong one.
Use-case guides: Coding agents, Enterprise and computer-use agents, Private evaluation sets
What makes this data valuable
Engine known for every table
Each table arrives with its CREATE statement, so nobody guesses whether a row is an event, a version or a partial sum.
Raw rows behind the rollups
The raw event table still covers the period you need, not only the rollups that outlived it.
Read mode on record
The manifest states whether tables were read with FINAL and whether aggregate states were finalized.
Every shard present
Row counts per shard show the export read the whole cluster and not one node's local table.
Query log from the same period
Logged queries hit the delivered tables under the schema then in force, with failed queries kept.
Stable pseudonyms
The same user or device gets the same pseudonym across tables and query text, so joins still work.
Process
ClickHouse dataset
The table engine decides what a row means
Every ClickHouse table names an engine, and in the MergeTree family the engine sets what happens to rows after they are inserted. Each insert writes a part, and background merges later combine parts within a partition. Plain MergeTree keeps every row, and its primary key enforces no uniqueness, so a retried batch can leave duplicates. ReplacingMergeTree keeps one row per sorting key, but only when parts happen to merge, at no set time, and never across partitions. Read without FINAL, it returns collapsed and uncollapsed rows mixed. SummingMergeTree adds up numeric columns per key on the same schedule. AggregatingMergeTree holds AggregateFunction states, binary intermediate results that become values only when a query finishes them, with a -Merge combinator or finalizeAggregation.
The usual ClickHouse materialized view, the incremental kind, is an insert trigger. Its SELECT runs on each inserted block and writes to a target table, usually a Summing or Aggregating one. It does not see rows inserted before it was created unless someone backfilled them, and it does not react when source rows are later deleted. Teams count on that: a TTL rule drops raw events after some months while the hourly rollup stays for years, so the long history is aggregates with no events behind them. A TTL with GROUP BY rolls old rows up in place, and a column TTL resets expired values to the column default, so empty strings in old partitions may be expired data.
A MergeTree table keeps no row history. ALTER TABLE UPDATE and DELETE are mutations that rewrite parts, and there is nothing like time travel to read the table as it stood. Names resolved through dictGet sit in dictionaries that refresh from their source and hold only its current state.
What a SELECT into Parquet returns, and what system.query_log kept
Export is a query. clickhouse-client writes any SELECT to a file with INTO OUTFILE, or the server writes it to object storage through the s3 table function, as Parquet, Native, CSV or JSONEachRow. Native keeps every ClickHouse type, aggregate states included, but few tools outside ClickHouse's own, such as clickhouse-local, read it. Parquet opens almost anywhere, with each type mapped to the nearest Parquet one. Parquet has no type for an aggregate state, so ask whether such columns were finalized before export or left out. How DateTime time zones and Enum columns arrive depends on version and settings, so compare the file schema with the CREATE statement. The file does not say whether the SELECT used FINAL. On a sharded cluster, reading a node's local table instead of the Distributed table returns one shard, which looks complete and holds a fraction of the users.
system.query_log has rows for each query's start, finish or exception, with the query text, user, query_kind, query_duration_ms, read_rows, result_rows, memory_usage, the tables touched, a normalized_query_hash and the client address. It is an ordinary MergeTree table kept separately on each server. ClickHouse does not delete its rows by itself, so it reaches back to the last truncation or to a TTL set in the server configuration, and on ClickHouse Cloud ask what retention applies. After an upgrade that changes its columns, the older rows sit in a renamed table with a numeric suffix. On a busy cluster most rows usually come from dashboards, inserts and the per-shard parts of distributed queries, not from analysts, and the text carries literals, including user IDs typed into WHERE clauses.
To test a sample, count rows against distinct sorting keys in a Replacing table. Sum one overlapping day in a rollup and in its raw table. Compare each table's earliest event time with the history claimed. In the query log, count distinct normalized_query_hash values per user to see how much is human-written.
What to check before licensing
- Have the data owner and your counsel check ClickHouse, Inc.'s terms for ClickHouse Cloud, or the license of the self-managed build in use, on exported data and API use.
- Ask for SHOW CREATE TABLE output for every table and view in scope, and read the engine, ORDER BY, PARTITION BY and TTL clauses first.
- For Replacing, Collapsing, Summing and Aggregating tables, ask whether the export used FINAL or -Merge, then count rows per sorting key in the sample.
- Compare the earliest event time in each raw table with that of its materialized view target, and decide whether aggregate-only history is acceptable.
- Check event tables for user identifiers, IP addresses and device IDs, including inside Map and JSON property columns, and that end users' consent and the business's privacy notice cover this use.
- Ask whether the cluster is sharded and whether the export read the Distributed table or every shard, with row counts per shard.
- For the query log, ask whether system.query_log has a TTL or was ever truncated, whether renamed older tables and every replica were read, and how literals in query text were screened.
Delivery No files move before a signed license. A listing or a request grants no files by itself.
How licensing works through SourceX
- 1
Define
Send the domain, modality, volume, format, timeline and permitted use you need.
- 2
Source
SourceX identifies businesses that hold matching data and are open to licensing it.
- 3
Qualify
Fit, rights and quality are checked, and you review samples before committing.
- 4
License
Scope, permitted use, exclusivity, price and obligations are agreed in writing.
- 5
Deliver
Approved data is prepared, de-identified where required and transferred securely.
Questions Acquisition Partners ask
How far back do ClickHouse event tables go?
As far as each table's TTL rules and partition drops allow, which differs table by table. Raw event tables often keep a rolling window, while the materialized view targets fed from them keep hourly or daily aggregates for much longer. Ask for the earliest event time per table and its TTL clause before you agree a period.
Will we get raw events or aggregates?
That depends on which tables are in scope, and the CREATE statements tell you. A plain MergeTree table holds one row per event. A materialized view target with a Summing or Aggregating engine holds totals or aggregate states per key, and the events behind them may be gone. State in your request which you need.
Why does the table engine matter for training data?
Because the engine decides whether a row is an event, one of several versions of a record, or a partial sum awaiting a merge. A ReplacingMergeTree table read without FINAL returns duplicates that the business's own queries never see. The engine and the read mode therefore have to travel with the rows.
Can the SQL that analysts ran be included?
Yes, where the business kept it. ClickHouse records queries in system.query_log with their text, duration, rows read and errors, until the table is truncated or a TTL, where one is set, removes them. Most rows come from dashboards and ingestion, so ask for filtering by user and query kind, and for literals in the text to be screened.
Should we ask for Parquet or the Native format?
Parquet suits most buyers because most data tools read it. Native is the better choice when you will load the data into ClickHouse or need AggregateFunction states, which Parquet has no type for. Either way, ask for the CREATE statements, since a Parquet schema does not record the engine, sorting key, TTL or original ClickHouse types.
Is SourceX affiliated with ClickHouse, Inc.?
ClickHouse is named to identify the system the records come from. That does not imply a partnership with or endorsement by ClickHouse, Inc. The records belong to the business that runs ClickHouse, which licenses them under a signed agreement, and a request does not guarantee a matching dataset. Buyers should still confirm with counsel that the vendor's terms allow the intended use of exported data.
Related datasets
- Web and product analytics events
Event-level logs from a first-party site or app, with the tracking plan and keys to business outcomes
- Production logs and distributed traces
Logs, traces and metrics for incident and baseline windows, tied to the change that ended each incident
- SQL query logs paired with the business question
Analyst-run warehouse queries in session order, each with schema, run outcome and the paired business question
- Snowflake warehouse tables
Raw and modeled tables, views, VARIANT columns, task and procedure definitions and optional query history from one Snowflake account
- Apache Kafka topic event streams
Records of chosen topics, decoded with their registered schemas, with partition, offset, timestamp, key and headers kept
Evaluating this data for procurement?
Diligence packets are prepared per dataset. Rights, privacy processing and quality differ between datasets.
Request dataset diligenceTell us what your models need
Send your spec — domain, volume, format, timeline and permitted use — and SourceX will match it against partner data and come back with what can be licensed.
Updated 26 November 2026.