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

Function morsel_multiple_files

datafusion/datasource/src/file_stream/mod.rs:939–975  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

937 /// Verifies that `FileStream` scans multiple files in order.
938 #[tokio::test]
939 async fn morsel_multiple_files() -> Result<()> {
940 let test = FileStreamMorselTest::new()
941 .with_file(
942 MockPlanner::builder("file1.parquet")
943 .add_plan(MockPlanBuilder::new().with_morsel(MorselId(10), 41))
944 .return_none(),
945 )
946 .with_file(
947 MockPlanner::builder("file2.parquet")
948 .add_plan(MockPlanBuilder::new().with_morsel(MorselId(11), 42))
949 .return_none(),
950 );
951
952 insta::assert_snapshot!(test.run().await.unwrap(), @r"
953 ----- Output Stream -----
954 Batch: 41
955 Batch: 42
956 Done
957 ----- File Stream Events -----
958 morselize_file: file1.parquet
959 planner_created: file1.parquet
960 planner_called: file1.parquet
961 morsel_produced: file1.parquet, MorselId(10)
962 morsel_stream_started: MorselId(10)
963 morsel_stream_batch_produced: MorselId(10), BatchId(41)
964 morsel_stream_finished: MorselId(10)
965 morselize_file: file2.parquet
966 planner_created: file2.parquet
967 planner_called: file2.parquet
968 morsel_produced: file2.parquet, MorselId(11)
969 morsel_stream_started: MorselId(11)
970 morsel_stream_batch_produced: MorselId(11), BatchId(42)
971 morsel_stream_finished: MorselId(11)
972 ");
973
974 Ok(())
975 }
976
977 /// Verifies that a global limit can stop the stream before a second file is opened.
978 #[tokio::test]

Callers

nothing calls this directly

Calls 6

newFunction · 0.85
MorselIdClass · 0.85
return_noneMethod · 0.80
add_planMethod · 0.80
with_morselMethod · 0.80
with_fileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…