()
| 1298 | |
| 1299 | #[tokio::test] |
| 1300 | async fn test_truncate_table() { |
| 1301 | let file_io = test_file_io(); |
| 1302 | let table_path = "memory:/test_truncate"; |
| 1303 | setup_dirs(&file_io, table_path).await; |
| 1304 | |
| 1305 | let commit = setup_commit(&file_io, table_path); |
| 1306 | |
| 1307 | // Append some data first |
| 1308 | commit |
| 1309 | .commit(vec![CommitMessage::new( |
| 1310 | vec![], |
| 1311 | 0, |
| 1312 | vec![test_data_file("data-0.parquet", 100)], |
| 1313 | )]) |
| 1314 | .await |
| 1315 | .unwrap(); |
| 1316 | |
| 1317 | // Truncate |
| 1318 | commit.truncate_table().await.unwrap(); |
| 1319 | |
| 1320 | let snap_manager = SnapshotManager::new(file_io.clone(), table_path.to_string()); |
| 1321 | let snapshot = snap_manager.get_latest_snapshot().await.unwrap().unwrap(); |
| 1322 | assert_eq!(snapshot.id(), 2); |
| 1323 | assert_eq!(snapshot.commit_kind(), &CommitKind::OVERWRITE); |
| 1324 | assert_eq!(snapshot.total_record_count(), Some(0)); |
| 1325 | assert_eq!(snapshot.delta_record_count(), Some(-100)); |
| 1326 | } |
| 1327 | |
| 1328 | #[tokio::test] |
| 1329 | async fn test_overwrite_partition() { |
nothing calls this directly
no test coverage detected