Spark Expression Support#

This page is the complete reference for how Apache Comet handles each Spark built-in expression. Comet accelerates expressions either with a native (Rust) implementation or by dispatching to a Spark-compatible codegen path. When an expression is not supported, Comet transparently falls back to Spark for that part of the plan; results are unaffected.

Expressions marked βœ… Supported are enabled by default and produce Spark-compatible results.

Some βœ… Supported expressions have specific incompatible cases that are not run by default. Those cases must be opted into per expression with spark.comet.expression.EXPRNAME.allowIncompatible=true (where EXPRNAME is the Spark expression class name, for example Cast). There is no global opt-in. By default such a case either falls back to Spark (for example cast) or, when the expression has a Spark-compatible codegen-dispatch implementation, runs through that instead (for example the regex and JSON families). See Native and codegen-dispatch implementations for how Comet chooses.

Most expressions can also be disabled with spark.comet.expression.EXPRNAME.enabled=false, where EXPRNAME is the Spark expression class name (for example Length or StartsWith). See the Comet Configuration Guide for the full list.

Status legend#

Status

Meaning

βœ… Supported

Comet produces Spark-compatible results by default. Some inputs or forms may fall back to Spark, and any incompatible behavior is opt-in (off by default).

πŸ”œ Planned

Intended; tracked by an open issue or pull request.

Implementation legend#

The Implementation column records how Comet executes each expression when it is not falling back to Spark:

Implementation

Meaning

Native

Comet’s Rust engine evaluates the expression end to end.

Codegen dispatch

Spark’s own generated JVM code is evaluated inside the Comet pipeline. Used when a byte-exact match to Spark matters more than the native speedup, or when no native path exists.

Hybrid

Both paths exist. Comet picks between them based on input, and the user can override with spark.comet.expression.EXPRNAME.allowIncompatible=true β€” see Native and codegen-dispatch implementations.

β€”

No direct wire-up: the row is either planned, is rewritten to another expression before Comet sees it (for example to_date β†’ Cast), or is handled at the operator level rather than the expression level (for example explode, window functions).

The Implementation column is auto-generated from the serde definitions in QueryPlanSerde; do not edit it by hand.

Not currently planned#

Comet focuses acceleration on mainstream relational, string, datetime, math, and collection expressions. The following function families are not currently planned for native acceleration (they are not on the 1.0 roadmap): specialized functionality with narrow real-world analytics use and high implementation cost. They fall back to Spark and may be reconsidered based on demand:

  • Probabilistic sketches and approximate top-k (kll_sketch_*, hll_*, theta_*, count_min_sketch, bitmap_*, approx_top_k*): specialized data structures with exact-correctness traps.

  • Geospatial (st_*): brand-new Spark 4.1 functionality, specialized.

  • Avro / Protobuf codecs (from_avro, to_avro, from_protobuf, to_protobuf, schema_of_avro): format conversion belongs at the IO layer, not expression evaluation.

  • JVM reflection (java_method, reflect): niche, and they invoke arbitrary JVM methods (a security concern).

  • UTF-8 validation (is_valid_utf8, make_valid_utf8, validate_utf8, try_validate_utf8): niche Spark 4.x string-validation helpers.

  • Miscellaneous niche (histogram_numeric, version, sentences, quote): low-value or specialized functions with little benefit from native acceleration.

The file-metadata functions input_file_name, input_file_block_start, and input_file_block_length depend on scan-internal per-row file information rather than the expression layer; their support status is covered in the scan compatibility guide.

Note that median and mode are planned: they are mainstream exact aggregates. approx_count_distinct is supported because Comet ports Spark’s HyperLogLogPlusPlus exactly, so its result is bit-identical to Spark.

The tables below list every Spark built-in expression with its current status.

agg_funcs#

Function

Status

Implementation

Notes

any

βœ…

β€”

any_value

βœ…

β€”

approx_count_distinct

βœ…

Native

approx_percentile

βœ…

Native

Byte, short, int, long, float, and double input; other input types fall back to Spark

array_agg

βœ…

Native

Alias for collect_list

avg

βœ…

Native

Interval types fall back

bit_and

βœ…

Native

bit_or

βœ…

Native

bit_xor

βœ…

Native

bool_and

βœ…

β€”

bool_or

βœ…

β€”

collect_list

βœ…

