()
| 1081 | |
| 1082 | #[tokio::test] |
| 1083 | async fn test_write_multiple_batches() { |
| 1084 | let file_io = test_file_io(); |
| 1085 | let table_path = "memory:/test_table_write_multi"; |
| 1086 | setup_dirs(&file_io, table_path).await; |
| 1087 | |
| 1088 | let table = test_table(&file_io, table_path); |
| 1089 | let mut table_write = TableWrite::new(&table, "test-user".to_string()).unwrap(); |
| 1090 | |
| 1091 | table_write |
| 1092 | .write_arrow_batch(&make_batch(vec![1, 2], vec![10, 20])) |
| 1093 | .await |
| 1094 | .unwrap(); |
| 1095 | table_write |
| 1096 | .write_arrow_batch(&make_batch(vec![3, 4], vec![30, 40])) |
| 1097 | .await |
| 1098 | .unwrap(); |
| 1099 | |
| 1100 | let messages = table_write.prepare_commit().await.unwrap(); |
| 1101 | assert_eq!(messages.len(), 1); |
| 1102 | // Multiple batches accumulate into a single file |
| 1103 | assert_eq!(messages[0].new_files.len(), 1); |
| 1104 | |
| 1105 | let total_rows: i64 = messages[0].new_files.iter().map(|f| f.row_count).sum(); |
| 1106 | assert_eq!(total_rows, 4); |
| 1107 | } |
| 1108 | |
| 1109 | fn test_bucketed_schema() -> TableSchema { |
| 1110 | let schema = Schema::builder() |
nothing calls this directly
no test coverage detected