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

Function on_error_opening

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

Source from the content-addressed store, hash-verified

369
370 #[tokio::test]
371 async fn on_error_opening() -> Result<()> {
372 let batches = FileStreamTest::new()
373 .with_records(vec![make_partition(3), make_partition(2)])
374 .with_num_files(2)
375 .with_on_error(OnError::Skip)
376 .with_open_errors(vec![0])
377 .result()
378 .await?;
379
380 #[rustfmt::skip]
381 assert_batches_eq!(&[
382 "+---+",
383 "| i |",
384 "+---+",
385 "| 0 |",
386 "| 1 |",
387 "| 2 |",
388 "| 0 |",
389 "| 1 |",
390 "+---+",
391 ], &batches);
392
393 let batches = FileStreamTest::new()
394 .with_records(vec![make_partition(3), make_partition(2)])
395 .with_num_files(2)
396 .with_on_error(OnError::Skip)
397 .with_open_errors(vec![1])
398 .result()
399 .await?;
400
401 #[rustfmt::skip]
402 assert_batches_eq!(&[
403 "+---+",
404 "| i |",
405 "+---+",
406 "| 0 |",
407 "| 1 |",
408 "| 2 |",
409 "| 0 |",
410 "| 1 |",
411 "+---+",
412 ], &batches);
413
414 let batches = FileStreamTest::new()
415 .with_records(vec![make_partition(3), make_partition(2)])
416 .with_num_files(2)
417 .with_on_error(OnError::Skip)
418 .with_open_errors(vec![0, 1])
419 .result()
420 .await?;
421
422 #[rustfmt::skip]
423 assert_batches_eq!(&[
424 "++",
425 "++",
426 ], &batches);
427
428 Ok(())

Callers

nothing calls this directly

Calls 6

newFunction · 0.85
resultMethod · 0.80
with_open_errorsMethod · 0.80
with_num_filesMethod · 0.80
with_recordsMethod · 0.80
with_on_errorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…