This commit is contained in:
lgbo-ustc 2024-04-07 08:59:43 +08:00
parent cbedf8c5d2
commit 416b8fbb63

View File

@ -162,6 +162,12 @@ void JSONEachRowRowInputFormat::readJSONObject(MutableColumns & columns)
for (size_t key_index = 0; advanceToNextKey(key_index); ++key_index)
{
StringRef name_ref = readColumnName(*in);
if (seen_columns_count >= total_columns)
{
JSONUtils::skipColon(*in);
skipUnknownField(name_ref);
continue;
}
const size_t column_index = columnIndex(name_ref, key_index);
if (unlikely(ssize_t(column_index) < 0))
@ -187,11 +193,6 @@ void JSONEachRowRowInputFormat::readJSONObject(MutableColumns & columns)
JSONUtils::skipColon(*in);
readField(column_index, columns);
}
if (seen_columns_count >= total_columns)
{
skipToUnescapedNextLineOrEOF(*in);
break;
}
}
}