Vectorized Lakehouse vs Apache Spark: Which Is Faster, and When?

Compare vectorized lakehouse engines with Apache Spark: CPU-bound gains, shuffle costs, fallback risks, and a benchmark checklist for your own workloads.

Vectorized Lakehouse vs Apache Spark: Which Is Faster, and When?

By jackey.ye · Updated 2026-11-28A vectorized lakehouse is not automatically faster than Apache Spark. It is faster on the part of a query that runs inside the vectorized engine, and that part varies enormously by workload. The honest version of the headline is conditional: on CPU-bound analytical SQL — joins, aggregations, expression evaluation, decimal arithmetic — a native columnar engine can deliver large, repeatable gains. On shuffle-heavy ETL, I/O-bound scans, or pipelines that fall back to Spark for unsupported operators, the gain shrinks and can disappear.

That distinction matters because it changes what you should do next. The question is not "which engine wins" but "what share of my queries would actually execute in the fast path, and how do I prove the gain on my own data before committing?" This article works through the mechanism, the workload fit, the shuffle cost that vectorization leaves untouched, a benchmarking method a vendor cannot game, the compatibility risks that erode gains, how to read "10x faster" claims, and an acceptance checklist you can sign off against.

Summary Comparison: Vectorized Lakehouse vs Apache Spark

The short answer: a vectorized lakehouse engine wins on CPU-bound analytical SQL and loses or ties on workloads dominated by shuffle, I/O, or unsupported-operator fallback. The table below maps each evaluation criterion to what you should expect, with performance figures kept at their published scope rather than treated as general facts.

Evaluation criterion

Apache Spark baseline

Vectorized lakehouse engine

Execution model

Row-oriented operators with runtime code generation (whole-stage Java code)

Columnar batches with interpreted vectorization, often native (C++) code

CPU-bound scans, joins, aggregations

Baseline

Largest gains; published benchmarks report multiples, not percentages

Decimal and expression-heavy SQL

JVM decimal paths can dominate runtime

Native integer decimal kernels; often the single biggest per-query win

I/O-bound and network-bound queries

Baseline

Little to no improvement; the engine is not the bottleneck

Shuffle-heavy joins and exchanges

Baseline

Partial gains at most; shuffle writes and serialization remain

Fallback / compatibility risk

None by definition

Real; unsupported operators revert to Spark and add conversion cost

Operational complexity

Mature tooling, broad ecosystem

Newer; off-heap memory tuning and observability differ

Migration effort

None

Depends on SQL/UDF/format coverage; measure per query

Cost model

Compute hours, largely CPU-bound

Depends on whether the engine is priced per hour or per data processed

Read this table as a workload-mix decision, not a scoreboard. A team whose queries are 80% aggregation-heavy BI will see a different result from a team running large multi-stage ETL with wide shuffles. Published figures from Databricks Photon, Uber's Gluten deployment, Google's Lightning Engine, and Singdata's own benchmark page each describe a specific engine, dataset, and configuration; they are not interchangeable, and none of them predicts your result. The rest of this article gives you the mechanism and the measurement method to replace that uncertainty with your own numbers.

Execution Model: Why Columnar Batches Beat Row-at-a-Time

The mechanical reason a vectorized engine can be faster is that it processes data in columnar batches instead of one row at a time, which amortizes per-row overhead and lets the CPU work on contiguous memory. The Photon paper describes the design concretely: values of a column are stored contiguously, groups of columns are processed in batches to bound memory and exploit cache locality, and the basic unit is a column vector — a contiguous value buffer plus a byte vector marking NULL-ness, with batch-level metadata such as string encoding attached.

Three consequences follow. First, per-row dispatch cost is paid once per batch rather than once per row, so tight loops over contiguous buffers pipeline and prefetch well. Second, kernels can be specialized at compile time on batch properties: Photon's example kernel takes template parameters for whether the batch contains NULLs and whether all rows are active, so branches over those conditions compile away. Third, the engine can adapt at runtime — building metadata about a batch and choosing a code path — which matters in lakehouse settings where statistics and constraints may be missing on raw data.

