| 267 | class WriterPropertiesTest : public testing::TestWithParam<WriterPropertiesTestCase> {}; |
| 268 | |
| 269 | TEST_P(WriterPropertiesTest, RoundTripThroughBuilder) { |
| 270 | const std::shared_ptr<WriterProperties>& properties = GetParam().properties; |
| 271 | const std::vector<std::shared_ptr<ColumnPath>> columns{ |
| 272 | ColumnPath::FromDotString("a"), |
| 273 | ColumnPath::FromDotString("b"), |
| 274 | }; |
| 275 | |
| 276 | const auto round_tripped = WriterProperties::Builder(*properties).build(); |
| 277 | |
| 278 | ASSERT_EQ(round_tripped->content_defined_chunking_enabled(), |
| 279 | properties->content_defined_chunking_enabled()); |
| 280 | ASSERT_EQ(round_tripped->created_by(), properties->created_by()); |
| 281 | ASSERT_EQ(round_tripped->data_pagesize(), properties->data_pagesize()); |
| 282 | ASSERT_EQ(round_tripped->data_page_version(), properties->data_page_version()); |
| 283 | ASSERT_EQ(round_tripped->dictionary_index_encoding(), |
| 284 | properties->dictionary_index_encoding()); |
| 285 | ASSERT_EQ(round_tripped->dictionary_pagesize_limit(), |
| 286 | properties->dictionary_pagesize_limit()); |
| 287 | ASSERT_EQ(round_tripped->file_encryption_properties(), |
| 288 | properties->file_encryption_properties()); |
| 289 | ASSERT_EQ(round_tripped->max_rows_per_page(), properties->max_rows_per_page()); |
| 290 | ASSERT_EQ(round_tripped->max_row_group_length(), properties->max_row_group_length()); |
| 291 | ASSERT_EQ(round_tripped->memory_pool(), properties->memory_pool()); |
| 292 | ASSERT_EQ(round_tripped->page_checksum_enabled(), properties->page_checksum_enabled()); |
| 293 | ASSERT_EQ(round_tripped->size_statistics_level(), properties->size_statistics_level()); |
| 294 | ASSERT_EQ(round_tripped->sorting_columns(), properties->sorting_columns()); |
| 295 | ASSERT_EQ(round_tripped->store_decimal_as_integer(), |
| 296 | properties->store_decimal_as_integer()); |
| 297 | ASSERT_EQ(round_tripped->write_batch_size(), properties->write_batch_size()); |
| 298 | ASSERT_EQ(round_tripped->version(), properties->version()); |
| 299 | |
| 300 | const auto cdc_options = properties->content_defined_chunking_options(); |
| 301 | const auto round_tripped_cdc_options = |
| 302 | round_tripped->content_defined_chunking_options(); |
| 303 | ASSERT_EQ(round_tripped_cdc_options.min_chunk_size, cdc_options.min_chunk_size); |
| 304 | ASSERT_EQ(round_tripped_cdc_options.max_chunk_size, cdc_options.max_chunk_size); |
| 305 | ASSERT_EQ(round_tripped_cdc_options.norm_level, cdc_options.norm_level); |
| 306 | |
| 307 | for (const auto& column : columns) { |
| 308 | const auto& column_properties = properties->column_properties(column); |
| 309 | const auto& round_tripped_col = round_tripped->column_properties(column); |
| 310 | |
| 311 | ASSERT_EQ(round_tripped_col.compression(), column_properties.compression()); |
| 312 | ASSERT_EQ(round_tripped_col.compression_level(), |
| 313 | column_properties.compression_level()); |
| 314 | ASSERT_EQ(round_tripped_col.dictionary_enabled(), |
| 315 | column_properties.dictionary_enabled()); |
| 316 | ASSERT_EQ(round_tripped_col.encoding(), column_properties.encoding()); |
| 317 | ASSERT_EQ(round_tripped_col.max_statistics_size(), |
| 318 | column_properties.max_statistics_size()); |
| 319 | ASSERT_EQ(round_tripped_col.page_index_enabled(), |
| 320 | column_properties.page_index_enabled()); |
| 321 | ASSERT_EQ(round_tripped_col.statistics_enabled(), |
| 322 | column_properties.statistics_enabled()); |
| 323 | const auto round_tripped_bloom_filter_options = |
| 324 | round_tripped_col.bloom_filter_options(); |
| 325 | const auto bloom_filter_options = column_properties.bloom_filter_options(); |
| 326 | ASSERT_EQ(round_tripped_bloom_filter_options.has_value(), |
nothing calls this directly
no test coverage detected