Array Expressions#
ArrayContains#
By default, ArrayContains is evaluated in the JVM using Spark’s own code-generated implementation (run inside the Comet pipeline), which matches Spark exactly. Set spark.comet.expression.ArrayContains.allowIncompatible=true to opt into Comet’s native implementation instead, which has the following differences from Spark:
Spark compares array elements with ordering.equiv, so -0.0 matches +0.0 and all NaNs match each other; Comet’s native array_contains compares the raw Arrow values bitwise
ArrayExcept#
By default, ArrayExcept is evaluated in the JVM using Spark’s own code-generated implementation (run inside the Comet pipeline), which matches Spark exactly. Set spark.comet.expression.ArrayExcept.allowIncompatible=true to opt into Comet’s native implementation instead, which has the following differences from Spark:
Null handling and ordering may differ from Spark
ArrayIntersect#
By default, ArrayIntersect is evaluated in the JVM using Spark’s own code-generated implementation (run inside the Comet pipeline), which matches Spark exactly. Set spark.comet.expression.ArrayIntersect.allowIncompatible=true to opt into Comet’s native implementation instead, which has the following differences from Spark:
Result array element order may differ from Spark when the right array is longer than the left (DataFusion probes the longer side).
array_intersect does not propagate non-UTF8_BINARY collations to the output array elements (https://github.com/apache/datafusion-comet/issues/2190)
ArrayJoin#
By default, ArrayJoin is evaluated in the JVM using Spark’s own code-generated implementation (run inside the Comet pipeline), which matches Spark exactly. Set spark.comet.expression.ArrayJoin.allowIncompatible=true to opt into Comet’s native implementation instead, which has the following differences from Spark:
array_join does not propagate non-UTF8_BINARY collations to the output string (https://github.com/apache/datafusion-comet/issues/2190)
array_join evaluates its delimiter and null replacement eagerly, while Spark short-circuits past them (https://github.com/apache/datafusion-comet/issues/3178)
ArraysZip#
The following cases are not supported by Comet and always fall back to Spark, regardless of any allowIncompatible setting:
Not all input data types are supported; falls back to Spark for unsupported types
Shuffle#
The following cases are not supported by Comet and always fall back to Spark, regardless of any allowIncompatible setting:
shuffle requires a resolved random seed
SortArray#
By default, SortArray is evaluated in the JVM using Spark’s own code-generated implementation (run inside the Comet pipeline), which matches Spark exactly. Set spark.comet.expression.SortArray.allowIncompatible=true to opt into Comet’s native implementation instead, which has the following differences from Spark:
When
spark.comet.exec.strictFloatingPoint=true, sorting on floating-point types is not 100% compatible with Spark