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
32 changes: 32 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ async fn query_to_timestamp() -> Result<()> {
.collect()
.await;

let expected = "Execution error: Error parsing timestamp from '01-14-2023 01/01/30' using format '%d-%m-%Y %H:%M:%S': input is out of range";
let expected = "Error parsing timestamp from '01-14-2023 01/01/30' using formats: [\"%d-%m-%Y %H:%M:%S\"]: input is out of range";
assert_contains!(result.unwrap_err().to_string(), expected);

// note that using arrays for the chrono formats is not supported
Expand Down
5 changes: 5 additions & 0 deletions datafusion/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,11 @@ config_namespace! {
/// Defaults to the number of CPU cores on the system
pub target_partitions: usize, transform = ExecutionOptions::normalized_parallelism, default = get_available_parallelism()

/// The date time parser to use when parsing date time values.
///
/// Defaults to 'chrono'. 'jiff' is supported when the 'jiff' feature is enabled.
pub date_time_parser: Option<String>, transform = str::to_lowercase, default = Some("chrono".to_string())

/// The default time zone
///
/// Some functions, e.g. `now` return timestamps in this time zone
Expand Down
1 change: 1 addition & 0 deletions datafusion/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ unicode_expressions = [
"datafusion-functions/unicode_expressions",
]
extended_tests = []
jiff = ["datafusion-functions/jiff"]

[dependencies]
arrow = { workspace = true }
Expand Down
7 changes: 6 additions & 1 deletion datafusion/functions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ default = [
]
# enable encode/decode functions
encoding_expressions = ["base64", "hex"]
# enable jiff timestamp parsing
jiff = ["dep:jiff"]
# enable math functions
math_expressions = []
# enable regular expressions
Expand All @@ -78,8 +80,11 @@ datafusion-execution = { workspace = true }
datafusion-expr = { workspace = true }
datafusion-expr-common = { workspace = true }
datafusion-macros = { workspace = true }
dyn-eq = "0.1.3"
dyn-hash = "1.0.0"
hex = { workspace = true, optional = true }
itertools = { workspace = true }
jiff = { version = "0.2.18", optional = true }
log = { workspace = true }
md-5 = { version = "^0.10.0", optional = true }
num-traits = { workspace = true }
Expand Down Expand Up @@ -115,7 +120,7 @@ required-features = ["string_expressions"]
[[bench]]
harness = false
name = "to_timestamp"
required-features = ["datetime_expressions"]
required-features = ["datetime_expressions", "jiff"]

[[bench]]
harness = false
Expand Down
Loading