Selectel developer Ivan Khramov explains how to integrate ClickHouse with S3 and Iceberg to improve interactive analytics performance. While Trino is suitable for heavy tasks, it lacks fast local storage, leading to latency issues when multiple users access data simultaneously.
The article explores various methods for reading Iceberg tables in ClickHouse, starting from the basic s3() function. This function reads files directly from object storage but ignores metadata, which can lead to incorrect results due to stale files, ignored deletions, and schema mismatches.
The icebergS3() function family offers a more advanced approach by traversing the Iceberg metadata chain. However, without a dedicated metadata catalog, ClickHouse must guess the latest table version based on file names, which can cause conflicts in multi-writer environments.
The IcebergS3 engine allows defining tables with specific names and credentials, simplifying access for BI tools and analysts. Yet, this method still lacks synchronization with external catalogs, creating a separate registry of tables that requires manual management.
The optimal solution is connecting a full catalog as a database using the DataLakeCatalog engine. This enables ClickHouse to query a central catalog for the current table state, ensuring consistency across different engines like Trino and Spark while eliminating manual table registration.






