SQL
List Functions
<!-- markdownlint-disable MD001 MD056 -->  
| Name | Description |
|:--|:-------|
| [`list[index]`](#listindex) | Bracket notation serves as an alias for `list_extract`. |
| [`list[begin:end]`](#listbeginend) | Bracket notation with colon is an alias for `list_slice`. |
| [`list[begin:end:step]`](#listbeginendstep) | `list_slice` in bracket notation with an added `step` feature. |
| [`array_pop_back(list)`](#::array_pop_backlist) | Returns the list without the last element. |
| [`array_pop_front(list)`](#::array_pop_frontlist) | Returns the list without the first element. |
| [`flatten(list_of_lists)`](#::flattenlist_of_lists) | Concatenate a list of lists into a single list. This only flattens one level of the list (see [examples](#::flattening)). |
| [`len(list)`](#::lenlist) | Return the length of the list. |
| [`list_aggregate(list, name)`](#::list_aggregatelist-name) | Executes the aggregate function `name` on the elements of `list`. See the [List Aggregates](#docs:sql:functions:list::list-aggregates) section for more details. |
| [`list_any_value(list)`](#::list_any_valuelist) | Returns the first non-null value in the list. |
| [`list_append(list, element)`](#::list_appendlist-element) | Appends `element` to `list`. |
| [`list_concat(list1, list2)`](#::list_concatlist1-list2) | Concatenate two lists. NULL inputs are skipped. See also `||` |
| [`list_contains(list, element)`](#::list_containslist-element) | Returns true if the list contains the element. |
| [`list_cosine_similarity(list1, list2)`](#::list_cosine_similaritylist1-list2) | Compute the cosine similarity between two lists. |
| [`list_cosine_distance(list1, list2)`](#::list_cosine_distancelist1-list2) | Compute the cosine distance between two lists. Equivalent to `1.0 - list_cosine_similarity`. |
| [`list_distance(list1, list2)`](#::list_distancelist1-list2) | Calculates the Euclidean distance between two points with coordinates given in two inputs lists of equal length. |
| [`list_distinct(list)`](#::list_distinctlist) | Removes all duplicates and `NULL` values from a list. Does not preserve the original order. |
| [`list_dot_product(list1, list2)`](#::list_dot_productlist1-list2) | Computes the dot product of two same-sized lists of numbers. |
| [`list_negative_dot_product(list1, list2)`](#::list_negative_dot_productlist1-list2) | Computes the negative dot product of two same-sized lists of numbers. Equivalent to `- list_dot_product`. |
| [`list_extract(list, index)`](#::list_extractlist-index) | Extract the `index`th (1-based) value from the list. |
| [`list_filter(list, lambda)`](#::list_filterlist-lambda) | Constructs a list from those elements of the input list for which the lambda function returns true. See the [Lambda Functions](#docs:sql:functions:lambda::filter) page for more details. |
| [`list_grade_up(list)`](#::list_grade_uplist) | Works like sort, but the results are the indexes that correspond to the position in the original `list` instead of the actual values. |
| [`list_has_all(list, sub-list)`](#::list_has_alllist-sub-list) | Returns true if all elements of sub-list exist in list. |
| [`list_has_any(list1, list2)`](#::list_has_anylist1-list2) | Returns true if any elements exist is both lists. |
| [`list_intersect(list1, list2)`](#::list_intersectlist1-list2) | Returns a list of all the elements that exist in both `l1` and `l2`, without duplicates. |
| [`list_position(list, element)`](#::list_positionlist-element) | Returns the index of the element if the list contains the element. If the element is not found, it returns `NULL`. |
| [`list_prepend(element, list)`](#::list_prependelement-list) | Prepends `element` to `list`. |
| [`list_reduce(list, lambda)`](#::list_reducelist-lambda) | Returns a single value that is the result of applying the lambda function to each element of the input list. See the [Lambda Functions](#docs:sql:functions:lambda::reduce) page for more details. |
| [`list_resize(list, size[, value])`](#list_resizelist-size-value) | Resizes the list to contain `size` elements. Initializes new elements with `value` or `NULL` if `value` is not set. |
| [`list_reverse_sort(list)`](#::list_reverse_sortlist) | Sorts the elements of the list in reverse order. See the [Sorting Lists](#docs:sql:functions:list::sorting-lists) section for more details about the `NULL` sorting order. |
| [`list_reverse(list)`](#::list_reverselist) | Reverses the list. |
| [`list_select(value_list, index_list)`](#::list_selectvalue_list-index_list) | Returns a list based on the elements selected by the `index_list`. |
| [`list_slice(list, begin, end, step)`](#::list_slicelist-begin-end-step) | `list_slice` with added `step` feature. |
| [`list_slice(list, begin, end)`](#::list_slicelist-begin-end) | Extract a sublist using slice conventions. Negative values are accepted. See [slicing](#docs:sql:functions:list::slicing). |
| [`list_sort(list)`](#::list_sortlist) | Sorts the elements of the list. See the [Sorting Lists](#docs:sql:functions:list::sorting-lists) section for more details about the sorting order and the `NULL` sorting order. |
| [`list_transform(list, lambda)`](#::list_transformlist-lambda) | Returns a list that is the result of applying the lambda function to each element of the input list. See the [Lambda Functions](#docs:sql:functions:lambda::transform) page for more details. |
| [`list_unique(list)`](#::list_uniquelist) | Counts the unique elements of a list. |
| [`list_value(any, ...)`](#::list_valueany-) | Create a `LIST` containing the argument values. |
| [`list_where(value_list, mask_list)`](#::list_wherevalue_list-mask_list) | Returns a list with the `BOOLEAN`s in `mask_list` applied as a mask to the `value_list`. |
| [`list_zip(list_1, list_2, ...[, truncate])`](#list_ziplist1-list2-) | Zips _k_ `LIST`s to a new `LIST` whose length will be that of the longest list. Its elements are structs of _k_ elements from each list `list_1`, ..., `list_k`, missing elements are replaced with `NULL`. If `truncate` is set, all lists are truncated to the smallest list length. |
| [`unnest(list)`](#::unnestlist) | Unnests a list by one level. Note that this is a special function that alters the cardinality of the result. See the [`unnest` page](#docs:sql:query_syntax:unnest) for more details. |