Interview's MateData Engineer
Interview's Mate

Data Engineer

SQL · Spark · Lakehouse · Streaming

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Data Engineer topics
Lesson 94/ 160
05. Data Lakehouses & Open Table Formats

Query Engines for Lakehouses (Trino / Presto, StarRocks, ClickHouse, Dremio)

Query open tables with engines optimized for federated SQL, real-time OLAP, or lake acceleration.

IntermediateTrino · StarRocks · ClickHouse3 quiz questions
Practice Generative AI Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Federation, latency, concurrency, and mutation. Next, table/catalog compatibility and pushdown. Finally, cold/warm p95, correctness, refresh, and cost.

Think of it like…

These engines are specialized vehicles on the same open road: a pickup joins sources, a sports car serves dashboards, and a cached shuttle repeats popular routes, each with different fuel and road limits.

Where you’ve seen it

Trino queries Iceberg plus Postgres for an analyst join, StarRocks serves subsecond high-concurrency dashboards after ingest, ClickHouse materializes sorted event aggregates, and Dremio reflections accelerate S3 SQL behind a governed semantic view.

Words you’ll hear

Trino
An MPP federated coordinator/worker SQL engine optimized for interactive queries across catalogs and data sources.
StarRocks
An MPP real-time analytical database oriented toward high-concurrency dashboards and low-latency ingestion.
ClickHouse
A columnar OLAP engine with MergeTree-family storage, ordering, materialized views, and aggressive vectorized execution.
Operational boundary
A federated JOIN pushes a huge cross-source exchange, ClickHouse import and primary/sort key choices are workload-specific, and an acceleration layer's stale reflection can violate freshness expectations. Choose engines by latency, concurrency, source federation, ingestion, update semantics, and table-format metadata support; benchmark representative file sizes and pushdown, and document data ownership and caching invalidation.

Visual diagram

Loading interactive diagram

Theory & deep dive

Trino: the working mechanism

Trino/Presto favor distributed federated SQL, StarRocks targets low-latency analytics, ClickHouse is a fast columnar OLAP engine, and Dremio accelerates lake queries with a semantic/reflection layer.

Federation, latency, concurrency, and mutation. Table/catalog compatibility and pushdown, then joins, ingestion, cache, and sort/distribution; this exposes the state governed by ClickHouse.

Query Engines for Lakehouses in one concrete design

Trino queries Iceberg plus Postgres for an analyst join, StarRocks serves subsecond high-concurrency dashboards after ingest, ClickHouse materializes sorted event aggregates, and Dremio reflections accelerate S3 SQL behind a governed semantic view.

Key takeaway: Trino/Presto favor distributed federated SQL, StarRocks targets low-latency analytics, ClickHouse is a fast columnar OLAP engine, and Dremio accelerates lake queries with a semantic/reflection layer

Query Engines for Lakehouses: failure mode and production response

A federated JOIN pushes a huge cross-source exchange, ClickHouse import and primary/sort key choices are workload-specific, and an acceleration layer's stale reflection can violate freshness expectations.

Choose engines by latency, concurrency, source federation, ingestion, update semantics, and table-format metadata support; benchmark representative file sizes and pushdown, and document data ownership and caching invalidation. Track Cold p95 as "metadata/object-scan latency without warm acceleration", and make Concurrency visible to the dataset owner.

Key takeaway: Choose engines by latency, concurrency, source federation, ingestion, update semantics, and table-format metadata support; benchmark representative file sizes and pushdown, and document data ownership and caching invalidation.

How it works, step by step

Step 1 of 4
Trino

1. Profile request

Federation, latency, concurrency, and mutation. Trino/Presto favor distributed federated SQL, StarRocks targets low-latency analytics, ClickHouse is a fast columnar OLAP engine, and Dremio accelerates lake queries with a semantic/reflection layer.

federation, latency, concurrency, and mutation
Key numbers at this step
Cold p95
metadata/object-scan latency without warm acceleration
StarRocks
An MPP real-time analytical database oriented toward high-concurrency dashboards and low-latency ingestion.

When to use it & trade-offs

What it is

Trino/Presto favor distributed federated SQL, StarRocks targets low-latency analytics, ClickHouse is a fast columnar OLAP engine, and Dremio accelerates lake queries with a semantic/reflection layer. Trino queries Iceberg plus Postgres for an analyst join, StarRocks serves subsecond high-concurrency dashboards after ingest, ClickHouse materializes sorted event aggregates, and Dremio reflections accelerate S3 SQL behind a governed semantic view.

Why it matters: A federated JOIN pushes a huge cross-source exchange, ClickHouse import and primary/sort key choices are workload-specific, and an acceleration layer's stale reflection can violate freshness expectations. Choose engines by latency, concurrency, source federation, ingestion, update semantics, and table-format metadata support; benchmark representative file sizes and pushdown, and document data ownership and caching invalidation.

When to reach for it

  • Query open tables with engines optimized for federated SQL, real-time OLAP, or lake acceleration.
  • Choose Trino because it provides this capability: An MPP federated coordinator/worker SQL engine optimized for interactive queries across catalogs and data sources.
  • Keep evidence for Cold p95 at "metadata/object-scan latency without warm acceleration" so the last production stage-Validate - cold/warm p95, correctness, refresh, and cost-remains testable.

