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

Function create_object_store_table_gcs

datafusion-cli/src/exec.rs:707–739  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

705
706 #[tokio::test]
707 async fn create_object_store_table_gcs() -> Result<()> {
708 let service_account_path = "fake_service_account_path";
709 let service_account_key = "{\"private_key\": \"fake_private_key.pem\",\"client_email\":\"fake_client_email\", \"private_key_id\":\"id\"}";
710 let application_credentials_path = "fake_application_credentials_path";
711 let location = "gcs://bucket/path/file.parquet";
712
713 // for service_account_path
714 let sql = format!("CREATE EXTERNAL TABLE test STORED AS PARQUET
715 OPTIONS('gcp.service_account_path' '{service_account_path}') LOCATION '{location}'");
716 let err = create_external_table_test(location, &sql)
717 .await
718 .unwrap_err();
719 assert_contains!(err.to_string(), "os error 2");
720
721 // for service_account_key
722 let sql = format!(
723 "CREATE EXTERNAL TABLE test STORED AS PARQUET OPTIONS('gcp.service_account_key' '{service_account_key}') LOCATION '{location}'"
724 );
725 let err = create_external_table_test(location, &sql)
726 .await
727 .unwrap_err();
728 assert_contains!(err.to_string(), "Error reading pem file: no items found");
729
730 // for application_credentials_path
731 let sql = format!("CREATE EXTERNAL TABLE test STORED AS PARQUET
732 OPTIONS('gcp.application_credentials_path' '{application_credentials_path}') LOCATION '{location}'");
733 let err = create_external_table_test(location, &sql)
734 .await
735 .unwrap_err();
736 assert_contains!(err.to_string(), "os error 2");
737
738 Ok(())
739 }
740
741 #[tokio::test]
742 async fn create_external_table_local_file() -> Result<()> {

Callers

nothing calls this directly

Calls 2

unwrap_errMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…