Copilot commented on code in PR #273:
URL: https://github.com/apache/fluss-rust/pull/273#discussion_r2778297515
##########
crates/fluss/tests/integration/log_table.rs:
##########
@@ -1200,6 +1200,48 @@ mod table_test {
records_after_unsubscribe.len()
);
+ // Test subscribe_partition_buckets: batch subscribe to all partitions
at once
+ let log_scanner_batch = table
+ .new_scan()
+ .create_log_scanner()
+ .expect("Failed to create log scanner for batch partition
subscribe test");
+ let partition_infos = admin
+ .list_partition_infos(&table_path)
+ .await
+ .expect("Failed to list partition infos");
+ let partition_bucket_offsets: HashMap<(i64, i32), i64> =
partition_infos
+ .iter()
+ .map(|p| ((p.get_partition_id(), 0), 0i64))
+ .collect();
+ log_scanner_batch
+ .subscribe_partition_buckets(&partition_bucket_offsets)
+ .await
+ .expect("Failed to batch subscribe to partitions");
+
+ let mut batch_collected: Vec<(i32, String, i64)> = Vec::new();
+ let batch_start = std::time::Instant::now();
+ while batch_collected.len() < expected_records.len()
+ && batch_start.elapsed() < Duration::from_secs(10)
+ {
Review Comment:
This polling loop can time out and proceed directly to sorting/asserting
equality without an explicit check that all expected records were collected.
Adding an assertion on `batch_collected.len() == expected_records.len()` (with
a helpful error message, like the earlier `collected_records` check) will make
failures much easier to diagnose and avoid masking timeout-related issues.
##########
bindings/cpp/examples/example.cpp:
##########
@@ -316,5 +316,126 @@ int main() {
}
}
+ // 11) Partitioned table example
+ std::cout << "\n=== Partitioned Table Example ===" << std::endl;
+
+ fluss::TablePath partitioned_table_path("fluss",
"partitioned_table_cpp_v1");
+
+ // Drop if exists
+ admin.DropTable(partitioned_table_path, true);
Review Comment:
In this example the return value of `DropTable` is ignored, unlike the
earlier drop at the top of the file where the result is checked/logged. If the
drop fails, the subsequent create may fail in confusing ways (e.g., schema
mismatch). Please handle/check the result here as well for consistency and
clearer failures.
```suggestion
check("drop_partitioned_table", admin.DropTable(partitioned_table_path,
true));
```
--
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]