Skip to content
Open
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
7 changes: 5 additions & 2 deletions datafusion/functions-nested/src/array_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ make_higher_order_function_expr_and_func!(
#[user_doc(
doc_section(label = "Array Functions"),
description = "transforms the values of an array",
syntax_example = "array_transform(array, x -> x*2)",
syntax_example = "array_transform(array, lambda)",
sql_example = r#"```sql
> select array_transform([1, 2, 3, 4, 5], x -> x*2);
+-------------------------------------------+
Expand All @@ -63,7 +63,10 @@ make_higher_order_function_expr_and_func!(
name = "array",
description = "Array expression. Can be a constant, column, or function, and any combination of array operators."
),
argument(name = "lambda", description = "Lambda")
argument(
name = "lambda",
description = "The lambda function used to transform each value of the array."
)
)]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct ArrayTransform {
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/datetime/to_date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Integers and doubles are interpreted as days since the unix epoch (`1970-01-01T0
Returns the corresponding date.

Note: `to_date` returns Date32, which represents its values as the number of days since unix epoch(`1970-01-01`) stored as signed 32 bit value. The largest supported date value is `9999-12-31`.",
syntax_example = "to_date('2017-05-31', '%Y-%m-%d')",
syntax_example = "to_date(expression[, ..., format_n])",
sql_example = r#"```sql
> select to_date('2023-01-31');
+-------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion datafusion/functions/src/datetime/to_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Timestamps will have the time portion extracted.
Returns the corresponding time.

Note: `to_time` returns Time64(Nanosecond), which represents the time of day in nanoseconds since midnight.",
syntax_example = "to_time('12:30:45', '%H:%M:%S')",
syntax_example = "to_time(expression[, ..., format_n])",
sql_example = r#"```sql
> select to_time('12:30:45');
+---------------------------+
Expand Down
4 changes: 2 additions & 2 deletions datafusion/macros/src/user_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use syn::{DeriveInput, LitStr, parse_macro_input};
/// #[user_doc(
/// doc_section(label = "Time and Date Functions"),
/// description = r"Converts a value to a date (`YYYY-MM-DD`).",
/// syntax_example = "to_date('2017-05-31', '%Y-%m-%d')",
/// syntax_example = "to_date(expression[, ..., format_n])",
/// sql_example = r#"```sql
/// > select to_date('2023-01-31');
/// +-----------------------------+
Expand Down Expand Up @@ -77,7 +77,7 @@ use syn::{DeriveInput, LitStr, parse_macro_input};
/// description: None,
/// },
/// r"Converts a value to a date (`YYYY-MM-DD`).".to_string(),
/// "to_date('2017-05-31', '%Y-%m-%d')".to_string(),
/// "to_date(expression[, ..., format_n])".to_string(),
/// )
/// .with_sql_example(
/// r#"```sql
Expand Down
8 changes: 4 additions & 4 deletions docs/source/user-guide/sql/scalar_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2843,7 +2843,7 @@ Returns the corresponding date.
Note: `to_date` returns Date32, which represents its values as the number of days since unix epoch(`1970-01-01`) stored as signed 32 bit value. The largest supported date value is `9999-12-31`.

```sql
to_date('2017-05-31', '%Y-%m-%d')
to_date(expression[, ..., format_n])
```

#### Arguments
Expand Down Expand Up @@ -2944,7 +2944,7 @@ Returns the corresponding time.
Note: `to_time` returns Time64(Nanosecond), which represents the time of day in nanoseconds since midnight.

```sql
to_time('12:30:45', '%H:%M:%S')
to_time(expression[, ..., format_n])
```

#### Arguments
Expand Down Expand Up @@ -4637,13 +4637,13 @@ array_to_string(array, delimiter[, null_string])
transforms the values of an array

```sql
array_transform(array, x -> x*2)
array_transform(array, lambda)
```

#### Arguments

- **array**: Array expression. Can be a constant, column, or function, and any combination of array operators.
- **lambda**: Lambda
- **lambda**: The lambda function used to transform each value of the array.

#### Example

Expand Down
Loading