Skip to content

Commit

Permalink
Add test that has cdc and deletion vector operations
Browse files Browse the repository at this point in the history
  • Loading branch information
OussamaSaoudi-db committed Dec 13, 2024
1 parent d3871fc commit 7fed21a
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions kernel/tests/cdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,60 @@ fn cdf_non_partitioned() -> Result<(), Box<dyn error::Error>> {
assert_batches_sorted_eq!(expected, &batches);
Ok(())
}

#[test]
fn cdf_with_cdc_and_dvs() -> Result<(), Box<dyn error::Error>> {
let batches = read_cdf_for_table("cdf-table-with-cdc-and-dvs", 0, None)?;
let mut expected = vec![
"+----+--------------------+------------------+-----------------+",
"| id | comment | _change_type | _commit_version |",
"+----+--------------------+------------------+-----------------+",
"| 1 | initial | insert | 0 |",
"| 2 | insert1 | insert | 1 |",
"| 3 | insert1-delete1 | insert | 1 |",
"| 4 | insert1-delete2 | insert | 1 |",
"| 5 | insert1-delete2 | insert | 1 |",
"| 3 | insert1-delete1 | delete | 2 |",
"| 3 | insert1-delete1 | insert | 4 |",
"| 4 | insert1-delete2 | delete | 5 |",
"| 5 | insert1-delete2 | delete | 5 |",
"| 4 | insert1-delete2 | insert | 7 |",
"| 5 | insert2 | insert | 8 |",
"| 1 | initial | update_preimage | 9 |",
"| 1 | update1 | update_postimage | 9 |",
"| 2 | insert1 | update_preimage | 9 |",
"| 2 | update1 | update_postimage | 9 |",
"| 3 | insert1-delete1 | update_preimage | 9 |",
"| 3 | update1 | update_postimage | 9 |",
"| 1 | update1 | delete | 10 |",
"| 2 | update1 | update_preimage | 12 |",
"| 2 | update2 | update_postimage | 12 |",
"| 6 | insert3 | insert | 14 |",
"| 7 | insert3 | insert | 14 |",
"| 8 | insert4 | insert | 15 |",
"| 9 | insert4 | insert | 15 |",
"| 8 | insert4 | delete | 16 |",
"| 7 | insert3 | delete | 16 |",
"| 10 | merge1-insert | insert | 18 |",
"| 11 | merge1-insert | insert | 18 |",
"| 9 | merge1-update | update_postimage | 18 |",
"| 9 | insert4 | update_preimage | 18 |",
"| 11 | merge1-insert | update_preimage | 20 |",
"| 11 | | update_postimage | 20 |",
"| 12 | merge2-insert | insert | 22 |",
"| 11 | | delete | 22 |",
"| 3 | update1 | delete | 24 |",
"| 4 | insert1-delete2 | delete | 24 |",
"| 5 | insert2 | delete | 24 |",
"| 2 | update2 | delete | 24 |",
"| 6 | insert3 | delete | 24 |",
"| 9 | merge1-update | delete | 24 |",
"| 0 | new | insert | 25 |",
"| 1 | after-large-delete | insert | 25 |",
"| 2 | | insert | 25 |",
"+----+--------------------+------------------+-----------------+",
];
sort_lines!(expected);
assert_batches_sorted_eq!(expected, &batches);
Ok(())
}
Binary file not shown.

0 comments on commit 7fed21a

Please sign in to comment.