Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 5 min read How-to mediumAdept

Visualizing Foursquare places with ClickHouse

The Foursquare open places dataset (about 100 million records) loads straight from S3 Parquet into ClickHouse in 42 seconds and 11 GB. The table stores Web Mercator coordinates as materialized UInt32 columns, is ordered by a Morton (Z-order) space-filling curve, and has minmax indices so map tiles can be queried fast. The existing adsb.exposed air-traffic visualizer was reused with a 48-line change to render pixel-level tiles in the browser. Compared with Foursquare Studio's H3 hexagons, Kepler.gl and DuckDB-based maps, it gives higher resolution and smoother interactivity, but does not correct point density for latitude.

Assumes: SQL basicsmap projections

Related posts

  • Announcing adsb.exposed - Interactive Visualization and Analytics on ADS-B Flight Data with ClickHouse

    ClickHouse mediumAdept

    adsb.exposed renders tens of billions of ADS-B flight records as interactive map tiles. A parameterized ClickHouse SQL query computes the RGBA value of every pixel in each 1024x1024 tile on the fly. The single-page Leaflet frontend fetches raw RowBinary bitmaps over HTTP with ZSTD compression, which compresses better than PNG, and loads progressively from 1% and 10% sampled tables, built with materialized views, up to the full data. The MergeTree table stores Web-Mercator coordinates as UInt32 materialized columns and is ordered by a Morton curve with minmax indexes, so each tile query reads only the data it needs. The service runs on a chaos-tested ClickHouse Cloud staging environment, with requests raced against a backup service.

  • Birds in the cloud

    ClickHouse mediumAdept

    The Cornell Lab of Ornithology's eBird dataset of 1.5 billion bird observations (a 58 GB zip holding a 440 GB CSV) can be loaded into ClickHouse and visualized on the adsb.exposed interactive map. clickhouse-local queries the CSV inside the zip with schema inference. The target table drops Nullable, uses LowCardinality for low-distinct columns, and derives a date from EPHEMERAL year/month/day columns. Materialized Web Mercator UInt32 coordinates are ordered by a Morton space-filling curve with minmax indexes for fast tile queries, and the stored table compresses to 16.8 GB, about 11 bytes per row.

  • Exploring Global Internet Speeds using Apache Iceberg and ClickHouse

    ClickHouse mediumAdept

    ClickHouse's iceberg table function can query the Ookla global internet-speed dataset (128M rows) directly from S3. The schema comes from Iceberg metadata, and the walkthrough includes aggregations such as download-speed quantiles. It notes current gaps: no v2 row-level deletes or schema evolution, no partition pruning, S3-only support, and no use of sort order for file skipping. The data is then loaded into a MergeTree table, WKT tiles are parsed into Ring types, and polygon centroids are computed with shoelace-formula SQL UDFs built on arrayFold. The polygons are rendered as SVG maps using only SQL, with h3 indexes, polygon dictionaries, Mercator projection and color interpolation.

  • Analyzing Hugging Face datasets with ClickHouse

    ClickHouse mediumAdept

    Hugging Face's Datasets Server automatically converts every dataset to Parquet and exposes the file URLs through a REST endpoint, so clickhouse-local can query any dataset with plain SQL via the url function and URL table engine. The walkthrough uses a Spotify tracks dataset to show aggregations, varPop checks, and bar-function histograms, then moves to ClickHouse's statistical functions and a reusable UDF that queries a dataset by name alone. Practical gotchas include setting max_http_get_redirects = 1 to follow the CDN redirect and enable_url_encoding = 0 to preserve escaped paths. Slow reads caused by small Parquet row groups, each triggering a separate HTTP request, were fixed in ClickHouse issue 53069.

  • Better Analytics at Scale with Trackingplan and ClickHouse

    ClickHouse mediumAdept

    Trackingplan, which tests web, mobile and backend analytics by sampling events sent to tools like Google Analytics and Segment, moved from DynamoDB with PySpark-precomputed statistics to ClickHouse Cloud so it could answer unforeseen ad hoc queries on raw data. After evaluating Snowflake, BigQuery, Redshift and Athena, the team found ClickHouse 20x faster than Athena and cheaper than the pay-per-scan options for a continuous query workload. Materialized views, backfilled via INSERT INTO SELECT, precompute the common dashboard statistics. Customer-ID ordering keys handle multi-tenancy and ad hoc queries across about 30 billion rows growing 400% per year, and Map/Array types hold dynamic properties.

The quest for software engineering knowledge.

Look:
Layout: