@@ -40,6 +40,8 @@ public class OrcWriterOptions
40
40
public static final DataSize DEFAULT_DICTIONARY_USEFUL_CHECK_COLUMN_SIZE = new DataSize (6 , MEGABYTE );
41
41
public static final DataSize DEFAULT_MAX_STRING_STATISTICS_LIMIT = new DataSize (64 , BYTE );
42
42
public static final DataSize DEFAULT_MAX_COMPRESSION_BUFFER_SIZE = new DataSize (256 , KILOBYTE );
43
+ public static final DataSize DEFAULT_MIN_OUTPUT_BUFFER_CHUNK_SIZE = new DataSize (8 , KILOBYTE );
44
+ public static final DataSize DEFAULT_MAX_OUTPUT_BUFFER_CHUNK_SIZE = new DataSize (1024 , KILOBYTE );
43
45
public static final DataSize DEFAULT_DWRF_STRIPE_CACHE_MAX_SIZE = new DataSize (8 , MEGABYTE );
44
46
public static final DwrfStripeCacheMode DEFAULT_DWRF_STRIPE_CACHE_MODE = INDEX_AND_FOOTER ;
45
47
public static final int DEFAULT_PRESERVE_DIRECT_ENCODING_STRIPE_COUNT = 0 ;
@@ -56,6 +58,8 @@ public class OrcWriterOptions
56
58
private final DataSize dictionaryUsefulCheckColumnSize ;
57
59
private final DataSize maxStringStatisticsLimit ;
58
60
private final DataSize maxCompressionBufferSize ;
61
+ private final DataSize minOutputBufferChunkSize ;
62
+ private final DataSize maxOutputBufferChunkSize ;
59
63
private final OptionalInt compressionLevel ;
60
64
private final StreamLayoutFactory streamLayoutFactory ;
61
65
private final boolean integerDictionaryEncodingEnabled ;
@@ -85,6 +89,8 @@ private OrcWriterOptions(
85
89
DataSize dictionaryUsefulCheckColumnSize ,
86
90
DataSize maxStringStatisticsLimit ,
87
91
DataSize maxCompressionBufferSize ,
92
+ DataSize minOutputBufferChunkSize ,
93
+ DataSize maxOutputBufferChunkSize ,
88
94
OptionalInt compressionLevel ,
89
95
StreamLayoutFactory streamLayoutFactory ,
90
96
boolean integerDictionaryEncodingEnabled ,
@@ -104,6 +110,8 @@ private OrcWriterOptions(
104
110
requireNonNull (dictionaryUsefulCheckColumnSize , "dictionaryUsefulCheckColumnSize is null" );
105
111
requireNonNull (maxStringStatisticsLimit , "maxStringStatisticsLimit is null" );
106
112
requireNonNull (maxCompressionBufferSize , "maxCompressionBufferSize is null" );
113
+ requireNonNull (minOutputBufferChunkSize , "minOutputBufferChunkSize is null" );
114
+ requireNonNull (maxOutputBufferChunkSize , "maxOutputBufferChunkSize is null" );
107
115
requireNonNull (compressionLevel , "compressionLevel is null" );
108
116
requireNonNull (streamLayoutFactory , "streamLayoutFactory is null" );
109
117
requireNonNull (dwrfWriterOptions , "dwrfWriterOptions is null" );
@@ -118,6 +126,8 @@ private OrcWriterOptions(
118
126
this .dictionaryUsefulCheckColumnSize = dictionaryUsefulCheckColumnSize ;
119
127
this .maxStringStatisticsLimit = maxStringStatisticsLimit ;
120
128
this .maxCompressionBufferSize = maxCompressionBufferSize ;
129
+ this .minOutputBufferChunkSize = minOutputBufferChunkSize ;
130
+ this .maxOutputBufferChunkSize = maxOutputBufferChunkSize ;
121
131
this .compressionLevel = compressionLevel ;
122
132
this .streamLayoutFactory = streamLayoutFactory ;
123
133
this .integerDictionaryEncodingEnabled = integerDictionaryEncodingEnabled ;
@@ -171,6 +181,16 @@ public DataSize getMaxCompressionBufferSize()
171
181
return maxCompressionBufferSize ;
172
182
}
173
183
184
+ public DataSize getMinOutputBufferChunkSize ()
185
+ {
186
+ return minOutputBufferChunkSize ;
187
+ }
188
+
189
+ public DataSize getMaxOutputBufferChunkSize ()
190
+ {
191
+ return maxOutputBufferChunkSize ;
192
+ }
193
+
174
194
public OptionalInt getCompressionLevel ()
175
195
{
176
196
return compressionLevel ;
@@ -272,6 +292,8 @@ public static class Builder
272
292
private DataSize dictionaryUsefulCheckColumnSize = DEFAULT_DICTIONARY_USEFUL_CHECK_COLUMN_SIZE ;
273
293
private DataSize maxStringStatisticsLimit = DEFAULT_MAX_STRING_STATISTICS_LIMIT ;
274
294
private DataSize maxCompressionBufferSize = DEFAULT_MAX_COMPRESSION_BUFFER_SIZE ;
295
+ private DataSize minOutputBufferChunkSize = DEFAULT_MIN_OUTPUT_BUFFER_CHUNK_SIZE ;
296
+ private DataSize maxOutputBufferChunkSize = DEFAULT_MAX_OUTPUT_BUFFER_CHUNK_SIZE ;
275
297
private OptionalInt compressionLevel = OptionalInt .empty ();
276
298
private StreamLayoutFactory streamLayoutFactory = new ColumnSizeLayoutFactory ();
277
299
private boolean integerDictionaryEncodingEnabled = DEFAULT_INTEGER_DICTIONARY_ENCODING_ENABLED ;
@@ -336,6 +358,18 @@ public Builder withMaxCompressionBufferSize(DataSize maxCompressionBufferSize)
336
358
return this ;
337
359
}
338
360
361
+ public Builder withMinOutputBufferChunkSize (DataSize minOutputBufferChunkSize )
362
+ {
363
+ this .minOutputBufferChunkSize = requireNonNull (minOutputBufferChunkSize , "minOutputBufferChunkSize is null" );
364
+ return this ;
365
+ }
366
+
367
+ public Builder withMaxOutputBufferChunkSize (DataSize maxOutputBufferChunkSize )
368
+ {
369
+ this .maxOutputBufferChunkSize = requireNonNull (maxOutputBufferChunkSize , "maxOutputBufferChunkSize is null" );
370
+ return this ;
371
+ }
372
+
339
373
public Builder withCompressionLevel (OptionalInt compressionLevel )
340
374
{
341
375
this .compressionLevel = requireNonNull (compressionLevel , "compressionLevel is null" );
@@ -433,6 +467,8 @@ public OrcWriterOptions build()
433
467
dictionaryUsefulCheckColumnSize ,
434
468
maxStringStatisticsLimit ,
435
469
maxCompressionBufferSize ,
470
+ minOutputBufferChunkSize ,
471
+ maxOutputBufferChunkSize ,
436
472
compressionLevel ,
437
473
streamLayoutFactory ,
438
474
integerDictionaryEncodingEnabled ,
0 commit comments