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

Function TEST_P

cpp/src/parquet/properties_test.cc:168–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166class WriterPropertiesTest : public testing::TestWithParam<WriterPropertiesTestCase> {};
167
168TEST_P(WriterPropertiesTest, RoundTripThroughBuilder) {
169 const std::shared_ptr<WriterProperties>& properties = GetParam().properties;
170 const std::vector<std::shared_ptr<ColumnPath>> columns{
171 ColumnPath::FromDotString("a"),
172 ColumnPath::FromDotString("b"),
173 };
174
175 const auto round_tripped = WriterProperties::Builder(*properties).build();
176
177 ASSERT_EQ(round_tripped->content_defined_chunking_enabled(),
178 properties->content_defined_chunking_enabled());
179 ASSERT_EQ(round_tripped->created_by(), properties->created_by());
180 ASSERT_EQ(round_tripped->data_pagesize(), properties->data_pagesize());
181 ASSERT_EQ(round_tripped->data_page_version(), properties->data_page_version());
182 ASSERT_EQ(round_tripped->dictionary_index_encoding(),
183 properties->dictionary_index_encoding());
184 ASSERT_EQ(round_tripped->dictionary_pagesize_limit(),
185 properties->dictionary_pagesize_limit());
186 ASSERT_EQ(round_tripped->file_encryption_properties(),
187 properties->file_encryption_properties());
188 ASSERT_EQ(round_tripped->max_rows_per_page(), properties->max_rows_per_page());
189 ASSERT_EQ(round_tripped->max_row_group_length(), properties->max_row_group_length());
190 ASSERT_EQ(round_tripped->memory_pool(), properties->memory_pool());
191 ASSERT_EQ(round_tripped->page_checksum_enabled(), properties->page_checksum_enabled());
192 ASSERT_EQ(round_tripped->size_statistics_level(), properties->size_statistics_level());
193 ASSERT_EQ(round_tripped->sorting_columns(), properties->sorting_columns());
194 ASSERT_EQ(round_tripped->store_decimal_as_integer(),
195 properties->store_decimal_as_integer());
196 ASSERT_EQ(round_tripped->write_batch_size(), properties->write_batch_size());
197 ASSERT_EQ(round_tripped->version(), properties->version());
198
199 const auto cdc_options = properties->content_defined_chunking_options();
200 const auto round_tripped_cdc_options =
201 round_tripped->content_defined_chunking_options();
202 ASSERT_EQ(round_tripped_cdc_options.min_chunk_size, cdc_options.min_chunk_size);
203 ASSERT_EQ(round_tripped_cdc_options.max_chunk_size, cdc_options.max_chunk_size);
204 ASSERT_EQ(round_tripped_cdc_options.norm_level, cdc_options.norm_level);
205
206 for (const auto& column : columns) {
207 const auto& column_properties = properties->column_properties(column);
208 const auto& round_tripped_col = round_tripped->column_properties(column);
209
210 ASSERT_EQ(round_tripped_col.compression(), column_properties.compression());
211 ASSERT_EQ(round_tripped_col.compression_level(),
212 column_properties.compression_level());
213 ASSERT_EQ(round_tripped_col.dictionary_enabled(),
214 column_properties.dictionary_enabled());
215 ASSERT_EQ(round_tripped_col.encoding(), column_properties.encoding());
216 ASSERT_EQ(round_tripped_col.max_statistics_size(),
217 column_properties.max_statistics_size());
218 ASSERT_EQ(round_tripped_col.page_index_enabled(),
219 column_properties.page_index_enabled());
220 ASSERT_EQ(round_tripped_col.statistics_enabled(),
221 column_properties.statistics_enabled());
222 }
223}
224
225std::vector<WriterPropertiesTestCase> writer_properties_test_cases() {

Callers

nothing calls this directly

Calls 8

BuilderFunction · 0.70
buildMethod · 0.45
memory_poolMethod · 0.45
sorting_columnsMethod · 0.45
versionMethod · 0.45
compressionMethod · 0.45
compression_levelMethod · 0.45
encodingMethod · 0.45

Tested by

no test coverage detected