hudi-agent commented on code in PR #673:
URL: https://github.com/apache/hudi-rs/pull/673#discussion_r3771637382
##########
crates/core/src/table/mod.rs:
##########
@@ -955,6 +1140,53 @@ impl Table {
#[cfg(test)]
mod tests {
use super::*;
+
+ /// The only thing telling a caller their incremental range came back
short.
+ ///
+ /// Archived commits are not enumerated unless
+ /// `hoodie.internal.timeline.archived.enabled` is set, so a window
reaching
+ /// below the active timeline reports fewer changes than it covers. That is
+ /// silent except for this warning — and a warning nothing asserts is one
+ /// that can stop firing without anyone noticing.
+ ///
+ /// Both directions are asserted: a window inside the active timeline must
+ /// stay quiet, or the warning would be noise a caller learns to ignore.
+ #[tokio::test]
+ async fn test_window_predating_the_active_timeline_is_reported() ->
Result<()> {
+ let base_url = SampleTable::V6Nonpartitioned.url_to_cow();
+ let hudi_table = Table::new(base_url.path()).await?;
+
+ let boundary = hudi_table
+ .timeline
+ .earliest_active_instant
+ .clone()
+ .expect("fixture has an active timeline");
+
+ // A start below the boundary: the window covers commits that are no
+ // longer enumerable.
+ let message = hudi_table
+ .window_predates_active_timeline("00000000000000")
+ .expect("a start below the active timeline must be reported");
+ assert!(
+ message.contains("00000000000000") && message.contains(&boundary),
+ "the warning must name both the requested start and the boundary,
got: {message}"
+ );
+
+ // The boundary itself, and anything after it, is wholly inside the
+ // active timeline.
+ assert!(
+ hudi_table
+ .window_predates_active_timeline(&boundary)
+ .is_none(),
+ "a window starting exactly at the boundary covers no archived
commit"
+ );
+ let after = format!("{boundary}9");
Review Comment:
🤖 nit: the `"9"` suffix is a little magic here — could you add a short
comment explaining that appending any character to the boundary string produces
a string that sorts after it lexicographically, so the window lands inside the
active timeline? Something like `// any suffix makes this sort after boundary
in Hudi's lex comparison`.
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]