()
| 408 | |
| 409 | #[tokio::test] |
| 410 | async fn local_encode_and_download() { |
| 411 | let dir = tempfile::tempdir().unwrap(); |
| 412 | let config = ColdStorageConfig { |
| 413 | local_dir: Some(dir.path().to_path_buf()), |
| 414 | ..Default::default() |
| 415 | }; |
| 416 | let cold = ColdStorage::new(config).unwrap(); |
| 417 | |
| 418 | let rows = vec![ |
| 419 | ("d1".into(), serde_json::json!({"name": "alice", "age": 30})), |
| 420 | ("d2".into(), serde_json::json!({"name": "bob", "age": 25})), |
| 421 | ]; |
| 422 | let path = cold |
| 423 | .encode_and_upload("users", 1, &rows, 100, 200) |
| 424 | .await |
| 425 | .unwrap(); |
| 426 | |
| 427 | assert!(path.contains("users")); |
| 428 | assert!(path.ends_with(".parquet")); |
| 429 | assert_eq!(cold.files_uploaded(), 1); |
| 430 | |
| 431 | // Download and verify. |
| 432 | let bytes = cold.download_parquet(&path).await.unwrap(); |
| 433 | let batches = read_parquet_with_predicate(&bytes, &[]).unwrap(); |
| 434 | assert!(!batches.is_empty()); |
| 435 | assert_eq!(batches[0].num_rows(), 2); |
| 436 | } |
| 437 | |
| 438 | #[tokio::test] |
| 439 | async fn projected_read() { |
nothing calls this directly
no test coverage detected