Skip to content

Commit

Permalink
minor update style for file_writer.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
mapleFU committed Mar 17, 2024
1 parent a779982 commit 658b567
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
6 changes: 3 additions & 3 deletions cpp/src/parquet/arrow/arrow_reader_writer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5836,11 +5836,11 @@ TEST_F(ParquetBloomFilterRoundTripTest, SimpleRoundTripDictionary) {
->build();
std::vector<std::string> contents = {R"([
[1, "a"],
[2, "a"],
[1, "c"],
[2, "b"],
[3, "c"],
[null, "d"],
[5, null],
[6, "d"]
[6, "f"]
])"};
auto table = ::arrow::TableFromJSON(schema, contents);
auto non_dict_table = ::arrow::TableFromJSON(origin_schema, contents);
Expand Down
19 changes: 7 additions & 12 deletions cpp/src/parquet/file_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,15 @@ class RowGroupSerializer : public RowGroupWriter::Contents {
? bloom_filter_builder_->GetOrCreateBloomFilter(column_ordinal)
: nullptr;

std::unique_ptr<PageWriter> pager;
CodecOptions default_codec_options;
if (!codec_options) {
pager = PageWriter::Open(
sink_, column_properties.compression(), col_meta, row_group_ordinal_,
static_cast<int16_t>(column_ordinal), properties_->memory_pool(),
/*buffered_row_group=*/false, meta_encryptor, data_encryptor,
properties_->page_checksum_enabled(), ci_builder, oi_builder, CodecOptions());
} else {
pager = PageWriter::Open(
sink_, column_properties.compression(), col_meta, row_group_ordinal_,
static_cast<int16_t>(column_ordinal), properties_->memory_pool(),
/*buffered_row_group=*/false, meta_encryptor, data_encryptor,
properties_->page_checksum_enabled(), ci_builder, oi_builder, *codec_options);
codec_options = &default_codec_options;
}
std::unique_ptr<PageWriter> pager = PageWriter::Open(
sink_, column_properties.compression(), col_meta, row_group_ordinal_,
static_cast<int16_t>(column_ordinal), properties_->memory_pool(),
/*buffered_row_group=*/false, meta_encryptor, data_encryptor,
properties_->page_checksum_enabled(), ci_builder, oi_builder, *codec_options);
column_writers_[0] =
ColumnWriter::Make(col_meta, std::move(pager), properties_, bloom_filter);
return column_writers_[0].get();
Expand Down

0 comments on commit 658b567

Please sign in to comment.