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

Function two_partition_morsel_test

datafusion/datasource/src/file_stream/mod.rs:1018–1053  ·  view source on GitHub ↗

Return a morsel test with two partitions: Partition 0: file1, file2, file3 Partition 1: file4 Partition 1 has only 1 file but it polled first 4 times

()

Source from the content-addressed store, hash-verified

1016 ///
1017 /// Partition 1 has only 1 file but it polled first 4 times
1018 fn two_partition_morsel_test() -> FileStreamMorselTest {
1019 FileStreamMorselTest::new()
1020 // Partition 0 has three files
1021 .with_file_in_partition(
1022 PartitionId(0),
1023 MockPlanner::builder("file1.parquet")
1024 .add_plan(MockPlanBuilder::new().with_morsel(MorselId(10), 101))
1025 .return_none(),
1026 )
1027 .with_file_in_partition(
1028 PartitionId(0),
1029 MockPlanner::builder("file2.parquet")
1030 .add_plan(MockPlanBuilder::new().with_morsel(MorselId(11), 102))
1031 .return_none(),
1032 )
1033 .with_file_in_partition(
1034 PartitionId(0),
1035 MockPlanner::builder("file3.parquet")
1036 .add_plan(MockPlanBuilder::new().with_morsel(MorselId(12), 103))
1037 .return_none(),
1038 )
1039 // Partition 1 has only one file, but is polled first
1040 .with_file_in_partition(
1041 PartitionId(1),
1042 MockPlanner::builder("file4.parquet")
1043 .add_plan(MockPlanBuilder::new().with_morsel(MorselId(13), 201))
1044 .return_none(),
1045 )
1046 .with_reads(vec![
1047 PartitionId(1),
1048 PartitionId(1),
1049 PartitionId(1),
1050 PartitionId(1),
1051 PartitionId(1),
1052 ])
1053 }
1054
1055 /// Verifies that an idle sibling stream can steal shared files from
1056 /// another stream once it exhausts its own local work.

Calls 8

newFunction · 0.85
PartitionIdClass · 0.85
MorselIdClass · 0.85
with_readsMethod · 0.80
return_noneMethod · 0.80
add_planMethod · 0.80
with_morselMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…