Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix failures caused by array_prepend #13367

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion datafusion/functions-nested/src/concat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,10 @@ impl ScalarUDFImpl for ArrayPrepend {
}
}

static DOCUMENTATION_PREPEND: OnceLock<Documentation> = OnceLock::new();

fn get_array_prepend_doc() -> &'static Documentation {
DOCUMENTATION.get_or_init(|| {
DOCUMENTATION_PREPEND.get_or_init(|| {
Documentation::builder()
.with_doc_section(DOC_SECTION_ARRAY)
.with_description(
Expand Down
12 changes: 6 additions & 6 deletions docs/source/user-guide/sql/scalar_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3089,18 +3089,18 @@ array_prepend(element, array)

#### Arguments

- **element**: Element to append to the array.
- **element**: Element to prepend to the array.
- **array**: Array expression. Can be a constant, column, or function, and any combination of array operators.

#### Example

```sql
> select array_prepend(1, [2, 3, 4]);
+--------------------------------------+
| array_prepend(Int64(1), List([2,3,4])) |
+--------------------------------------+
| [1, 2, 3, 4] |
+--------------------------------------+
+---------------------------------------+
| array_prepend(Int64(1),List([2,3,4])) |
+---------------------------------------+
| [1, 2, 3, 4] |
+---------------------------------------+
```

#### Aliases
Expand Down