Spark Operator Support#
This page is the complete reference for how Apache Comet handles each Spark physical operator. Comet replaces supported operators with native equivalents. Comet runs whole subtrees of native operators together, so if a query stage contains an operator Comet does not support, that stage falls back to regular Spark execution. Results are unaffected.
Operators marked β
Supported are enabled by default. Each can be turned off individually with
spark.comet.exec.OPERATOR.enabled=false (for example spark.comet.exec.sort.enabled=false), and
all native execution can be turned off with spark.comet.exec.enabled=false. See the
Comet Configuration Guide for the full list.
Status legend#
Status |
Meaning |
|---|---|
β Supported |
Native implementation, enabled by default; works in the common case. Some inputs or forms may fall back to Spark. |
β οΈ Supported (caveats) |
Experimental or disabled by default, or accelerates only a limited subset. See the Compatibility Guide. |
π Planned |
Intended; tracked by an open issue or pull request. |
Wrapper nodes#
Some nodes in a Spark plan do no work of their own: AdaptiveSparkPlan, the AQE query stages
(ShuffleQueryStage, BroadcastQueryStage, TableCacheQueryStage on Spark 3.5 and later, and
ResultQueryStage on Spark 4.0 and later), AQEShuffleRead, InputAdapter, WholeStageCodegen,
and the reuse markers ReusedExchange and ReusedSubquery. Comet leaves them in place around the
operators it converts, so this page does not list them, and seeing one in a plan does not mean
that part of the query fell back to Spark. The coverage summary described in
Understanding Comet Plans does not count them.
Not currently planned#
The following operator families fall back to Spark and are not on the current roadmap. They are omitted from the tables below and may be reconsidered based on demand:
Structured Streaming operators (
StateStoreSaveExec,StateStoreRestoreExec,StreamingSymmetricHashJoinExec, and similar): Comet targets batch execution.Cartesian / cross joins (
CartesianProductExec): rare and expensive, with little acceleration benefit.Pickled (non-Arrow) Python UDFs (
BatchEvalPythonExec): Comet accelerates Arrow-based Python UDFs only (#4234).Typed Dataset operators (
DeserializeToObjectExec,SerializeFromObjectExec,MapElementsExec,MapPartitionsExec,MapGroupsExec,CoGroupExec,AppendColumnsExec, and similar): produced bymap,mapPartitions,groupByKey,cogroup, and other typedDatasettransformations. They exist to run user JVM functions on JVM objects, which Comet cannot do natively. The operators above them can still run natively: setspark.comet.convert.typedDataset.enabled=trueand Comet converts the output of a typed operation to Arrow. This is disabled by default because it can be slower than Spark when the operators above do little work, such as an aggregate over a few groups, which Spark compiles together with the typed operation into one loop.
Scans#
Operator |
Status |
Notes |
|---|---|---|
|
β |
Parquet only. Some types and configurations fall back. See Parquet Scan Compatibility. |
|
β |
Apache Iceberg Parquet scans run natively. Native CSV scans are experimental and disabled by default. DataSource V2 Parquet scans are not accelerated. See Parquet Scan Compatibility and the Iceberg Guide. |
|
β οΈ |
Disabled by default; there is no acceleration advantage and this operator is typically only used in test code. Can be opted into via config (#4393). |
|
β |
Spark 4.0 and later. See Empty Relations for native-input support, including native Parquet writes. |
|
β οΈ |
Disabled by default. Set |
|
β οΈ |
Experimental, disabled by default. Set |
Projection and filtering#
Operator |
Status |
Notes |
|---|---|---|
|
β |
|
|
β |
|
|
β οΈ |
Sampling without replacement only. See Operator Compatibility. |
Sorting and limiting#
Operator |
Status |
Notes |
|---|---|---|
|
β |
|
|
β |
|
|
β |
|
|
β |
|
|
β |
Aggregation#
Operator |
Status |
Notes |
|---|---|---|
|
β |
|
|
β |
Runs the object-buffer aggregates Comet supports, such as |
|
β |
Runs when Comet supports every aggregate in it, including the object-buffer aggregates listed for |
Joins#
Operator |
Status |
Notes |
|---|---|---|
|
β |
|
|
β |
|
|
β |
Supports |
|
β |
Falls back to Spark when the preserved side is broadcast (for example LEFT OUTER with BROADCAST on the left) (#4429). |
ExistenceJoin (produced when EXISTS / IN is combined with another predicate via OR) runs
natively on BroadcastHashJoinExec and ShuffledHashJoinExec. Existence sort-merge joins, residual
(non-equi) join conditions, computed (non-column) join keys, and NOT IN fall back to Spark.
Exchanges#
Operator |
Status |
Notes |
|---|---|---|
|
β |
|
|
β |
Window#
Operator |
Status |
Notes |
|---|---|---|
|
β οΈ |
Runs natively and is enabled by default. A broad set of window functions is accelerated; unsupported shapes fall back to Spark. See window function compatibility. |
|
β |
Spark 3.5 and later. Streaming per-partition top-K pushdown for |
Generators and set operations#
Operator |
Status |
Notes |
|---|---|---|
|
β |
Supports |
|
β |
|
|
β |
|
|
β |
Writes#
Operator |
Status |
Notes |
|---|---|---|
|
β οΈ |
Spark 4.0+. Experimental native Parquet writes, disabled by default (opt-in). Non-partitioned, non-bucketed writes only, and not when |
|
β οΈ |
Spark 3.4/3.5 only. Experimental native Parquet writes, disabled by default (opt-in). Replaced by |
Iceberg writes: |
β οΈ |
Experimental, disabled by default. |
|
β οΈ |
Spark 3.5+. Experimental, disabled by default ( |
Python and UDF#
Operator |
Status |
Notes |
|---|---|---|
|
β οΈ |
Spark 4.0 and later. Experimental, disabled by default ( |
|
π |
Scalar |
See also#
Comet Compatibility Guide - known incompatibilities and edge cases.
Supported Spark Expressions - the equivalent reference for expressions.