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

Function test_s3_url_fallback

datafusion-cli/tests/cli_integration.rs:444–477  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

442
443#[tokio::test]
444async fn test_s3_url_fallback() {
445 if env::var("TEST_STORAGE_INTEGRATION").is_err() {
446 eprintln!("Skipping external storages integration tests");
447 return;
448 }
449
450 let container = match setup_minio_container().await {
451 Ok(c) => c,
452 Err(e) if e.contains("toomanyrequests") => {
453 eprintln!("Skipping test: Docker pull rate limit reached: {e}");
454 return;
455 }
456 e @ Err(_) => e.unwrap(),
457 };
458
459 let mut settings = make_settings();
460 settings.set_snapshot_suffix("s3_url_fallback");
461 let _bound = settings.bind_to_scope();
462
463 // Create a table using a prefix path (without trailing slash)
464 // This should trigger the fallback logic where head() fails on the prefix
465 // and list() is used to discover the actual files
466 let input = r#"CREATE EXTERNAL TABLE partitioned_data
467STORED AS CSV
468LOCATION 's3://data/partitioned_csv'
469OPTIONS (
470 'format.has_header' 'false'
471);
472
473SELECT * FROM partitioned_data ORDER BY column_1, column_2 LIMIT 5;
474"#;
475
476 assert_cmd_snapshot!(cli().with_minio(&container).await.pass_stdin(input));
477}
478
479/// Validate object store profiling output
480#[tokio::test]

Callers

nothing calls this directly

Calls 4

setup_minio_containerFunction · 0.85
is_errMethod · 0.80
make_settingsFunction · 0.70
containsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…