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

Function test_csv_empty_file

datafusion/core/src/datasource/file_format/csv.rs:829–847  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

827 /// (file is empty)
828 #[tokio::test]
829 async fn test_csv_empty_file() -> Result<()> {
830 let ctx = SessionContext::new();
831 ctx.register_csv(
832 "empty",
833 "tests/data/empty_0_byte.csv",
834 CsvReadOptions::new().has_header(false),
835 )
836 .await?;
837
838 let query = "select * from empty where random() > 0.5;";
839 let query_result = ctx.sql(query).await?.collect().await?;
840
841 assert_snapshot!(batches_to_string(&query_result),@r"
842 ++
843 ++
844 ");
845
846 Ok(())
847 }
848
849 /// Read a single empty csv file with header
850 ///

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
collectMethod · 0.80
sqlMethod · 0.80
register_csvMethod · 0.45
has_headerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…