| 1018 | std::shared_ptr<Table> part1_, part2_, part3_, part4_, part5_, part6_, part7_; |
| 1019 | |
| 1020 | void SetUp() override { |
| 1021 | const auto& param = GetParam(); |
| 1022 | auto field_ = ::arrow::field("f0", param.dtype, param.is_nullable); |
| 1023 | auto schema = ::arrow::schema({field_}); |
| 1024 | |
| 1025 | // since the chunk sizes are constant we derive the number of records to generate |
| 1026 | // from the size of the data type unless it is nested or variable length where |
| 1027 | // we use a hand picked value to avoid generating too large tables |
| 1028 | int64_t bytes_per_record; |
| 1029 | if (param.dtype->byte_width() > 0) { |
| 1030 | bytes_per_record = param.dtype->byte_width(); |
| 1031 | if (param.is_nullable) { |
| 1032 | bytes_per_record += sizeof(uint16_t); |
| 1033 | } |
| 1034 | } else { |
| 1035 | // for variable length types we use the size of the first element |
| 1036 | bytes_per_record = 16; |
| 1037 | } |
| 1038 | |
| 1039 | auto part_length = kPartSize / bytes_per_record; |
| 1040 | auto edit_length = kEditSize / bytes_per_record; |
| 1041 | |
| 1042 | ASSERT_OK_AND_ASSIGN(part1_, GenerateTable(schema, part_length, /*seed=*/0)); |
| 1043 | ASSERT_OK_AND_ASSIGN(part2_, GenerateTable(schema, edit_length, /*seed=*/1)); |
| 1044 | ASSERT_OK_AND_ASSIGN(part3_, |
| 1045 | GenerateTable(schema, part_length, /*seed=*/part_length)); |
| 1046 | ASSERT_OK_AND_ASSIGN(part4_, GenerateTable(schema, edit_length, /*seed=*/2)); |
| 1047 | ASSERT_OK_AND_ASSIGN(part5_, |
| 1048 | GenerateTable(schema, part_length, /*seed=*/2 * part_length)); |
| 1049 | ASSERT_OK_AND_ASSIGN(part6_, GenerateTable(schema, edit_length, /*seed=*/3)); |
| 1050 | ASSERT_OK_AND_ASSIGN(part7_, GenerateTable(schema, edit_length, /*seed=*/4)); |
| 1051 | } |
| 1052 | }; |
| 1053 | |
| 1054 | TEST_P(TestCDCSingleRowGroup, DeleteOnce) { |
nothing calls this directly
no test coverage detected