Skip to content

Commit

Permalink
simpler test
Browse files Browse the repository at this point in the history
  • Loading branch information
avantgardnerio committed Nov 25, 2024
1 parent c978f74 commit dbc3632
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions datafusion/core/src/datasource/file_format/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -766,11 +766,38 @@ mod tests {
use object_store::aws::Checksum;
use object_store::local::LocalFileSystem;
use object_store::path::Path;
use object_store::{MultipartUpload, PutMultipartOpts, PutPayload};
use regex::Regex;
use rstest::*;
use url::Url;
use datafusion_execution::object_store::ObjectStoreUrl;

#[tokio::test]
async fn write_multipart_file_with_signature() {
let bucket = "cgx-production-c4c-archive-data";
let s3root = format!("s3://{bucket}");
let store = AmazonS3Builder::from_env()
.with_bucket_name(bucket)
.with_checksum_algorithm(Checksum::SHA256) // fails for large text
.build()
.unwrap();


let str = format!("cx/exports/team_id=555585/file9.csv");
let path = Path::parse(str).unwrap();
let opts = PutMultipartOpts::default();
let mut upload = store.put_multipart_opts(&path, opts).await.unwrap();

let part = upload.put_part(PutPayload::from_static(&[0u8; 10485760]));
part.await.unwrap();

let part = upload.put_part(PutPayload::from_static(&[0u8; 5514256]));
part.await.unwrap();

let res = upload.complete().await.unwrap();
println!("res={res:?}");
}

#[tokio::test]
async fn write_multipart_csv_with_signature() {
// setup session
Expand Down

0 comments on commit dbc3632

Please sign in to comment.