Native

collect_set

βœ…

Native

corr

βœ…

Native

count

βœ…

Native

count_if

βœ…

β€”

covar_pop

βœ…

Native

covar_samp

βœ…

Native

every

βœ…

β€”

first

βœ…

Native

first_value

βœ…

Native

grouping

βœ…

β€”

Grouping indicator for ROLLUP/CUBE/GROUPING SETS

grouping_id

βœ…

β€”

Grouping indicator for ROLLUP/CUBE/GROUPING SETS

kurtosis

πŸ”œ

β€”

Not yet implemented natively

last

βœ…

Native

last_value

βœ…

Native

listagg

πŸ”œ

β€”

String aggregation

max

βœ…

Native

max_by

πŸ”œ

β€”

#3841

mean

βœ…

Native

median

βœ…

β€”

Rewrites to percentile(col, 0.5) and runs natively for supported percentile inputs

min

βœ…

Native

min_by

πŸ”œ

β€”

#3841

mode

πŸ”œ

β€”

#3970

percentile

βœ…

Native

Single literal percentage on numeric input runs natively; array of percentages and a frequency argument fall back to Spark

percentile_cont

βœ…

β€”

Spark 4.0+ WITHIN GROUP (ORDER BY ...); ascending only runs natively, DESC falls back to Spark

percentile_disc

πŸ”œ

β€”

Percentile aggregate

regr_avgx

βœ…

β€”

