<!---
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

# Array Expressions

<!--BEGIN:EXPR_COMPAT[array]-->

## ArrayExcept

The following incompatibilities cause `ArrayExcept` to fall back to Spark by default. Set `spark.comet.expression.ArrayExcept.allowIncompatible=true` to enable Comet acceleration despite these differences.

- Null handling and ordering may differ from Spark

## ArrayFilter

The following cases are not supported by Comet:

- Only supports `array_filter` when the function is `IsNotNull` (used by `array_compact`)

## ArrayIntersect

The following incompatibilities cause `ArrayIntersect` to fall back to Spark by default. Set `spark.comet.expression.ArrayIntersect.allowIncompatible=true` to enable Comet acceleration despite these differences.

- Result array element order may differ from Spark when the right array is longer than the left (DataFusion probes the longer side).

The following cases are not supported by Comet:

- array_intersect on collated strings is not supported.

## ArrayJoin

The following incompatibilities cause `ArrayJoin` to fall back to Spark by default. Set `spark.comet.expression.ArrayJoin.allowIncompatible=true` to enable Comet acceleration despite these differences.

- Null handling may differ from Spark

## ArraysZip

The following cases are not supported by Comet:

- Not all input data types are supported; falls back to Spark for unsupported types

## ElementAt

The following cases are not supported by Comet:

- Input must be an array. `Map` inputs are not supported.

## Size

The following cases are not supported by Comet:

- Only supports `ArrayType` input; `MapType` input is not supported

## SortArray

The following incompatibilities cause `SortArray` to fall back to Spark by default. Set `spark.comet.expression.SortArray.allowIncompatible=true` to enable Comet acceleration despite these differences.

- When `spark.comet.exec.strictFloatingPoint=true`, sorting on floating-point types is not 100% compatible with Spark

The following cases are not supported by Comet:

- Nested arrays with `Struct` or `Null` child values are not supported natively and will fall back to Spark.
<!--END:EXPR_COMPAT-->
