| 1052 | }; |
| 1053 | |
| 1054 | TEST_P(TestCDCSingleRowGroup, DeleteOnce) { |
| 1055 | const auto& param = GetParam(); |
| 1056 | |
| 1057 | ASSERT_OK_AND_ASSIGN(auto base, ConcatAndCombine({part1_, part2_, part3_})); |
| 1058 | ASSERT_OK_AND_ASSIGN(auto modified, ConcatAndCombine({part1_, part3_})); |
| 1059 | ASSERT_FALSE(base->Equals(*modified)); |
| 1060 | |
| 1061 | for (bool enable_dictionary : {false, true}) { |
| 1062 | ASSERT_OK_AND_ASSIGN( |
| 1063 | auto base_parquet, |
| 1064 | WriteTableToBuffer(base, kMinChunkSize, kMaxChunkSize, kRowGroupLength, |
| 1065 | enable_dictionary, param.data_page_version)); |
| 1066 | ASSERT_OK_AND_ASSIGN( |
| 1067 | auto modified_parquet, |
| 1068 | WriteTableToBuffer(modified, kMinChunkSize, kMaxChunkSize, kRowGroupLength, |
| 1069 | enable_dictionary, param.data_page_version)); |
| 1070 | |
| 1071 | auto base_info = GetColumnParquetInfo(base_parquet, /*column_index=*/0); |
| 1072 | auto modified_info = GetColumnParquetInfo(modified_parquet, /*column_index=*/0); |
| 1073 | |
| 1074 | // assert that there is only one row group |
| 1075 | ASSERT_EQ(base_info.size(), 1); |
| 1076 | ASSERT_EQ(modified_info.size(), 1); |
| 1077 | |
| 1078 | // check that the chunk sizes are within the expected range |
| 1079 | AssertContentDefinedChunkSizes(base->column(0), base_info.front(), param.is_nullable, |
| 1080 | kMinChunkSize, kMaxChunkSize, |
| 1081 | /*expect_dictionary_page=*/enable_dictionary); |
| 1082 | AssertContentDefinedChunkSizes(modified->column(0), modified_info.front(), |
| 1083 | param.is_nullable, kMinChunkSize, kMaxChunkSize, |
| 1084 | /*expect_dictionary_page=*/enable_dictionary); |
| 1085 | |
| 1086 | // check that there is a single "diff" between the two page length sequences |
| 1087 | // and that the diff removes edit_length number of values, there should be no |
| 1088 | // other differences because we deal with a single row group (in case of multiple |
| 1089 | // row groups the first page of each subsequent row group would be different due |
| 1090 | // to shifting caused by the fixed sized row group length) |
| 1091 | AssertPageLengthDifferences(base_info.front(), modified_info.front(), |
| 1092 | /*exact_number_of_equal_diffs=*/0, |
| 1093 | /*exact_number_of_larger_diffs=*/0, |
| 1094 | /*exact_number_of_smaller_diffs=*/1, part2_->column(0)); |
| 1095 | } |
| 1096 | } |
| 1097 | |
| 1098 | TEST_P(TestCDCSingleRowGroup, DeleteTwice) { |
| 1099 | const auto& param = GetParam(); |
nothing calls this directly
no test coverage detected