Spark SQL takes the other main route: runtime code generation, which fuses operators into specialized loops and eliminates virtual calls. That is a genuine performance advantage in some cases, and the Photon authors say so. The tradeoff is observability — fused row-at-a-time loops make it hard to attribute time to individual operators — and the difficulty of adapting generated code to changing batch properties without recompiling. Photon also moved from the JVM to native C++ because its workloads were becoming CPU-bound and JVM optimization ceilings (including JIT method-size limits) created performance cliffs. Neither model is universally superior; the point is that vectorization buys you something specific — cheaper per-value CPU work — and only where CPU work is the bottleneck.

Which Workloads Actually Get Faster

Gains concentrate on CPU-bound operations — joins, aggregations, SQL expression evaluation, decimal arithmetic, and Parquet writes — and largely vanish on queries that are I/O- or network-bound. The Photon paper states this scope explicitly: Photon primarily improves queries spending most of their time on CPU-heavy operations, and the authors "do not expect Photon to significantly improve the performance of queries that are IO or network bound."

Reported speedup vs. each study's own baseline Grouped bars showing average and maximum speedup for Photon on TPC-H and Gluten/Velox at Uber on TPC-DS. Photon: 4x average, 23x maximum. Uber Gluten/Velox: ~3.4x average, 4x best case. Baselines differ between studies. Reported speedup vs. each study's own baseline. grouped bar data: Average: Photon vs. prior Databricks Runtime (TPC-H SF=3000) 4, Gluten/Velox vs. OSS Spark (TPC-DS 1 TB, Uber) 3.4; Maximum: Photon vs. prior Databricks Runtime (TPC-H SF=3000) 23, Gluten/Velox vs. OSS Spark (TPC-DS 1 TB, Uber) 0; Best case: Photon vs. prior Databricks Runtime (TPC-H SF=3000) 0, Gluten/Velox vs. OSS Spark (TPC-DS 1 TB, Uber) 4.Source: Photon: A Fast Query Engine for Lakehouse Systems (SIGMOD 2022); Making Every Core Count: In Pursuit Of Faster Apache Spark Jobs at Uber 2022. Reported speedup vs. eachstudy's own baseline Photon vs.priorDatabricksRuntime (TPC-HSF=3000) Gluten/Veloxvs. OSS Spark(TPC-DS 1 TB,Uber) 0 6.25 12.5 18.75 25 4 3.4 Average 23 0 Maximum 0 4 Best case Source: Photon: A Fast Query Engine for LakehouseSystems (SIGMOD 2022); Making Every Core Count: InPursuit Of Faster Apache Spark Jobs at Uber (2022)

Speedups reported by two different vectorized engines against two different baselines. Photon's figures compare against the prior Databricks Runtime (a Spark-based engine) on 22 TPC-H queries at SF=3000; Uber's compare Apache Gluten/Velox against open-source Spark on TPC-DS at 1 TB. Different engines, datasets, hardware and baselines — read each within its own scope, not as a ranking.

Within that scope, the published numbers are large but specific. On the 22 TPC-H queries at SF=3000 in Delta format on S3, across an 8-node AWS cluster of i3.2xlarge instances, Photon reported a maximum speedup of 23× and an average of 4× versus the Databricks Runtime baseline, measured as the minimum time across three runs after a warm-up. The 23× case was Q1, bottlenecked on decimal arithmetic. Micro-benchmarks showed a 3× hash-join speedup and 2× end-to-end on Parquet writes, with the write gain coming mainly from column encoding rather than compression or storage time.

A second data point comes from a different engine and a different setup. Uber reported that adopting Apache Gluten and Velox — offloading Spark SQL operators to a native vectorized engine — produced roughly 3.5× faster queries and 3.4× lower CPU cost across migrated workloads with no user code changes. In its TPC-DS 1 TB runs, the best case was 4× with 64 executors and the worst 2.7× with 32 executors, averaging about 3.4×; on average query duration the improvement was 3.2×, with a best single query near 6× and degraded performance in rare cases where runtime was under about a minute for heavy shuffle operations.

These are different engines, datasets, scale factors, hardware, and baselines. Do not rank them against each other or average them. What transfers is the shape: the wins are real and large on CPU-bound SQL, and the tail — short queries, heavy shuffles — is where the gains thin out.

How Much of Spark's Cost Is Shuffle and Scheduling

