diff --git a/create_a_materialized_view_batch_ingest/README.md b/create_a_materialized_view_batch_ingest/README.md index ddde22e9..f22fbc7a 100644 --- a/create_a_materialized_view_batch_ingest/README.md +++ b/create_a_materialized_view_batch_ingest/README.md @@ -36,17 +36,12 @@ DATASOURCE events_per_location_mv `events_per_location_mv.datasource`: ```sql -NODE count_events_per_location -SQL > - - SELECT - JSON_VALUE(payload, '$.location') AS location, - countState() AS hits - FROM analytics_events - GROUP BY location +SCHEMA > + `location` String, + `hits` AggregateFunction(count) -TYPE materialized -DATASOURCE events_per_location_mv +ENGINE "AggregatingMergeTree" +ENGINE_SORTING_KEY "location" ``` ## 2: Create the Endpoint