hanbings commented on code in PR #302:
URL: https://github.com/apache/hudi-rs/pull/302#discussion_r2051447568
##########
crates/core/src/table/mod.rs:
##########
@@ -474,6 +481,36 @@ impl Table {
}
}
+/// Formats a timestamp string to `yyyyMMddHHmmSSSSS` format.
+///
+/// The function attempts to parse the input timestamp string (`timestamp`)
into a `DateTime` object.
+/// It first tries parsing the ISO 8601 format, and if that fails, it tries
two other formats: `yyyyMMddHHmmSSSSS`
+/// and `yyyyMMddHHmmSS`. If none of the formats match, it returns the
original input string.
+///
+/// # Arguments
+/// - `timestamp`: The input timestamp string to be formatted.
+///
+/// # Returns
+/// A string formatted as `yyyyMMddHHmmSSSSS`. If the input cannot be parsed,
the original string is returned.
+fn format_timestamp(timestamp: &str) -> String {
Review Comment:
I have added an is_utc parameter to this function in the new commit to mark
whether the utc time zone is used, and changed the return value to `Result`, it
will return a CoreError::Timeline when parsing errors occur.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]