A vectorized engine accelerates the in-memory execution of a query; it does not remove the cost of moving data between stages, and on many queries that movement is the dominant cost. The Photon paper gives a clean illustration: even after Photon's join improvements, TPC-H Q9 was "dominated by writing files for data shuffles (50% of the total time)." Photon gains partially on exchanges through better serialization and encoding, but the write itself remains.

TPC-H Q9 in Photon: share of total runtime spent writing shuffle files Donut chart showing that 50% of TPC-H Q9's total runtime in Photon was spent writing files for data shuffles, with the remaining 50% covering all other work including the vectorized join. TPC-H Q9 in Photon: share of total runtime spent writing shuffle files. donut data: Shuffle file writes 50; All other work (join, scan, aggregation) 50.Source: Photon: A Fast Query Engine for Lakehouse Systems (SIGMOD 2022), §6.2 2022. TPC-H Q9 in Photon: share oftotal runtime spent writingshuffle files 50% Shuffle file write Shuffle file writes 50 All other work (join, scan, aggregation) 50 Source: Photon: A Fast Query Engine for LakehouseSystems (SIGMOD 2022), §6.2 (2022)

Photon's own TPC-H Q9 profile: even after vectorized join improvements, half of total runtime went to writing shuffle files. Vectorization accelerates in-memory execution; it does not remove the cost of moving data between stages.

The practical implication is that a speedup measured on a scan-and-aggregate query does not carry over to a multi-stage join pipeline. If half your runtime is shuffle write and read, halving the CPU portion of the other half moves end-to-end time by roughly a quarter — not by 4×. That arithmetic, not any vendor's headline, is what determines whether a migration pays off for a given pipeline.

It also means a fair comparison must hold the shuffle configuration constant. Spark's adaptive query execution coalesces post-shuffle partitions based on map-output statistics when spark.sql.adaptive.enabled and spark.sql.adaptive.coalescePartitions.enabled are both true, using a target partition size (spark.sql.adaptive.advisoryPartitionSizeInBytes, default 64 MB) and a minimum partition size (spark.sql.adaptive.coalescePartitions.minPartitionSize, default 1 MB); the Spark SQL performance-tuning guide documents these settings and notes that parallelismFirst defaults to true, which ignores the target size and respects only the minimum to maximize parallelism. A benchmark that leaves AQE on for one engine and off for the other, or changes partition counts between runs, is measuring configuration, not engineering. Uber's TPC-DS comparison, for instance, states that AQE and dynamic executor allocation were disabled for all runs.

Benchmarking Without Getting Gamed

Run the benchmark yourself, on a fixed configuration, with published query definitions and reported distributions — not a vendor's best-case single run. The method below is deliberately boring; that is what makes it hard to game.

  1. Use standard query definitions and substitution parameters. Take TPC-H or TPC-DS query text and parameter generation from the official specifications rather than a vendor's adapted set. The TPC-H specification defines the queries, the substitution parameters, and the rules for permissible minor modifications.

  2. Fix the variables that change results. Pin scale factor, cluster shape and instance type, file format and table format version, compression, and caching behavior. Record every one of them.

  3. Control the optimizer knobs explicitly. Decide whether AQE and dynamic allocation are on or off, apply the same choice to both engines, and document it. Changing partition counts between runs invalidates the comparison.

  4. Warm up, then repeat. Run a warm-up pass, then multiple iterations, and report median and p95 — not the fastest run. A single best-case number tells you almost nothing about a production SLA.

  5. Measure wall-clock and cost. Runtime alone hides the difference between fewer, larger instances and more, smaller ones. Convert to cost per query at your actual rates.

  6. Run on your data or a representative synthetic set. A benchmark on a schema and data distribution unlike yours predicts your performance poorly, especially for string-heavy or nested data.

  7. Do not call it a TPC result. A result carrying the TPC name requires an independent audit by a TPC-certified auditor, as the TPC-H specification states in its general rules. A vendor's internal "TPC-DS-like" run is a useful data point and nothing more.

For lakehouse tables specifically, also fix the table format and its maintenance state. Iceberg's table specification defines the manifest and metadata layout, including per-file column sizes, value counts, null counts, and lower/upper bounds that engines use for pruning. A table with stale manifests and many small files will benchmark differently from a compacted one, so record compaction and manifest state alongside your other configuration.

