mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
FunctionsJSON avoid copying object element during iteration
This commit is contained in:
parent
746964af88
commit
04e07ed86d
@ -1001,7 +1001,7 @@ struct JSONExtractTree
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto [key, value] : object)
|
||||
for (auto & [key, value] : object)
|
||||
{
|
||||
auto index = name_to_index_map.find(key);
|
||||
if (index != name_to_index_map.end())
|
||||
@ -1164,7 +1164,7 @@ public:
|
||||
auto & col_key = assert_cast<ColumnString &>(col_tuple.getColumn(0));
|
||||
auto & col_value = col_tuple.getColumn(1);
|
||||
|
||||
for (auto [key, value] : object)
|
||||
for (auto & [key, value] : object)
|
||||
{
|
||||
if (extract_tree->insertResultToColumn(col_value, value))
|
||||
col_key.insertData(key.data(), key.size());
|
||||
@ -1343,7 +1343,7 @@ public:
|
||||
auto & col_key = assert_cast<ColumnString &>(col_tuple.getColumn(0));
|
||||
auto & col_value = assert_cast<ColumnString &>(col_tuple.getColumn(1));
|
||||
|
||||
for (auto [key, value] : object)
|
||||
for (auto & [key, value] : object)
|
||||
{
|
||||
col_key.insertData(key.data(), key.size());
|
||||
JSONExtractRawImpl<JSONParser>::insertResultToColumn(col_value, value, {});
|
||||
|
Loading…
Reference in New Issue
Block a user