Skip to content

Commit dacba22

Browse files
committed
Fixed unit tests 3
1 parent 6710cfa commit dacba22

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

ydb/core/fq/libs/config/protos/row_dispatcher.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ message TRowDispatcherCoordinatorConfig {
1616

1717
message TJsonParserConfig {
1818
uint64 BatchSizeBytes = 1; // default 1 MiB
19-
uint64 BatchCreationTimeoutMs = 2; // default 1 second
19+
uint64 BatchCreationTimeoutMs = 2;
2020
uint64 StaticBufferSize = 3; // (number rows) * (number columns) limit, default 10^6
2121
}
2222

ydb/core/fq/libs/row_dispatcher/json_parser.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ TString LogPrefix = "JsonParser: ";
2121

2222
constexpr ui64 DEFAULT_BATCH_SIZE = 1_MB;
2323
constexpr ui64 DEFAULT_STATIC_BUFFER_SIZE = 1000000;
24-
constexpr TDuration DEFAULT_BATCH_CREATION_TIMEOUT = TDuration::Seconds(1);
2524

2625
struct TJsonParserBuffer {
2726
size_t NumberValues = 0;
@@ -275,7 +274,7 @@ class TJsonParser::TImpl {
275274
, TypeEnv(std::make_unique<NKikimr::NMiniKQL::TTypeEnvironment>(Alloc))
276275
, BatchSize(batchSize ? batchSize : DEFAULT_BATCH_SIZE)
277276
, MaxNumberRows(((staticBufferSize ? staticBufferSize : DEFAULT_STATIC_BUFFER_SIZE) - 1) / columns.size() + 1)
278-
, BatchCreationTimeout(batchCreationTimeout ? batchCreationTimeout : DEFAULT_BATCH_CREATION_TIMEOUT)
277+
, BatchCreationTimeout(batchCreationTimeout)
279278
, ParseCallback(parseCallback)
280279
, ParsedValues(columns.size())
281280
{
@@ -326,7 +325,7 @@ class TJsonParser::TImpl {
326325
Y_ENSURE(!Buffer.Finished, "Cannot add messages into finished buffer");
327326
for (const auto& message : messages) {
328327
Buffer.AddMessage(message);
329-
if (IsReady()) {
328+
if (Buffer.IsReady() && Buffer.GetSize() >= BatchSize) {
330329
Parse();
331330
}
332331
}

0 commit comments

Comments
 (0)