Native: Spark rewrites to Average (tests in #4551)

regr_avgy

βœ…

β€”

Native: Spark rewrites to Average (tests in #4551)

regr_count

βœ…

β€”

Native: Spark rewrites to Count (tests in #4551)

regr_intercept

πŸ”œ

β€”

Falls back; can reuse covar_pop/var_pop accumulators (#4552)

regr_r2

πŸ”œ

β€”

Falls back; can reuse the corr accumulator (#4552)

regr_slope

πŸ”œ

β€”

Falls back; can reuse covar_pop/var_pop accumulators (#4552)

regr_sxx

πŸ”œ

β€”

Falls back; can reuse var_pop accumulator (#4552)

regr_sxy

πŸ”œ

β€”

Falls back; can reuse covar_pop accumulator (#4552)

regr_syy

πŸ”œ

β€”

Falls back; can reuse var_pop accumulator (#4552)

skewness

πŸ”œ

β€”

Not yet implemented natively

some

βœ…

β€”

std

βœ…

Native

stddev

βœ…

Native

stddev_pop

βœ…

Native

stddev_samp

βœ…

Native

string_agg

πŸ”œ

β€”

String aggregation (alias of listagg)

sum

βœ…

Native

try_avg

βœ…

β€”

Interval types fall back

try_sum

βœ…

β€”

var_pop

βœ…

Native

var_samp

βœ…

Native

variance

βœ…

Native


array_funcs#

Function

Status

Implementation

Notes

array

βœ…

Native

array_append

βœ…

Native

array_compact

βœ…

β€”

array_contains

βœ…

Native

NaN/signed-zero handling may differ (details)

array_distinct

βœ…

Native

NaN/signed-zero handling may differ (details)

array_except

βœ…

Hybrid

Routes through the JVM codegen dispatcher by default; the incompatible native path is opt-in via allowIncompatible (details)

array_insert

βœ…

Native

array_intersect

βœ…

Hybrid

Routes through the JVM codegen dispatcher by default; the incompatible native path is opt-in via allowIncompatible (details)

array_join

βœ…

Hybrid

Routes through the JVM codegen dispatcher by default; the incompatible native path is opt-in via allowIncompatible (details)

array_max

βœ…

Native

NaN ordering may differ (details)

array_min

βœ…

Native

NaN ordering may differ (details)

array_position

βœ…

Native

Binary/struct/map/null elements fall back

array_prepend

βœ…

β€”

array_remove

βœ…

Native

array_repeat

βœ…

Native

array_union

βœ…

Native

NaN/signed-zero handling may differ (details)

arrays_overlap

βœ…

Native

arrays_zip

βœ…

Native

element_at

βœ…

Native

flatten

βœ…

Native

Binary/struct/map elements fall back

get

βœ…

β€”

sequence

βœ…

Codegen dispatch

shuffle

βœ…

Native

Binary/struct/map elements fall back

slice

βœ…

Native

Native (#4149)

sort_array

βœ…

Hybrid

Nested struct/null arrays fall back


bitwise_funcs#

Function

Status

Implementation

Notes

&

βœ…

Native

<<

βœ…

Native

>>

βœ…

Native

>>>

βœ…

Native

Operator alias for shiftrightunsigned (Spark 4.0+)

^

βœ…

Native

bit_count

βœ…

Native

bit_get

βœ…

Native

getbit

βœ…

Native

shiftright

βœ…

Native

shiftrightunsigned

βœ…

Native

|

βœ…

Native

~

βœ…

Native


collection_funcs#

Function

Status

Implementation

Notes

array_size

βœ…

β€”

cardinality

βœ…

Native

concat

βœ…

Hybrid

Binary/array children fall back

reverse

βœ…

Hybrid

Binary-element arrays fall back (Incompatible) (details)

size

βœ…

Native


conditional_funcs#

Function

Status

Implementation

Notes

coalesce

βœ…

Native

if

βœ…

Native

ifnull

βœ…

β€”

nanvl

βœ…

Codegen dispatch

nullif

βœ…

β€”

nullifzero

βœ…

β€”

Lowers to if/= (Spark 4.0+)

nvl

βœ…

β€”

nvl2

βœ…

β€”

when

βœ…

Native

zeroifnull

βœ…

β€”

Lowers to coalesce (Spark 4.0+)


conversion_funcs#

The type-name conversion functions (bigint, binary, boolean, date, decimal, double, float, int, smallint, string, timestamp, tinyint) are SQL aliases for CAST(... AS <type>) and share the support and caveats of cast.

Function

Status

Implementation

Notes

cast

βœ…

Hybrid

Some casts fall back; float-to-decimal is opt-in (details)


csv_funcs#

Function

Status

Implementation

Notes

from_csv

βœ…

Codegen dispatch

schema_of_csv

βœ…

Codegen dispatch

to_csv

βœ…

Native


datetime_funcs#

Function

Status

Implementation

Notes

add_months

βœ…

Codegen dispatch

convert_timezone

βœ…

Hybrid

Routes through the JVM codegen dispatcher by default (handles all timezone forms); the native path is opt-in via allowIncompatible (details)

curdate

βœ…

β€”

Constant-folded to a literal (alias of current_date)

current_date

βœ…

β€”

Constant-folded to a literal before Comet sees the plan

current_time

πŸ”œ

β€”

Blocked on Spark 4.1 TIME type support (#4288)

current_timestamp

βœ…

β€”

Constant-folded to a literal before Comet sees the plan

current_timezone

βœ…

β€”

date_add

βœ…

Native

date_diff

βœ…

Native

date_format

βœ…

Hybrid

date_from_unix_date

βœ…

Native

date_part

βœ…

β€”

date_sub

βœ…

Native

date_trunc

βœ…

Hybrid

dateadd

βœ…

Native

datediff

βœ…

Native

datepart

βœ…

β€”

day

βœ…

Native

dayname

βœ…

β€”

Abbreviated day name (Spark 4.0+)

dayofmonth

βœ…

Native

dayofweek

βœ…

Native

dayofyear

βœ…

Native

extract

βœ…

β€”

from_unixtime

βœ…

Hybrid

from_utc_timestamp

βœ…

Hybrid

Routes through the JVM codegen dispatcher by default (handles all timezone forms); the native path is opt-in via allowIncompatible (details)

hour

βœ…

β€”

last_day

βœ…

Native

localtimestamp

βœ…

β€”

make_date

βœ…

Native

make_dt_interval

βœ…

Codegen dispatch

make_interval

πŸ”œ

β€”

Produces legacy CalendarInterval; tracked by #5061

make_time

πŸ”œ

β€”

Spark 4.1 TIME type; tracked by #4288

make_timestamp

βœ…

β€”

make_timestamp_ltz

βœ…

β€”

2-arg TIME form falls back

make_timestamp_ntz

βœ…

β€”

2-arg TIME form falls back

make_ym_interval

βœ…

Codegen dispatch

minute

βœ…

β€”

month

βœ…

Native

monthname

βœ…

β€”

Abbreviated month name (Spark 4.0+)

months_between

βœ…

Codegen dispatch

next_day

βœ…

Native

now

βœ…

β€”

Constant-folded to a literal (alias of current_timestamp)

quarter

βœ…

Native

second

βœ…

β€”

session_window

πŸ”œ

β€”

Batch session-window grouping falls back (UpdatingSessionsExec is not yet native); tracked by #4785

time_diff

πŸ”œ

β€”

Spark 4.1 TIME type; tracked by #4288

time_trunc

πŸ”œ

β€”

Spark 4.1 TIME type; tracked by #4288

timestamp_micros

βœ…

Codegen dispatch

timestamp_millis

βœ…

Codegen dispatch

timestamp_seconds

βœ…

Native

to_date

βœ…

β€”

Rewrites to Cast (or Cast(GetTimestamp) with a format) before Comet sees the plan

to_time

πŸ”œ

β€”

Spark 4.1 TIME type; tracked by #4288

to_timestamp

βœ…

β€”

Rewrites to Cast (or GetTimestamp with a format) before Comet sees the plan

to_timestamp_ltz

βœ…

β€”

Rewrites to to_timestamp (TimestampType)

to_timestamp_ntz

βœ…

β€”

Rewrites to to_timestamp (TimestampNTZType)

to_unix_timestamp

βœ…

Hybrid

to_utc_timestamp

βœ…

Hybrid

Routes through the JVM codegen dispatcher by default (handles all timezone forms); the native path is opt-in via allowIncompatible (details)

trunc

βœ…

Hybrid

try_make_interval

πŸ”œ

β€”

Produces legacy CalendarInterval; tracked by #5061

try_make_timestamp

βœ…

β€”

try_to_date

βœ…

β€”

Rewrites to Cast/GetTimestamp before Comet sees the plan; same support as to_date

try_to_time

πŸ”œ

β€”

Spark 4.1 TIME type; tracked by #4288

try_to_timestamp

βœ…

β€”

Rewrites to Cast/GetTimestamp before Comet sees the plan; same support as to_timestamp

unix_date

βœ…

Native

unix_micros

βœ…

Codegen dispatch

unix_millis

βœ…

Codegen dispatch

unix_seconds

βœ…

Codegen dispatch

unix_timestamp

βœ…

Native

weekday

βœ…

Native

weekofyear

βœ…

Native

window

βœ…

β€”

Batch tumbling and sliding time-window grouping runs natively

window_time

βœ…

β€”

Batch time-window grouping runs natively

year

βœ…

Native


generator_funcs#

explode, explode_outer, posexplode, and posexplode_outer are supported via CometExplodeExec (operator-level, not expression-level). Enabled by default via spark.comet.exec.explode.enabled.

Function

Status

Implementation

Notes

explode

βœ…

β€”

via CometExplodeExec

explode_outer

βœ…

β€”

via CometExplodeExec (audit)

inline

πŸ”œ

β€”

Operator-level generator (like explode)

inline_outer

πŸ”œ

β€”

Operator-level generator (like explode)

posexplode

βœ…

β€”

via CometExplodeExec

posexplode_outer

βœ…

β€”

via CometExplodeExec (audit)

stack

πŸ”œ

β€”

Operator-level generator


hash_funcs#

Function

Status

Implementation

Notes

crc32

βœ…

Native

hash

βœ…

Native

md5

βœ…

Native

sha

βœ…

Native

sha1

βœ…

Native

sha2

βœ…

Native

xxhash64

βœ…

Native


json_funcs#

Function

Status

Implementation

Notes

from_json

βœ…

Hybrid

Falls back by default; opt-in via allowIncompatible (audit)

get_json_object

βœ…

Hybrid

Some inputs need allowIncompatible (audit)

json_array_length

βœ…

Hybrid

Single-quoted/trailing JSON needs allowIncompatible (audit)

json_object_keys

βœ…

Codegen dispatch

json_tuple

πŸ”œ

β€”

#3160

schema_of_json

βœ…

Codegen dispatch

to_json

βœ…

Hybrid

Options and map/array inputs fall back (audit)


lambda_funcs#

Function

Status

Implementation

Notes

aggregate

βœ…

Codegen dispatch

array_sort

βœ…

Codegen dispatch

exists

βœ…

Codegen dispatch

filter

βœ…

Native

General lambda routed through the JVM codegen dispatcher; the array_compact form runs natively

forall

βœ…

Codegen dispatch

map_filter

βœ…

Codegen dispatch

map_zip_with

βœ…

Codegen dispatch

reduce

βœ…

Codegen dispatch

transform

βœ…

Codegen dispatch

transform_keys

βœ…

Codegen dispatch

transform_values

βœ…

Codegen dispatch

zip_with

βœ…

Codegen dispatch


map_funcs#

Function

Status

Implementation

Notes

element_at

βœ…

Native

map

βœ…

Codegen dispatch

Routed through the JVM codegen dispatcher

map_concat

βœ…

Codegen dispatch

map_contains_key

βœ…

β€”

map_entries

βœ…

Native

map_from_arrays

βœ…

Native

map_from_entries

βœ…

Hybrid

BinaryType key/value falls back (Incompatible) (details)

map_keys

βœ…

Native

map_values

βœ…

Native

str_to_map

βœ…

Hybrid

try_element_at

βœ…

β€”

Lowers to element_at


math_funcs#

Function

Status

Implementation

Notes

%

βœ…

Native

*

βœ…

Native

Interval multiplication falls back

+

βœ…

Native

-

βœ…

Native

/

βœ…

Native

abs

βœ…

Native

Interval types fall back

acos

βœ…

Native

acosh

βœ…

Native

asin

βœ…

Native

asinh

βœ…

Native

atan

βœ…

Native

atan2

βœ…

Native

atanh

βœ…

Native

bin

βœ…

Native

bround

βœ…

Codegen dispatch

cbrt

βœ…

Native

ceil

βœ…

β€”

Two-arg form falls back

ceiling

βœ…

β€”

conv

βœ…

Codegen dispatch

cos

βœ…

Native

cosh

βœ…

Native

cot

βœ…

Native

csc

βœ…

Native

degrees

βœ…

Native

div

βœ…

Native

e

βœ…

β€”

Folds to a literal (like pi)

exp

βœ…

Native

expm1

βœ…

Native

factorial

βœ…

Native

floor

βœ…

β€”

Two-arg form falls back

greatest

βœ…

Native

hex

βœ…

Native

hypot

βœ…

Codegen dispatch

least

βœ…

Native

ln

βœ…

Native

log

βœ…

Native

log10

βœ…

Native

log1p

βœ…

Codegen dispatch

log2

βœ…

Native

mod

βœ…

Native

negative

βœ…

Native

pi

βœ…

Native

pmod

βœ…

Codegen dispatch

positive

βœ…

Codegen dispatch

pow

βœ…

Native

power

βœ…

Native

radians

βœ…

Native

rand

βœ…

Native

randn

βœ…

Native

random

βœ…

Native

Alias for rand (Spark 4.0+); seed must be a literal

randstr

βœ…

Native

Random string (Spark 4.0+); length and seed must be literals

rint

βœ…

Native

round

βœ…

Native

Float/double inputs fall back

sec

βœ…

Native

shiftleft

βœ…

Native

sign

βœ…

Native

signum

βœ…

Native

sin

βœ…

Native

sinh

βœ…

Native

sqrt

βœ…

Native

tan

βœ…

Native

tanh

βœ…

Native

try_add

βœ…

β€”

Datetime/interval form falls back

try_divide

βœ…

β€”

try_mod

βœ…

β€”

try_multiply

βœ…

β€”

try_subtract

βœ…

β€”

unhex

βœ…

Native

uniform

βœ…

β€”

Constant-folded; literal arguments only (Spark 4.0+)

width_bucket

βœ…

Codegen dispatch


misc_funcs#

Function

Status

Implementation

Notes

aes_decrypt

βœ…

β€”

Routed through the JVM codegen dispatcher

aes_encrypt

βœ…

β€”

Routed through the JVM codegen dispatcher; nondeterministic IV by default

assert_true

πŸ”œ

β€”

Lowers to RaiseError, which falls back

current_catalog

βœ…

β€”

Resolved to a literal by the analyzer (ReplaceCurrentLike)

current_database

βœ…

β€”

Resolved to a literal by the analyzer (ReplaceCurrentLike)

current_schema

βœ…

β€”

Alias of current_database; resolved to a literal by the analyzer

current_user

βœ…

β€”

Resolved to a literal by the analyzer; same as user

equal_null

βœ…

β€”

Lowers to <=> (EqualNullSafe)

is_variant_null

πŸ”œ

β€”

Requires VariantType support

monotonically_increasing_id

βœ…

Native

parse_json

πŸ”œ

β€”

Requires VariantType support

raise_error

πŸ”œ

β€”

Raises a runtime error

rand

βœ…

Native

Seed must be a literal

randn

βœ…

Native

Seed must be a literal

schema_of_variant

πŸ”œ

β€”

Requires VariantType support

schema_of_variant_agg

πŸ”œ

β€”

Requires VariantType support

session_user

βœ…

β€”

Alias of current_user; resolved to a literal by the analyzer

spark_partition_id

βœ…

Native

to_variant_object

πŸ”œ

β€”

Requires VariantType support

try_aes_decrypt

βœ…

β€”

Routed through the JVM codegen dispatcher

try_parse_json

πŸ”œ

β€”

Requires VariantType support

try_variant_get

πŸ”œ

β€”

Requires VariantType support

typeof

βœ…

β€”

Foldable; resolved to a literal before Comet sees the plan

user

βœ…

β€”

Resolved to a literal by the Spark analyzer before reaching Comet

uuid

βœ…

Native

variant_get

πŸ”œ

β€”

Requires VariantType support


predicate_funcs#

Function

Status

Implementation

Notes

!

βœ…

Native

<

βœ…

Hybrid

<=

βœ…

Hybrid

<=>

βœ…

Hybrid

=

βœ…

Hybrid

==

βœ…

Hybrid

>

βœ…

Hybrid

>=

βœ…

Hybrid

and

βœ…

Native

between

βœ…

β€”

ilike

βœ…

β€”

in

βœ…

Hybrid

isnan

βœ…

Native

isnotnull

βœ…

Native

isnull

βœ…

Native

like

βœ…

Hybrid

not

βœ…

Native

or

βœ…

Native

regexp

βœ…

Hybrid

Falls back by default; opt-in via allowIncompatible (details)

regexp_like

βœ…

Hybrid

Falls back by default; opt-in via allowIncompatible (details)

rlike

βœ…

Hybrid

Falls back by default; opt-in via allowIncompatible (details)


string_funcs#

Function

Status

Implementation

Notes

ascii

βœ…

Native

base64

βœ…

Native

bit_length

βœ…

Native

btrim

βœ…

β€”

char

βœ…

Native

char_length

βœ…

Native

character_length

βœ…

Native

chr

βœ…

Native

collate

πŸ”œ

β€”

Spark collation (umbrella #2190)

collation

βœ…

β€”

Constant-folded to a literal (Spark 4.0+)

concat_ws

βœ…

Native

contains

βœ…

β€”

decode

βœ…

β€”

elt

βœ…

Codegen dispatch

encode

πŸ”œ

β€”

Lowers to StaticInvoke(encode) (not allowlisted); falls back

endswith

βœ…

β€”

find_in_set

βœ…

Codegen dispatch

format_number

βœ…

Codegen dispatch

format_string

βœ…

Codegen dispatch

initcap

βœ…

Hybrid

instr

βœ…

Native

lcase

βœ…

Hybrid

left

βœ…

Native

len

βœ…

Native

length

βœ…

Native

levenshtein

βœ…

Native

locate

βœ…

Codegen dispatch

lower

βœ…

Hybrid

lpad

βœ…

β€”

ltrim

βœ…

Native

luhn_check

βœ…

β€”

Native via StaticInvoke (tests: luhn_check.sql)

mask

βœ…

β€”

Routed through the JVM codegen dispatcher

octet_length

βœ…

Native

overlay

βœ…

Codegen dispatch

position

βœ…

Codegen dispatch

printf

βœ…

Codegen dispatch

regexp_count

βœ…

β€”

Runs natively (rewrites to size(regexp_extract_all(...)))

regexp_extract

βœ…

Native

regexp_extract_all

βœ…

Native

regexp_instr

βœ…

Codegen dispatch

Routed through the JVM codegen dispatcher

regexp_replace

βœ…

Hybrid

regexp_substr

βœ…

β€”

Runs natively (rewrites to nullif(regexp_extract(...), ''))

repeat

βœ…

Native

replace

βœ…

Hybrid

right

βœ…

Native

rpad

βœ…

β€”

rtrim

βœ…

Native

soundex

βœ…

Native

space

βœ…

Native

split

βœ…

Hybrid

split_part

βœ…

β€”

Spark 4.0+

startswith

βœ…

β€”

substr

βœ…

Native

substring

βœ…

Native

substring_index

βœ…

Native

to_binary

βœ…

β€”

Hex form accelerated; other formats fall back

to_char

βœ…

β€”

to_number

βœ…

Codegen dispatch

to_varchar

βœ…

β€”

translate

βœ…

Native

DataFusion’s translate iterates over Unicode graphemes (Spark uses code points) and substitutes U+0000 instead of treating it as a deletion sentinel, so the native path is opt-in via allowIncompatible

trim

βœ…

Native

try_to_binary

βœ…

β€”

Runs natively (rewrites to try_eval(to_binary(...)))

try_to_number

βœ…

Codegen dispatch

Routed through the JVM codegen dispatcher

ucase

βœ…

Hybrid

unbase64

βœ…

Codegen dispatch

upper

βœ…

Hybrid


struct_funcs#

Function

Status

Implementation

Notes

named_struct

βœ…

Native

Duplicate field names fall back

struct

βœ…

Native


url_funcs#

Function

Status

Implementation

Notes

parse_url

βœ…

Native

try_url_decode

βœ…

β€”

url_decode

βœ…

β€”

url_encode

βœ…

β€”


window_funcs#

Window functions run via CometWindowExec, which is enabled by default. Aggregate window functions (count, min, max, sum, avg, first_value, last_value), ranking functions (row_number, rank, dense_rank, percent_rank, cume_dist, ntile), and value-shift functions (lag, lead, nth_value) are all wired in the window serde and execute natively. Statistical aggregates such as stddev, var_pop, corr, and covar_pop run natively as plain aggregations but fall back to Spark when used as window functions. A handful of frame shapes also fall back. See window function compatibility for the full list of supported functions, frames, and fallback cases.

Function

Status

Implementation

Notes

cume_dist

βœ…

β€”

via CometWindowExec

dense_rank

βœ…

β€”

via CometWindowExec

lag

βœ…

β€”

via CometWindowExec; non-literal default falls back (#4268)

lead

βœ…

β€”

via CometWindowExec; non-literal default falls back (#4268)

nth_value

βœ…

β€”

via CometWindowExec

ntile

βœ…

β€”

via CometWindowExec

percent_rank

βœ…

β€”

via CometWindowExec

rank

βœ…

β€”

via CometWindowExec

row_number

βœ…

β€”

via CometWindowExec


xml_funcs#

Function

Status

Implementation

Notes

from_xml

βœ…

β€”

Spark 4.0+

schema_of_xml

βœ…

β€”

Spark 4.0+

to_xml

βœ…

β€”

Spark 4.0+

xpath

βœ…

Codegen dispatch

xpath_boolean

βœ…

Codegen dispatch

xpath_double

βœ…

Codegen dispatch

xpath_float

βœ…

Codegen dispatch

xpath_int

βœ…

Codegen dispatch

xpath_long

βœ…

Codegen dispatch

xpath_number

βœ…

Codegen dispatch

Alias of xpath_double

xpath_short

βœ…

Codegen dispatch

xpath_string

βœ…

Codegen dispatch


Beyond SQL functions#

Comet also accelerates a number of Catalyst expressions that have no Spark SQL function name and therefore do not appear in the tables above. These arise from the DataFrame API, from SQL syntax other than function calls, or from the query optimizer. They include:

  • Operator and optimizer-injected expressions: runtime bloom-filter join probes (BloomFilterMightContain, BloomFilterAggregate), optimized IN sets (InSet), scalar subqueries (ScalarSubquery), and floating-point normalization (KnownFloatingPointNormalized).

  • Accessor expressions (subscript and field access, not functions): struct field access (col.field), array element access (arr[i]), and map value access (map[key]).

  • Internal decimal arithmetic: CheckOverflow, MakeDecimal, and UnscaledValue, which the analyzer inserts around decimal operations.

  • User-defined functions: Scala UDFs registered through the DataFrame or SQL API.

  • Structural expressions: aliases, attribute references, literals, sort orders, and CASE WHEN.

This list is illustrative, not exhaustive: the per-function tables are not the complete set of expressions Comet can accelerate.

See also#