File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ message TRowDispatcherCoordinatorConfig {
16
16
17
17
message TJsonParserConfig {
18
18
uint64 BatchSizeBytes = 1 ; // default 1 MiB
19
- uint64 BatchCreationTimeoutMs = 2 ; // default 1 second
19
+ uint64 BatchCreationTimeoutMs = 2 ;
20
20
uint64 StaticBufferSize = 3 ; // (number rows) * (number columns) limit, default 10^6
21
21
}
22
22
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ TString LogPrefix = "JsonParser: ";
21
21
22
22
constexpr ui64 DEFAULT_BATCH_SIZE = 1_MB;
23
23
constexpr ui64 DEFAULT_STATIC_BUFFER_SIZE = 1000000 ;
24
- constexpr TDuration DEFAULT_BATCH_CREATION_TIMEOUT = TDuration::Seconds(1 );
25
24
26
25
struct TJsonParserBuffer {
27
26
size_t NumberValues = 0 ;
@@ -275,7 +274,7 @@ class TJsonParser::TImpl {
275
274
, TypeEnv(std::make_unique<NKikimr::NMiniKQL::TTypeEnvironment>(Alloc))
276
275
, BatchSize(batchSize ? batchSize : DEFAULT_BATCH_SIZE)
277
276
, MaxNumberRows(((staticBufferSize ? staticBufferSize : DEFAULT_STATIC_BUFFER_SIZE) - 1 ) / columns.size() + 1 )
278
- , BatchCreationTimeout(batchCreationTimeout ? batchCreationTimeout : DEFAULT_BATCH_CREATION_TIMEOUT )
277
+ , BatchCreationTimeout(batchCreationTimeout)
279
278
, ParseCallback(parseCallback)
280
279
, ParsedValues(columns.size())
281
280
{
@@ -326,7 +325,7 @@ class TJsonParser::TImpl {
326
325
Y_ENSURE (!Buffer.Finished , " Cannot add messages into finished buffer" );
327
326
for (const auto & message : messages) {
328
327
Buffer.AddMessage (message);
329
- if (IsReady ()) {
328
+ if (Buffer. IsReady () && Buffer. GetSize () >= BatchSize ) {
330
329
Parse ();
331
330
}
332
331
}
You can’t perform that action at this time.
0 commit comments