MCPcopy Create free account
hub / github.com/apache/datafusion / test_with_fetch_fetch_exceeds_rows

Function test_with_fetch_fetch_exceeds_rows

datafusion/common/src/stats.rs:2436–2450  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2434
2435 #[test]
2436 fn test_with_fetch_fetch_exceeds_rows() {
2437 // Test when fetch is larger than available rows after skip
2438 let original_stats = Statistics {
2439 num_rows: Precision::Exact(100),
2440 total_byte_size: Precision::Exact(800),
2441 column_statistics: vec![col_stats_i64(10)],
2442 };
2443
2444 // Skip 50, fetch 100, but only 50 rows remain
2445 let result = original_stats.clone().with_fetch(Some(100), 50, 1).unwrap();
2446
2447 assert_eq!(result.num_rows, Precision::Exact(50));
2448 // 50/100 = 0.5, so 800 * 0.5 = 400
2449 assert_eq!(result.total_byte_size, Precision::Inexact(400));
2450 }
2451
2452 #[test]
2453 fn test_with_fetch_preserves_all_column_stats() {

Callers

nothing calls this directly

Calls 2

with_fetchMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…