You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: datafusion/functions/src/datetime/to_date.rs
+41-1Lines changed: 41 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ Additional examples can be found [here](https://github.com/apache/datafusion/blo
61
61
name = "format_n",
62
62
description = r"Optional [Chrono format](https://docs.rs/chrono/latest/chrono/format/strftime/index.html) strings to use to parse the expression. Formats will be tried in the order
63
63
they appear with the first successful one being returned. If none of the formats successfully parse the expression
64
-
an error will be returned."
64
+
an error will be returned. NULL formats are skipped. If every format is NULL the result is NULL."
65
65
)
66
66
)]
67
67
#[derive(Debug,PartialEq,Eq,Hash)]
@@ -519,4 +519,44 @@ mod tests {
519
519
panic!("Conversion of {date_str} succeeded, but should have failed. ");
520
520
}
521
521
}
522
+
523
+
/// A NULL format must be skipped even when its slot still holds parseable
524
+
/// bytes, otherwise it can silently win over a later valid format.
Copy file name to clipboardExpand all lines: datafusion/functions/src/datetime/to_unixtime.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Integers, unsigned integers, and floats are interpreted as seconds since the uni
56
56
),
57
57
argument(
58
58
name = "format_n",
59
-
description = "Optional [Chrono format](https://docs.rs/chrono/latest/chrono/format/strftime/index.html) strings to use to parse the expression. Formats will be tried in the order they appear with the first successful one being returned. If none of the formats successfully parse the expression an error will be returned."
59
+
description = "Optional [Chrono format](https://docs.rs/chrono/latest/chrono/format/strftime/index.html) strings to use to parse the expression. Formats will be tried in the order they appear with the first successful one being returned. If none of the formats successfully parse the expression an error will be returned. NULL formats are skipped. If every format is NULL the result is NULL."
0 commit comments