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

Function on_error_scanning

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

Source from the content-addressed store, hash-verified

460
461 #[tokio::test]
462 async fn on_error_scanning() -> Result<()> {
463 let batches = FileStreamTest::new()
464 .with_records(vec![make_partition(3), make_partition(2)])
465 .with_num_files(2)
466 .with_on_error(OnError::Skip)
467 .with_scan_errors(vec![0])
468 .result()
469 .await?;
470
471 #[rustfmt::skip]
472 assert_batches_eq!(&[
473 "+---+",
474 "| i |",
475 "+---+",
476 "| 0 |",
477 "| 1 |",
478 "| 2 |",
479 "| 0 |",
480 "| 1 |",
481 "+---+",
482 ], &batches);
483
484 let batches = FileStreamTest::new()
485 .with_records(vec![make_partition(3), make_partition(2)])
486 .with_num_files(2)
487 .with_on_error(OnError::Skip)
488 .with_scan_errors(vec![1])
489 .result()
490 .await?;
491
492 #[rustfmt::skip]
493 assert_batches_eq!(&[
494 "+---+",
495 "| i |",
496 "+---+",
497 "| 0 |",
498 "| 1 |",
499 "| 2 |",
500 "| 0 |",
501 "| 1 |",
502 "+---+",
503 ], &batches);
504
505 let batches = FileStreamTest::new()
506 .with_records(vec![make_partition(3), make_partition(2)])
507 .with_num_files(2)
508 .with_on_error(OnError::Skip)
509 .with_scan_errors(vec![0, 1])
510 .result()
511 .await?;
512
513 #[rustfmt::skip]
514 assert_batches_eq!(&[
515 "++",
516 "++",
517 ], &batches);
518
519 Ok(())

Callers

nothing calls this directly

Calls 6

newFunction · 0.85
resultMethod · 0.80
with_scan_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…