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

Function read_single_file

datafusion/core/src/datasource/listing/table.rs:233–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231
232 #[tokio::test]
233 async fn read_single_file() -> Result<()> {
234 let ctx = SessionContext::new_with_config(
235 SessionConfig::new().with_collect_statistics(true),
236 );
237
238 let table = load_table(&ctx, "alltypes_plain.parquet").await?;
239 let projection = None;
240 let exec = table
241 .scan(&ctx.state(), projection, &[], None)
242 .await
243 .expect("Scan table");
244
245 assert_eq!(exec.children().len(), 0);
246 assert_eq!(exec.output_partitioning().partition_count(), 1);
247
248 // test metadata
249 assert_eq!(
250 exec.partition_statistics(None)?.num_rows,
251 Precision::Exact(8)
252 );
253 assert_eq!(
254 exec.partition_statistics(None)?.total_byte_size,
255 Precision::Absent,
256 );
257
258 Ok(())
259 }
260
261 #[cfg(feature = "parquet")]
262 #[tokio::test]

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
load_tableFunction · 0.85
scanMethod · 0.45
stateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…