Repository navigation
Replies: 1 comment
|
@Ma77Ball Please add illustrative diagrams to make the ideas easier to understand. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Columnar (Apache Arrow) execution in Amber: the opt-in PR series and why
Status, updated 2026-11-21. This revives the thread with what actually shipped. The work lives on a reviewable, stacked PR series tracked by parent issue #9542, and the whole feature is off by default (
ApplicationConfig.enableColumnarWire), so the row path is unchanged until a user opts in. Update since 2026-11-19: columnar now runs end to end on a single node, and sources emit Arrow directly (not just operators).Why
Amber moves and processes data one row
Tupleat a time at every operator and across every edge. For exchange- and scan-heavy workflows that costs two things: serializing an object graph per batch on a cross-worker edge, and building a JVM object per row at every stage. Columnar (Apache Arrow) execution addresses both: Arrow batches serialize at near memory-copy speed, and a columnar-capable operator reads the columns directly instead of materializing a tuple per row. This is the same mechanism Spark/Photon, Velox, Gluten, and DataFusion Comet use.The key design choice: decide per edge, not globally
Columnar is not always a win. A same-JVM edge already passes data by reference, so wrapping it in Arrow bytes would only add overhead. So each edge picks its own format from two questions: can the receiver read columns, and is it local or remote. Remote and columnar-capable goes Arrow bytes (
VectorFrame); local and columnar-capable gets a live Arrow root by reference (LocalColumnarBatch, zero copy, no serialization); everything else stays rows. Locality selects the delivery mechanism, it does not disable columnar. This is what keeps the feature from regressing a workflow, lets it benefit a single node as well as a cluster, and is why it can eventually default on.Columnar sources (newest work)
The parts below made operators and edges columnar, but every source still emitted row
Tuples, so a scan-heavy columnar run still paid the per-row cost at the source. That gap is now closed: every source is columnar-capable. A generic default onSourceOperatorExecutorbatches any source's output into Arrow (so SQL, JSON, text, and the rest work), with native no-Tuplefast paths for the bulk scans: Arrow (zero copy), Parquet (decode columns straight into Arrow), CSV (parse straight into vectors). A columnar source caps each Arrow batch atcolumnarBatchRows(default 10000, override with-Dtexera.columnar.batch.rows), so a large Parquet row group or Arrow record batch streams in bounded chunks instead of materializing whole, which fixes an OOM on big single-row-group files. Enabler:Tuple.inMemSizeis now computed lazily, so the columnar path never pays thedeepSizeOfobject-graph walk that dominates the row path. This is on the feature branch and not yet split into the #9542 series.The reviewable parts (parent #9542)
ColumnarOperatorExecutor/ColumnarResultcontract, the opt-in Arrow wire (VectorFrame), a faster Arrow-to-tuple decode, and vectorized receive for filter and aggregate.processColumnarRootprimitive and handing a live Arrow root to a co-located receiver by reference (including the local multi-receiver shuffle, where each co-located worker gets its own gathered bucket by reference), with a checkpoint-safe serializer.Measured
Operator-level, a source plus a vectorized filter over 800k rows by 22 columns, isolated from actor messaging, the wire, and result storage, with a correctness parity gate (columnar and row return identical rows):
The dominant row-path cost is confirmed to be
Tuple.inMemSize's per-tupledeepSizeOfwalk, which the columnar path skips; for CSV the text parse itself is only about 3s.Earlier single-JVM serialization simulation, median of 9 trials, across a matrix of workflow shapes with the same parity gate:
Live end to end on a single node (ParquetScan to a selective Filter, 800k rows): row about 35s vs columnar about 8s (about 4.5x; actor, wire, and storage overhead is paid by both paths). A real multi-node cluster benchmark is the remaining measurement gap and is tracked as follow-up.
Supersedes
This replaces the earlier four-PR outline in this thread; the old sub-issues (#8558 through #8561) are closed. Feedback on the split, the per-edge planner, or the measurement method is welcome here.
All reactions