Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c124860
Extract out date time parsing to a DateTimeParser trait with chrono &…
Omega359 Jan 12, 2026
b1d0376
Review updates, cargo clippy updates.
Omega359 Jan 13, 2026
60be1ea
Adding tests for jiff, fixed issue with %s and jiff parsing.
Omega359 Jan 13, 2026
87d3ef9
Fixed issue with jiff and exec_err import.
Omega359 Jan 13, 2026
7a8955f
panic instead of exec error since there isn't a good way to propagate…
Omega359 Jan 13, 2026
8d8946a
Updating argument conversion for scalar args in handle_multiple.
Omega359 Jan 15, 2026
24b6c51
Merge branch 'main' into jiff-proto
Omega359 Jan 17, 2026
ff8b201
Merge branch 'main' into jiff-proto
Omega359 Jan 22, 2026
41a4207
Merge branch 'main' into jiff-proto
Omega359 Jan 25, 2026
de1b808
Merge remote-tracking branch 'upstream/main' into jiff-proto
Omega359 Jan 31, 2026
7d0d6e5
Merge branch 'main' into jiff-proto
Omega359 Jan 31, 2026
3423bb1
Merge remote-tracking branch 'upstream/main' into jiff-proto
Omega359 Feb 12, 2026
c87ff00
Merge branch 'main' into jiff-proto
Omega359 Feb 12, 2026
ced0154
Merge branch 'main' into jiff-proto
Omega359 Feb 16, 2026
9799b26
Merge remote-tracking branch 'upstream/main' into jiff-proto
Omega359 Feb 19, 2026
3e601f4
Merge remote-tracking branch 'upstream/main' into jiff-proto
Omega359 Feb 19, 2026
5fe8e2a
Merge branch 'main' into jiff-proto
Omega359 Feb 20, 2026
a9def75
Merge branch 'main' into jiff-proto
Omega359 Feb 21, 2026
f7b1809
Merge remote-tracking branch 'upstream/main' into jiff-proto
Omega359 Feb 23, 2026
9bb7705
Merge branch 'main' into jiff-proto
Omega359 Feb 24, 2026
137c0cd
PR review updates and improvements.
Omega359 Feb 26, 2026
d80682f
Merge branch 'main' into jiff-proto
Omega359 Feb 26, 2026
1ab46fe
Merge branch 'main' into jiff-proto
Omega359 Feb 26, 2026
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
7 changes: 6 additions & 1 deletion datafusion/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::encryption::{FileDecryptionProperties, FileEncryptionProperties};
use crate::error::_config_err;
use crate::format::{ExplainAnalyzeLevel, ExplainFormat};
use crate::parquet_config::DFParquetWriterVersion;
use crate::parsers::CompressionTypeVariant;
use crate::parsers::{CompressionTypeVariant, DateTimeParserType};
use crate::utils::get_available_parallelism;
use crate::{DataFusionError, Result};
#[cfg(feature = "parquet_encryption")]
Expand Down 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<DateTimeParserType>, default = Some(DateTimeParserType::Chrono)

/// The default time zone
///
/// Some functions, e.g. `now` return timestamps in this time zone
Expand Down
49 changes: 47 additions & 2 deletions datafusion/common/src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

//! Interval parsing logic

use crate::DataFusionError;
use crate::config::{ConfigField, Visit};
use std::fmt::Display;
use std::str::FromStr;

use crate::DataFusionError;

/// Readable file compression type
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum CompressionTypeVariant {
Expand Down Expand Up @@ -73,3 +73,48 @@ impl CompressionTypeVariant {
!matches!(self, &Self::UNCOMPRESSED)
}
}

#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)]
pub enum DateTimeParserType {
#[default]
Chrono,
Jiff,
}

impl ConfigField for DateTimeParserType {
fn visit<V: Visit>(&self, v: &mut V, key: &str, description: &'static str) {
v.some(key, self, description)
}

fn set(&mut self, _: &str, value: &str) -> crate::Result<()> {
*self = DateTimeParserType::from_str(value)?;
Ok(())
}
}

impl FromStr for DateTimeParserType {
type Err = DataFusionError;

fn from_str(s: &str) -> Result<Self, Self::Err> {
let s = s.to_uppercase();
match s.as_str() {
"CHRONO" => Ok(Self::Chrono),
"JIFF" => Ok(Self::Jiff),
_ => Err(DataFusionError::NotImplemented(format!(
"Unsupported datetime parser type {s}"
))),
}
}
}

impl Display for DateTimeParserType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let str = match self {
Self::Chrono => "chrono",
Self::Jiff => "jiff",
};
write!(f, "{str}")
}
}

impl DateTimeParserType {}
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 }
memchr = { workspace = true }
Expand Down Expand Up @@ -116,7 +121,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