mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Revert changes where they were not correct
This commit is contained in:
parent
35127dcc8d
commit
04b2f085bf
@ -533,7 +533,7 @@ void ColumnArray::insertRangeFrom(const IColumn & src, size_t start, size_t leng
|
|||||||
|
|
||||||
Offsets & cur_offsets = getOffsets();
|
Offsets & cur_offsets = getOffsets();
|
||||||
/// Reserve offsets before to make it more exception safe (in case of MEMORY_LIMIT_EXCEEDED)
|
/// Reserve offsets before to make it more exception safe (in case of MEMORY_LIMIT_EXCEEDED)
|
||||||
cur_offsets.reserve_exact(cur_offsets.size() + length);
|
cur_offsets.reserve(cur_offsets.size() + length);
|
||||||
|
|
||||||
getData().insertRangeFrom(src_concrete.getData(), nested_offset, nested_length);
|
getData().insertRangeFrom(src_concrete.getData(), nested_offset, nested_length);
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ void ColumnSparse::insertRangeFrom(const IColumn & src, size_t start, size_t len
|
|||||||
|
|
||||||
if (offset_start != offset_end)
|
if (offset_start != offset_end)
|
||||||
{
|
{
|
||||||
offsets_data.reserve_exact(offsets_data.size() + offset_end - offset_start);
|
offsets_data.reserve(offsets_data.size() + offset_end - offset_start);
|
||||||
insertManyDefaults(src_offsets[offset_start] - start);
|
insertManyDefaults(src_offsets[offset_start] - start);
|
||||||
offsets_data.push_back(_size);
|
offsets_data.push_back(_size);
|
||||||
++_size;
|
++_size;
|
||||||
|
@ -122,7 +122,7 @@ void ColumnString::insertRangeFrom(const IColumn & src, size_t start, size_t len
|
|||||||
size_t nested_length = src_concrete.offsets[start + length - 1] - nested_offset;
|
size_t nested_length = src_concrete.offsets[start + length - 1] - nested_offset;
|
||||||
|
|
||||||
/// Reserve offsets before to make it more exception safe (in case of MEMORY_LIMIT_EXCEEDED)
|
/// Reserve offsets before to make it more exception safe (in case of MEMORY_LIMIT_EXCEEDED)
|
||||||
offsets.reserve_exact(offsets.size() + length);
|
offsets.reserve(offsets.size() + length);
|
||||||
|
|
||||||
size_t old_chars_size = chars.size();
|
size_t old_chars_size = chars.size();
|
||||||
chars.resize(old_chars_size + nested_length);
|
chars.resize(old_chars_size + nested_length);
|
||||||
|
@ -493,7 +493,7 @@ void ColumnVariant::insertRangeFrom(const IColumn & src_, size_t start, size_t l
|
|||||||
variants[local_discr]->insertRangeFrom(*src.variants[*non_empty_src_local_discr], start, length);
|
variants[local_discr]->insertRangeFrom(*src.variants[*non_empty_src_local_discr], start, length);
|
||||||
getLocalDiscriminators().resize_fill(local_discriminators->size() + length, local_discr);
|
getLocalDiscriminators().resize_fill(local_discriminators->size() + length, local_discr);
|
||||||
auto & offsets_data = getOffsets();
|
auto & offsets_data = getOffsets();
|
||||||
offsets_data.reserve_exact(offsets_data.size() + length);
|
offsets_data.reserve(offsets_data.size() + length);
|
||||||
for (size_t i = 0; i != length; ++i)
|
for (size_t i = 0; i != length; ++i)
|
||||||
offsets_data.push_back(offset++);
|
offsets_data.push_back(offset++);
|
||||||
return;
|
return;
|
||||||
@ -505,9 +505,9 @@ void ColumnVariant::insertRangeFrom(const IColumn & src_, size_t start, size_t l
|
|||||||
/// nested_ranges[i].second - length in src.variants[i]
|
/// nested_ranges[i].second - length in src.variants[i]
|
||||||
std::vector<std::pair<size_t, size_t>> nested_ranges(num_variants, {0, 0});
|
std::vector<std::pair<size_t, size_t>> nested_ranges(num_variants, {0, 0});
|
||||||
auto & offsets_data = getOffsets();
|
auto & offsets_data = getOffsets();
|
||||||
offsets_data.reserve_exact(offsets_data.size() + length);
|
offsets_data.reserve(offsets_data.size() + length);
|
||||||
auto & local_discriminators_data = getLocalDiscriminators();
|
auto & local_discriminators_data = getLocalDiscriminators();
|
||||||
local_discriminators_data.reserve_exact(local_discriminators_data.size() + length);
|
local_discriminators_data.reserve(local_discriminators_data.size() + length);
|
||||||
const auto & src_offsets_data = src.getOffsets();
|
const auto & src_offsets_data = src.getOffsets();
|
||||||
const auto & src_local_discriminators_data = src.getLocalDiscriminators();
|
const auto & src_local_discriminators_data = src.getLocalDiscriminators();
|
||||||
for (size_t i = start; i != start + length; ++i)
|
for (size_t i = start; i != start + length; ++i)
|
||||||
@ -561,7 +561,7 @@ void ColumnVariant::insertManyFrom(const DB::IColumn & src_, size_t position, si
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
size_t prev_offset = variants[local_discr]->size();
|
size_t prev_offset = variants[local_discr]->size();
|
||||||
offsets_data.reserve_exact(offsets_data.size() + length);
|
offsets_data.reserve(offsets_data.size() + length);
|
||||||
for (size_t i = 0; i != length; ++i)
|
for (size_t i = 0; i != length; ++i)
|
||||||
offsets_data.push_back(prev_offset + i);
|
offsets_data.push_back(prev_offset + i);
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ void SerializationAggregateFunction::deserializeBinaryBulk(IColumn & column, Rea
|
|||||||
|
|
||||||
Arena & arena = real_column.createOrGetArena();
|
Arena & arena = real_column.createOrGetArena();
|
||||||
real_column.set(function, version);
|
real_column.set(function, version);
|
||||||
vec.reserve_exact(vec.size() + limit);
|
vec.reserve(vec.size() + limit);
|
||||||
|
|
||||||
size_t size_of_state = function->sizeOfData();
|
size_t size_of_state = function->sizeOfData();
|
||||||
size_t align_of_state = function->alignOfData();
|
size_t align_of_state = function->alignOfData();
|
||||||
|
@ -66,7 +66,7 @@ size_t deserializeOffsets(IColumn::Offsets & offsets,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Just try to guess number of offsets.
|
/// Just try to guess number of offsets.
|
||||||
offsets.reserve_exact(offsets.size()
|
offsets.reserve(offsets.size()
|
||||||
+ static_cast<size_t>(limit * (1.0 - ColumnSparse::DEFAULT_RATIO_FOR_SPARSE_SERIALIZATION)));
|
+ static_cast<size_t>(limit * (1.0 - ColumnSparse::DEFAULT_RATIO_FOR_SPARSE_SERIALIZATION)));
|
||||||
|
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
@ -235,7 +235,7 @@ void SerializationString::deserializeBinaryBulk(IColumn & column, ReadBuffer & i
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
data.reserve_exact(size_to_reserve);
|
data.reserve(size_to_reserve);
|
||||||
}
|
}
|
||||||
catch (Exception & e)
|
catch (Exception & e)
|
||||||
{
|
{
|
||||||
@ -247,7 +247,7 @@ void SerializationString::deserializeBinaryBulk(IColumn & column, ReadBuffer & i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
offsets.reserve_exact(offsets.size() + limit);
|
offsets.reserve(offsets.size() + limit);
|
||||||
|
|
||||||
if (avg_chars_size >= 64)
|
if (avg_chars_size >= 64)
|
||||||
deserializeBinarySSE2<4>(data, offsets, istr, limit);
|
deserializeBinarySSE2<4>(data, offsets, istr, limit);
|
||||||
|
@ -320,7 +320,7 @@ void SerializationVariant::deserializeBinaryBulkWithMultipleStreams(
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto & offsets = col.getOffsets();
|
auto & offsets = col.getOffsets();
|
||||||
offsets.reserve_exact(offsets.size() + limit);
|
offsets.reserve(offsets.size() + limit);
|
||||||
std::vector<size_t> variant_offsets;
|
std::vector<size_t> variant_offsets;
|
||||||
variant_offsets.reserve(variants.size());
|
variant_offsets.reserve(variants.size());
|
||||||
for (size_t i = 0; i != variants.size(); ++i)
|
for (size_t i = 0; i != variants.size(); ++i)
|
||||||
|
@ -129,7 +129,7 @@ void SerializationVariantElement::deserializeBinaryBulkWithMultipleStreams(
|
|||||||
/// Otherwise we should iterate through discriminators to fill null map.
|
/// Otherwise we should iterate through discriminators to fill null map.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
null_map.reserve_exact(null_map.size() + limit);
|
null_map.reserve(null_map.size() + limit);
|
||||||
for (size_t i = discriminators_offset; i != discriminators_data.size(); ++i)
|
for (size_t i = discriminators_offset; i != discriminators_data.size(); ++i)
|
||||||
null_map.push_back(discriminators_data[i] != variant_discriminator);
|
null_map.push_back(discriminators_data[i] != variant_discriminator);
|
||||||
}
|
}
|
||||||
@ -241,7 +241,7 @@ ColumnPtr SerializationVariantElement::VariantSubcolumnCreator::create(const DB:
|
|||||||
|
|
||||||
/// In general case we should iterate through discriminators and create null-map for our variant.
|
/// In general case we should iterate through discriminators and create null-map for our variant.
|
||||||
NullMap null_map;
|
NullMap null_map;
|
||||||
null_map.reserve_exact(local_discriminators->size());
|
null_map.reserve(local_discriminators->size());
|
||||||
const auto & local_discriminators_data = assert_cast<const ColumnVariant::ColumnDiscriminators &>(*local_discriminators).getData();
|
const auto & local_discriminators_data = assert_cast<const ColumnVariant::ColumnDiscriminators &>(*local_discriminators).getData();
|
||||||
for (auto local_discr : local_discriminators_data)
|
for (auto local_discr : local_discriminators_data)
|
||||||
null_map.push_back(local_discr != local_variant_discriminator);
|
null_map.push_back(local_discr != local_variant_discriminator);
|
||||||
|
@ -63,7 +63,7 @@ MarksInCompressedFile::MarksInCompressedFile(const PlainArray & marks)
|
|||||||
|
|
||||||
// Overallocate by +1 element to let the bit packing/unpacking do less bounds checking.
|
// Overallocate by +1 element to let the bit packing/unpacking do less bounds checking.
|
||||||
size_t packed_length = (packed_bits + 63) / 64 + 1;
|
size_t packed_length = (packed_bits + 63) / 64 + 1;
|
||||||
packed.reserve_exact(packed_length);
|
packed.reserve(packed_length);
|
||||||
packed.resize_fill(packed_length);
|
packed.resize_fill(packed_length);
|
||||||
|
|
||||||
// Second pass: write out the packed marks.
|
// Second pass: write out the packed marks.
|
||||||
|
Loading…
Reference in New Issue
Block a user