Compatibility and Migration Risk

The real speedup of a vectorized engine is bounded by how much of each query actually runs in it, so measure fallback coverage per query rather than per cluster. Engines such as Gluten and Velox execute the operators they support natively and hand the rest back to vanilla Spark, paying a column-to-row and row-to-column conversion at every boundary. The Gluten Velox backend limitations document for version 1.2.1 lists the following cases. These are version-specific limitations; check your deployed release before applying them:

  • ANSI mode: Gluten does not support ANSI mode; if it is enabled, the plan always falls back to vanilla Spark.

  • Regex semantics: Velox implements rlike, regexp_extract and similar functions on RE2, while Spark uses java.util.regex. Lookaround patterns are unsupported in RE2, and \s does not treat \v as whitespace the way Java does. A fallback configuration exists for teams that cannot tolerate the risk.

  • JSON handling: Velox supports only double-quoted strings in JSON data; single quotes produce incorrect results, and [*] in a get_json_object path returns null.

  • Parquet datetime rebase: Gluten ignores spark.sql.parquet.datetimeRebaseModeInRead and returns what is written in the file, so legacy Julian-Gregorian dates can differ from Spark's output. The write-side setting has a matching read-back discrepancy.

  • NaN: Velox does not support NaN, so comparisons involving NaN can return unexpected results.

  • Partition and bucket writes: Support varies by Spark version; bucket writes fall back, and dynamic partition writes are unsupported on Spark 3.2 and 3.3.

  • File formats and types: Only Parquet is fully supported and ORC partially; Byte type and certain nested types in Parquet scans fall back.

The consequence is arithmetic, not opinion. A query with scattered fallbacks pays conversion overhead without keeping enough work native to recover it — the Onehouse explainer on Gluten notes that such a plan can run slower than plain Spark. Treat result correctness as a separate gate: run differential tests comparing row-level output against Spark on production-shaped data, especially for dates, JSON, regex, and NaN, before trusting a migrated pipeline.

Handling "10x Faster Than Spark" Claims

Treat every "10x faster than Spark" figure as a claim about a specific baseline, workload, metric, and configuration — and ask for all four before you believe it. The anatomy of such claims is consistent: the baseline may be open-source Spark or a vendor's tuned runtime; the workload may be a TPC-DS scale factor with a selected query subset; the metric may be runtime, cost, or price-performance; and the configuration may include or exclude AQE, caching, and native shuffle. Change any one and the multiple changes.

Published vendor figures illustrate the range. Databricks reported that Photon accelerated some customer workloads by over 10× and delivered average speedups of 3× over its previous runtime, with maximum speedups over 10×, in the Photon paper. Google Cloud states that its Lightning Engine, built on Apache Gluten and Velox, delivers up to 4.9× faster performance than open-source Apache Spark with zero code changes and up to 3.25× price-performance over "the leading high-speed Apache Spark alternative." Uber reported roughly 3.5× faster queries and 3.4× lower CPU cost across migrated workloads. Singdata publishes a vendor-reported benchmark claiming 6× faster than Spark on TPC-DS 10 TB, alongside a customer story describing 2–10× faster BI queries after a Spark migration with under 1% code change.

These are not comparable to one another: different engines, datasets, hardware, baselines, and dates. Each should be read within its stated scope, and none predicts your result. Before accepting any number, ask:

  • Which Spark version and configuration is the baseline, and was it tuned?

  • Which queries, scale factor, and data format were used, and were any excluded?

  • Is the metric runtime, cost, or price-performance — and at what instance pricing?

  • Was the run audited, or is it an internal benchmark?

  • What was the fallback rate, and how much of each query ran natively?

  • Will you reproduce it on our data, with our configuration, and share the raw results?

An Acceptance Checklist Before You Migrate

