
Event Mapping
Here’s how Edgee events map to ClickHouse records:| Edgee Event | ClickHouse record | Description |
|---|---|---|
| Page | A new record in the configured table | Full JSON dump of the Page event |
| Track | A new record in the configured table | Full JSON dump of the Track event |
| User | A new record in the configured table | Full JSON dump of the User event |
Getting Started
To integrate ClickHouse into your Edgee project:- Open the Edgee console and navigate to your project’s Components.
- Select “Add a component” and choose
edgee/clickhousefrom the list of available components. - Enter your ClickHouse configuration and credentials, and click Save.
- Create a new table in ClickHouse with the correct schema (see next section).
- Once the component has been configured, you are ready to send new records to ClickHouse.
Creating the ClickHouse Table
Before ingesting events, you’ll ned to create a new table with the following schema, depending on your ClickHouse version andJSON support:
JSON fields
New records are ingested individually usingJSONEachRow.
If your ClickHouse version supports JSON or Object('json') types, both context and data will contain additional JSON sub-fields, whose schema is automatically inferred at runtime.
Please note that:
- The sub-fields under
contextare always the same, so you can use queries such asSELECT context.client.ip AS ip FROM edgee - The sub-fields under
datadepend on the value ofevent_type, so you can use queries such as:SELECT data.Track.name FROM edgee WHERE event_type = 'Track'SELECT data.Page.path FROM edgee WHERE event_type = 'Page'
Component Name
When configuring the component in your Edgee Data Layer or within SDK calls, useedgee/clickhouse as the component name: