Skip to content

Commit

Permalink
adding time support, improved tests in datatime_expressions.rs, fixed…
Browse files Browse the repository at this point in the history
… scalar doc example
  • Loading branch information
Omega359 committed Feb 9, 2024
1 parent dbbaded commit 806c6ff
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 316 deletions.
2 changes: 1 addition & 1 deletion datafusion-examples/examples/to_char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::sync::Arc;

/// This example demonstrates how to use the to_char function via sql
///
/// This function accepts date, timestamp and duration values
/// This function accepts date, time, timestamp and duration values
/// in the first argument and string values for the second
#[tokio::main]
async fn main() -> Result<()> {
Expand Down
4 changes: 4 additions & 0 deletions datafusion/expr/src/built_in_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,10 @@ impl BuiltinScalarFunction {
vec![
Exact(vec![Date32, Utf8]),
Exact(vec![Date64, Utf8]),
Exact(vec![Time32(Millisecond), Utf8]),
Exact(vec![Time32(Second), Utf8]),
Exact(vec![Time64(Microsecond), Utf8]),
Exact(vec![Time64(Nanosecond), Utf8]),
Exact(vec![Timestamp(Second, None), Utf8]),
Exact(vec![
Timestamp(Second, Some(TIMEZONE_WILDCARD.into())),
Expand Down
2 changes: 1 addition & 1 deletion datafusion/expr/src/expr_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ scalar_expr!(
ToChar,
to_char,
datetime format,
"converts a date, timestamp or duration to a string based on the provided format"
"converts a date, time, timestamp or duration to a string based on the provided format"
);
nary_scalar_expr!(
ToTimestamp,
Expand Down
Loading

0 comments on commit 806c6ff

Please sign in to comment.