Commit c2c8ba0
feat: add experimental native columnar to row conversion
This PR adds an experimental native (Rust-based) implementation of
ColumnarToRowExec that converts Arrow columnar data to Spark UnsafeRow
format.
Benefits over the current Scala implementation:
- Zero-copy for variable-length types: String and Binary data is written
directly to the output buffer without intermediate Java object allocation
- Vectorized processing: The native implementation processes data in a
columnar fashion, improving CPU cache utilization
- Reduced GC pressure: All conversion happens in native memory, avoiding
the creation of temporary Java objects that would need garbage collection
- Buffer reuse: The output buffer is allocated once and reused across
batches, minimizing memory allocation overhead
The feature is disabled by default and can be enabled by setting:
spark.comet.exec.columnarToRow.native.enabled=true
Supported data types:
- Primitive types: Boolean, Byte, Short, Int, Long, Float, Double
- Date and Timestamp (microseconds)
- Decimal (both inline precision<=18 and variable-length precision>18)
- String and Binary
- Complex types: Struct, Array, Map (nested)
This is an experimental feature for evaluation and benchmarking purposes.
Co-Authored-By: Claude Opus 4.5 <[email protected]>1 parent 68f127b commit c2c8ba0
File tree
11 files changed
+1265
-4
lines changed- common/src/main/scala/org/apache/comet
- vector
- native/core/src/execution
- spark/src/main
- java/org/apache/comet
- scala/org/apache
- comet
- rules
- spark/sql/comet
11 files changed
+1265
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
289 | 300 | | |
290 | 301 | | |
291 | 302 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
| |||
0 commit comments