When to avoid or be careful

  • A federated JOIN pushes a huge cross-source exchange, ClickHouse import and primary/sort key choices are workload-specific, and an acceleration layer's stale reflection can violate freshness expectations.
  • Do not conflate StarRocks with Trino. The second concept contributes different behavior: An MPP real-time analytical database oriented toward high-concurrency dashboards and low-latency ingestion.
  • Release only after this guardrail is in place: Choose engines by latency, concurrency, source federation, ingestion, update semantics, and table-format metadata support; benchmark representative file sizes and pushdown, and document data ownership and caching invalidation.

Trino / StarRocks / ClickHouse - roles, limits, and operating cost

Trino
Best for: An MPP federated coordinator/worker SQL engine optimized for interactive queries across catalogs and data sources.

Strengths: An MPP federated coordinator/worker SQL engine optimized for interactive queries across catalogs and data sources. Trino/Presto favor distributed federated SQL, StarRocks targets low-latency analytics, ClickHouse is a fast columnar OLAP engine, and Dremio accelerates lake queries with a semantic/reflection layer.

Watch out: A federated JOIN pushes a huge cross-source exchange, ClickHouse import and primary/sort key choices are workload-specific, and an acceleration layer's stale reflection can violate freshness expectations.

StarRocks
Best for: An MPP real-time analytical database oriented toward high-concurrency dashboards and low-latency ingestion.

Strengths: An MPP real-time analytical database oriented toward high-concurrency dashboards and low-latency ingestion. In this workflow it supports: Plan compute - joins, ingestion, cache, and sort/distribution.

Watch out: The operating cost is real: queries that meet SLO before queue or memory pressure.

ClickHouse
Best for: A columnar OLAP engine with MergeTree-family storage, ordering, materialized views, and aggressive vectorized execution.

Strengths: A columnar OLAP engine with MergeTree-family storage, ordering, materialized views, and aggressive vectorized execution. Its output can be checked with Pushdown.

Watch out: Operating guardrail: Choose engines by latency, concurrency, source federation, ingestion, update semantics, and table-format metadata support; benchmark representative file sizes and pushdown, and document data ownership and caching invalidation.

Interview signals & numbers to know

When this topic comes up

  • “Where is the failure boundary for Trino, and how would Cold p95 reveal it?”
  • “Why is StarRocks distinct from this behavior: a columnar OLAP engine with MergeTree-family storage, ordering, materialized views, and aggressive vectorized execution?”
  • Production clue: A federated JOIN pushes a huge cross-source exchange, ClickHouse import and primary/sort key choices are workload-specific, and an acceleration layer's stale reflection can violate freshness expectations.
  • Design probe: Choose engines by latency, concurrency, source federation, ingestion, update semantics, and table-format metadata support; benchmark representative file sizes and pushdown, and document data ownership and caching invalidation.

Benchmarks & rules of thumb

Cold p95 -
metadata/object-scan latency without warm acceleration
Concurrency -
queries that meet SLO before queue or memory pressure
Pushdown -
partition, projection, filter, and aggregate work completed near storage

Common mistakes & follow-ups

Common interview mistakes

  • A federated JOIN pushes a huge cross-source exchange, ClickHouse import and primary/sort key choices are workload-specific, and an acceleration layer's stale reflection can violate freshness expectations.
  • Reporting success from a job exit code without checking Cold p95 and Concurrency.
  • Treating this example as complete without replay, rollback, or access boundaries: Trino queries Iceberg plus Postgres for an analyst join, StarRocks serves subsecond high-concurrency dashboards after ingest, ClickHouse materializes sorted event aggregates, and Dremio reflections accelerate S3 SQL behind a governed semantic view.

Likely interviewer follow-ups

  • How would you prove this contract instead of only checking that the command ran: An MPP federated coordinator/worker SQL engine optimized for interactive queries across catalogs and data sources.
  • What does the recovery plan do when this occurs? A federated JOIN pushes a huge cross-source exchange, ClickHouse import and primary/sort key choices are workload-specific, and an acceleration layer's stale reflection can violate freshness expectations.
  • When is Trino insufficient for Concurrency, and what does adding StarRocks cost in Cold p95?
Interview tip: Lead with the data path and failure boundary: Trino/Presto favor distributed federated SQL, StarRocks targets low-latency analytics, ClickHouse is a fast columnar OLAP engine, and Dremio accelerates lake queries with a semantic/reflection layer. Then make the answer operational: Choose engines by latency, concurrency, source federation, ingestion, update semantics, and table-format metadata support; benchmark representative file sizes and pushdown, and document data ownership and caching invalidation.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Query Engines for Lakehouses (Trino / Presto, StarRocks, ClickHouse, Dremio) with data engineer interview Q&A and hands-on practice.

Open Data Engineer Q&A →Machine Learning Q&A
Previous topic
Open Catalogs & Interoperability (Unity Catalog, Apache Polaris, AWS Glue, Nessie)
Next topic
DuckDB + Iceberg / Delta Lake Local & Serverless Analytics