MCPcopy Create free account
hub / github.com/apache/arrow / SetUp

Method SetUp

cpp/src/parquet/chunker_internal_test.cc:1044–1075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1042 std::shared_ptr<Table> part1_, part2_, part3_, part4_, part5_, part6_, part7_;
1043
1044 void SetUp() override {
1045 const auto& param = GetParam();
1046 auto field_ = ::arrow::field("f0", param.dtype, param.is_nullable);
1047 auto schema = ::arrow::schema({field_});
1048
1049 // since the chunk sizes are constant we derive the number of records to generate
1050 // from the size of the data type unless it is nested or variable length where
1051 // we use a hand picked value to avoid generating too large tables
1052 int64_t bytes_per_record;
1053 if (param.dtype->byte_width() > 0) {
1054 bytes_per_record = param.dtype->byte_width();
1055 if (param.is_nullable) {
1056 bytes_per_record += sizeof(uint16_t);
1057 }
1058 } else {
1059 // for variable length types we use the size of the first element
1060 bytes_per_record = 16;
1061 }
1062
1063 auto part_length = kPartSize / bytes_per_record;
1064 auto edit_length = kEditSize / bytes_per_record;
1065
1066 ASSERT_OK_AND_ASSIGN(part1_, GenerateTable(schema, part_length, /*seed=*/0));
1067 ASSERT_OK_AND_ASSIGN(part2_, GenerateTable(schema, edit_length, /*seed=*/1));
1068 ASSERT_OK_AND_ASSIGN(part3_,
1069 GenerateTable(schema, part_length, /*seed=*/part_length));
1070 ASSERT_OK_AND_ASSIGN(part4_, GenerateTable(schema, edit_length, /*seed=*/2));
1071 ASSERT_OK_AND_ASSIGN(part5_,
1072 GenerateTable(schema, part_length, /*seed=*/2 * part_length));
1073 ASSERT_OK_AND_ASSIGN(part6_, GenerateTable(schema, edit_length, /*seed=*/3));
1074 ASSERT_OK_AND_ASSIGN(part7_, GenerateTable(schema, edit_length, /*seed=*/4));
1075 }
1076};
1077
1078TEST_P(TestCDCSingleRowGroup, DeleteOnce) {

Callers

nothing calls this directly

Calls 5

ASSERT_OK_AND_ASSIGNFunction · 0.70
GenerateTableFunction · 0.70
fieldFunction · 0.50
schemaFunction · 0.50
byte_widthMethod · 0.45

Tested by

no test coverage detected