@@ -80,7 +80,8 @@ ReaderProperties PARQUET_EXPORT default_reader_properties();
8080
8181static constexpr int64_t DEFAULT_PAGE_SIZE = 1024 * 1024 ;
8282static constexpr bool DEFAULT_IS_DICTIONARY_ENABLED = true ;
83- static constexpr int64_t DEFAULT_DICTIONARY_PAGE_SIZE = DEFAULT_PAGE_SIZE ;
83+ static constexpr int64_t DEFAULT_DICTIONARY_PAGE_SIZE_LIMIT = DEFAULT_PAGE_SIZE ;
84+ static constexpr int64_t DEFAULT_WRITE_BATCH_SIZE = 1024 ;
8485static constexpr Encoding::type DEFAULT_ENCODING = Encoding::PLAIN ;
8586static constexpr ParquetVersion::type DEFAULT_WRITER_VERSION =
8687 ParquetVersion::PARQUET_1_0 ;
@@ -96,7 +97,8 @@ class PARQUET_EXPORT WriterProperties {
9697 Builder ()
9798 : allocator_(default_allocator()),
9899 dictionary_enabled_default_ (DEFAULT_IS_DICTIONARY_ENABLED ),
99- dictionary_pagesize_(DEFAULT_DICTIONARY_PAGE_SIZE ),
100+ dictionary_pagesize_limit_(DEFAULT_DICTIONARY_PAGE_SIZE_LIMIT ),
101+ write_batch_size_(DEFAULT_WRITE_BATCH_SIZE ),
100102 pagesize_(DEFAULT_PAGE_SIZE ),
101103 version_(DEFAULT_WRITER_VERSION ),
102104 created_by_(DEFAULT_CREATED_BY ),
@@ -137,8 +139,13 @@ class PARQUET_EXPORT WriterProperties {
137139 return this ->enable_dictionary (path->ToDotString ());
138140 }
139141
140- Builder* dictionary_pagesize (int64_t dictionary_psize) {
141- dictionary_pagesize_ = dictionary_psize;
142+ Builder* dictionary_pagesize_limit (int64_t dictionary_psize_limit) {
143+ dictionary_pagesize_limit_ = dictionary_psize_limit;
144+ return this ;
145+ }
146+
147+ Builder* write_batch_size (int64_t write_batch_size) {
148+ write_batch_size_ = write_batch_size;
142149 return this ;
143150 }
144151
@@ -214,17 +221,18 @@ class PARQUET_EXPORT WriterProperties {
214221 }
215222
216223 std::shared_ptr<WriterProperties> build () {
217- return std::shared_ptr<WriterProperties>(
218- new WriterProperties (allocator_, dictionary_enabled_default_ ,
219- dictionary_enabled_, dictionary_pagesize_, pagesize_, version_, created_by_,
220- default_encoding_, encodings_, default_codec_, codecs_));
224+ return std::shared_ptr<WriterProperties>(new WriterProperties (allocator_,
225+ dictionary_enabled_default_, dictionary_enabled_, dictionary_pagesize_limit_ ,
226+ write_batch_size_, pagesize_, version_, created_by_, default_encoding_ ,
227+ encodings_, default_codec_, codecs_));
221228 }
222229
223230 private:
224231 MemoryAllocator* allocator_;
225232 bool dictionary_enabled_default_;
226233 std::unordered_map<std::string, bool > dictionary_enabled_;
227- int64_t dictionary_pagesize_;
234+ int64_t dictionary_pagesize_limit_;
235+ int64_t write_batch_size_;
228236 int64_t pagesize_;
229237 ParquetVersion::type version_;
230238 std::string created_by_;
@@ -246,7 +254,9 @@ class PARQUET_EXPORT WriterProperties {
246254 return dictionary_enabled_default_;
247255 }
248256
249- inline int64_t dictionary_pagesize () const { return dictionary_pagesize_; }
257+ inline int64_t dictionary_pagesize_limit () const { return dictionary_pagesize_limit_; }
258+
259+ inline int64_t write_batch_size () const { return write_batch_size_; }
250260
251261 inline int64_t data_pagesize () const { return pagesize_; }
252262
@@ -286,14 +296,16 @@ class PARQUET_EXPORT WriterProperties {
286296 private:
287297 explicit WriterProperties (MemoryAllocator* allocator, bool dictionary_enabled_default,
288298 std::unordered_map<std::string, bool > dictionary_enabled,
289- int64_t dictionary_pagesize, int64_t pagesize, ParquetVersion::type version,
290- const std::string& created_by, Encoding::type default_encoding,
299+ int64_t dictionary_pagesize, int64_t write_batch_size, int64_t pagesize,
300+ ParquetVersion::type version, const std::string& created_by,
301+ Encoding::type default_encoding,
291302 std::unordered_map<std::string, Encoding::type> encodings,
292303 Compression::type default_codec, const ColumnCodecs& codecs)
293304 : allocator_(allocator),
294305 dictionary_enabled_default_(dictionary_enabled_default),
295306 dictionary_enabled_(dictionary_enabled),
296- dictionary_pagesize_(dictionary_pagesize),
307+ dictionary_pagesize_limit_(dictionary_pagesize),
308+ write_batch_size_(write_batch_size),
297309 pagesize_(pagesize),
298310 parquet_version_(version),
299311 parquet_created_by_(created_by),
@@ -304,7 +316,8 @@ class PARQUET_EXPORT WriterProperties {
304316 MemoryAllocator* allocator_;
305317 bool dictionary_enabled_default_;
306318 std::unordered_map<std::string, bool > dictionary_enabled_;
307- int64_t dictionary_pagesize_;
319+ int64_t dictionary_pagesize_limit_;
320+ int64_t write_batch_size_;
308321 int64_t pagesize_;
309322 ParquetVersion::type parquet_version_;
310323 std::string parquet_created_by_;
0 commit comments