File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
ydb/core/fq/libs/row_dispatcher Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -328,9 +328,13 @@ class TJsonParser::TImpl {
328
328
with_lock (Alloc) {
329
329
ClearColumns (Buffer.NumberValues );
330
330
331
+ const ui64 firstOffset = Buffer.Offsets .front ();
331
332
size_t rowId = 0 ;
332
333
simdjson::ondemand::document_stream documents = Parser.iterate_many (values, size, simdjson::ondemand::DEFAULT_BATCH_SIZE);
333
334
for (auto document : documents) {
335
+ if (Y_UNLIKELY (rowId >= Buffer.NumberValues )) {
336
+ throw yexception () << " Failed to parse json messages, expected " << Buffer.NumberValues << " json rows from offset " << firstOffset << " but got " << rowId;
337
+ }
334
338
for (auto item : document.get_object ()) {
335
339
const auto it = ColumnsIndex.find (item.escaped_key ().value ());
336
340
if (it == ColumnsIndex.end ()) {
@@ -348,7 +352,6 @@ class TJsonParser::TImpl {
348
352
rowId++;
349
353
}
350
354
351
- const ui64 firstOffset = Buffer.Offsets .front ();
352
355
if (rowId != Buffer.NumberValues ) {
353
356
throw yexception () << " Failed to parse json messages, expected " << Buffer.NumberValues << " json rows from offset " << firstOffset << " but got " << rowId;
354
357
}
You can’t perform that action at this time.
0 commit comments