Use this as a sign-off document. Each item should have an owner, a measurement, and a pass/fail threshold agreed before the pilot starts.

  • Representative query set defined. Select queries covering your workload mix, weighted by production frequency, not by which ones benchmark well.

  • Fallback rate measured per query. For each query, record the share of operators executing natively and the conversion boundaries in the plan. A cluster-level average hides the queries that will not improve.

  • Correctness parity verified. Run row-level diffs against Spark on production-shaped data, with explicit checks for dates, timestamps, JSON, regex, NaN, and null handling.

  • Performance targets stated as median and p95. Fix scale factor, cluster shape, file format, caching, AQE, and dynamic allocation; report distributions, not best runs.

  • Cost model complete. Include compute, storage, egress, and any per-data-processed pricing; convert runtime gains into cost at your actual rates.

  • Operational fit confirmed. Scheduling, observability, governance, security, and off-heap memory behavior under production concurrency.

  • Rollback plan and coexistence period defined. Both engines running in parallel for a stated window, with a documented path back.

  • Pilot scope and exit criteria written down. A named set of pipelines, a duration, and the conditions under which you proceed, extend, or stop.

Who Should Choose Which

Choose by workload profile and fallback coverage, not by headline speedup. The strongest candidates for a vectorized engine are teams whose queries are predominantly CPU-bound analytical SQL — BI aggregations, joins over curated tables, decimal-heavy reporting — with high native coverage and a mature testing practice. They should expect the published gains to show up, subject to their own benchmark.

Expect smaller gains and higher risk in three cases. Shuffle-heavy ETL pipelines spend much of their time in exchange and write, which vectorization only partially addresses. ANSI-dependent, regex-heavy, or JSON-heavy pipelines hit documented fallback and semantic differences, so measure coverage before committing. Teams with heavy custom UDFs should assume those code paths stay on the JVM and budget accordingly.

I/O-bound workloads and small, short queries may see little benefit at all: the engine is not the bottleneck, and conversion overhead can erode what gain exists. For these, Spark remains the safer choice, and the effort is better spent on partitioning, file sizing, and table maintenance.

Where a vendor positions a product as a Spark replacement — Singdata describes its lakehouse that way and publishes a Spark replacement solution page — evaluate it against the same criteria as any other engine: fallback coverage, correctness parity, measured median and p95, and total cost. The positioning is a starting point for a pilot, not evidence of a result.

For your pilot, use the Spark modernization guidehttps://www.singdata.com/trending/spark-modernization-without-migration-huohua/ to establish a baseline and the TPC-DS benchmark and ROI guide to evaluate the business case.

Verdict

A vectorized lakehouse can be materially faster than Apache Spark on CPU-bound analytical SQL, and the published evidence — from Photon's 4× average on TPC-H to Uber's ~3.5× on migrated Gluten workloads — supports that within its stated scope. The size of the gain is workload-specific: it depends on how much of each query runs natively, how much time goes to shuffle and I/O, and whether your data and SQL hit documented compatibility edges.

Vendor headline numbers are starting points for validation, not conclusions. The next action is to take the acceptance checklist above, pick a representative set of pipelines, and measure fallback rate, correctness parity, median and p95 runtime, and total cost on your own data. That measurement — not any multiple in a blog post — is what should decide whether you migrate.

FAQ

Is a vectorized lakehouse always faster than Spark?

No. The gain concentrates on CPU-bound work — joins, aggregations, expression evaluation, decimal arithmetic. Queries that are I/O- or network-bound see little improvement, and the Photon paper states that expectation directly for its own engine (Photon paper).

What is the difference between vectorized execution and code generation?

Vectorized engines process data in columnar batches through operator-level dispatch, which amortizes per-row overhead and keeps per-operator metrics readable. Code generation fuses operators into specialized loops, which is fast but harder to observe. Photon's authors describe both trade-offs in the Photon paper; Spark's generated-code path and its costs are analyzed in the ICPE codegen study.

Does Gluten/Velox change query results?

It can. The Velox backend limitations doc for version 1.2.1 lists ANSI mode always falling back, RE2 versus java.util.regex differences, single-quote JSON handling, ignored Parquet datetime rebase settings, and no NaN support. Treat differential testing against Spark as a migration gate.

How large a benchmark do I need?

Large enough that shuffle and scheduling costs appear at realistic scale, and small enough to iterate. Fix the scale factor, cluster shape and file format; report median and p95 across iterations rather than a best case.

Can I migrate without rewriting Spark SQL?

Often yes, because these engines sit under Spark's planner and fall back for unsupported operators. The practical limit is your fallback rate per query, not per cluster — see the compatibility section above.

Related Articles