alamb commented on code in PR #777:
URL:
https://github.com/apache/arrow-rs-object-store/pull/777#discussion_r3548008736
##########
src/local.rs:
##########
@@ -1739,6 +1765,42 @@ mod tests {
assert_eq!(&*read_data, data);
}
+ #[tokio::test]
+ async fn get_ranges_coalesces() {
+ let root = TempDir::new().unwrap();
+ let integration =
LocalFileSystem::new_with_prefix(root.path()).unwrap();
+ let location = Path::from("some_file");
+
+ // Position-dependent content so a misrouted slice is detectable.
+ let data: Bytes = (0..4096u32)
+ .map(|i| (i % 251) as u8)
+ .collect::<Vec<_>>()
+ .into();
+ integration
+ .put(&location, data.clone().into())
+ .await
+ .unwrap();
+
+ let cases: Vec<Vec<Range<u64>>> = vec![
+ vec![0..16, 16..32, 32..48], // adjacent ->
coalesced
+ vec![0..16, 64..80, 1000..1016], // gapped -> not
coalesced
+ vec![100..120, 0..50, 40..60, 0..50, 110..130], // out-of-order,
overlapping, duplicate
+ vec![], // empty
+ ];
+
+ for ranges in cases {
+ let got = integration.get_ranges(&location,
&ranges).await.unwrap();
Review Comment:
(sorry I forgot to click submit on the PR)
--
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]