Scalar Functions — Array / Set
Array and set functions operate on KQL dynamic arrays. This category has the narrowest cross-dialect support — most functions are limited to ClickHouse and DuckDB, with a handful also available in PostgreSQL. SQLite and MySQL have no array type and cannot support these functions.
Legend: ✅ Supported · ⚠️ Approximated · ❌ Not Supported · 🔄 Rewritten
| Function | SQLite | MySQL | ClickHouse | PostgreSQL | DuckDB | Notes |
|---|---|---|---|---|---|---|
array_length() | ❌ | ❌ | ✅ | ✅ | ✅ | Postgres: array_length(arr, 1). DuckDB: json_array_length for JSON-literal args, else array_length |
array_concat() | ❌ | ❌ | ✅ | ✅ | ✅ | Postgres folds binary array_cat; DuckDB: list_concat |
array_index_of() | ❌ | ❌ | ✅ | ❌ | ✅ | ClickHouse: indexOf - 1 (0-based); DuckDB: array_indexof |
array_slice() | ❌ | ❌ | ✅ | ✅ | ✅ | DuckDB: array_slice (0-based, like KQL) |
array_split() | ❌ | ❌ | ⚠️ | ❌ | ⚠️ | Literal indices → full N-way split; ClickHouse falls back to a single split index with warning, DuckDB requires a literal indices array (column-ref unsupported) |
array_reverse() | ❌ | ❌ | ✅ | ❌ | ✅ | DuckDB: array_reverse |
array_rotate_left() | ❌ | ❌ | ✅ | ❌ | ✅ | DuckDB: list_slice + list_concat (no native rotate) |
array_rotate_right() | ❌ | ❌ | ✅ | ❌ | ✅ | DuckDB: list_slice + list_concat (no native rotate) |
array_sort_asc() / array_sort_desc() | ❌ | ❌ | ✅ | ❌ | ✅ | ClickHouse: arraySort/arrayReverseSort; DuckDB: list_sort/list_reverse_sort. Single-array form only (multi-array/nulls_last rejected) |
array_sum() | ❌ | ❌ | ✅ | ❌ | ✅ | ClickHouse: arraySum(); DuckDB: array_aggregate(arr, 'sum') |
array_iif() / array_iff() | ❌ | ❌ | ✅ | ❌ | ✅ | ClickHouse: arrayMap with if() lambda; DuckDB: list_transform over list_zip |
set_has_element() | ❌ | ❌ | ✅ | ✅ | ✅ | Postgres: = ANY; DuckDB: array_contains |
set_intersect() | ❌ | ❌ | ✅ | ❌ | ✅ | ClickHouse: arrayIntersect(); DuckDB: array_intersect |
set_union() | ❌ | ❌ | ✅ | ❌ | ✅ | ClickHouse: arrayConcat + arrayDistinct; DuckDB: list_distinct(array_cat(...)) |
set_difference() | ❌ | ❌ |