Better semantic of sharing columns: development [#CLICKHOUSE-2].

This commit is contained in:
Alexey Milovidov 2017-12-16 00:32:25 +03:00
parent ecd56de6a8
commit 7284a64740
83 changed files with 678 additions and 681 deletions

View File

@ -92,7 +92,7 @@ public:
nested[i] = &static_cast<const ColumnArray &>(*columns[i]).getData();
const ColumnArray & first_array_column = static_cast<const ColumnArray &>(*columns[0]);
const IColumn::Offsets_t & offsets = first_array_column.getOffsets();
const IColumn::Offsets & offsets = first_array_column.getOffsets();
size_t begin = row_num == 0 ? 0 : offsets[row_num - 1];
size_t end = offsets[row_num];

View File

@ -152,7 +152,7 @@ public:
void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena * arena) const override
{
const ColumnArray & first_array_column = static_cast<const ColumnArray &>(*columns[0]);
const IColumn::Offsets_t & offsets = first_array_column.getOffsets();
const IColumn::Offsets & offsets = first_array_column.getOffsets();
const IColumn * array_data = &first_array_column.getData();
size_t begin = row_num == 0 ? 0 : offsets[row_num - 1];
size_t end = offsets[row_num];
@ -221,7 +221,7 @@ public:
const AggregateFunctionForEachData & state = data(place);
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
IColumn & elems_to = arr_to.getData();
const char * nested_state = state.array_of_aggregate_datas;

View File

@ -125,11 +125,11 @@ public:
size_t size = value.size();
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + size);
typename ColumnVector<T>::Container_t & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
typename ColumnVector<T>::Container & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
data_to.insert(this->data(place).value.begin(), this->data(place).value.end());
}

View File

@ -184,7 +184,7 @@ public:
{
ColumnArray & to_array = static_cast<ColumnArray &>(to);
IColumn & to_data = to_array.getData();
ColumnArray::Offsets_t & to_offsets = to_array.getOffsets();
ColumnArray::Offsets & to_offsets = to_array.getOffsets();
const Array & arr = data(place).value;

View File

@ -83,14 +83,14 @@ public:
void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
{
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
const typename State::Set & set = this->data(place).value;
size_t size = set.size();
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + size);
typename ColumnVector<T>::Container_t & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
typename ColumnVector<T>::Container & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
size_t old_size = data_to.size();
data_to.resize(old_size + size);
@ -210,7 +210,7 @@ public:
void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
{
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
IColumn & data_to = arr_to.getData();
auto & set = this->data(place).value;

View File

@ -174,21 +174,21 @@ public:
Sample & sample = const_cast<Sample &>(this->data(place).sample);
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
size_t size = levels.size();
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + size);
if (returns_float)
{
ColumnFloat64::Container_t & data_to = static_cast<ColumnFloat64 &>(arr_to.getData()).getData();
ColumnFloat64::Container & data_to = static_cast<ColumnFloat64 &>(arr_to.getData()).getData();
for (size_t i = 0; i < size; ++i)
data_to.push_back(sample.quantileInterpolated(levels[i]));
}
else
{
typename ColumnVector<ArgumentFieldType>::Container_t & data_to = static_cast<ColumnVector<ArgumentFieldType> &>(arr_to.getData()).getData();
typename ColumnVector<ArgumentFieldType>::Container & data_to = static_cast<ColumnVector<ArgumentFieldType> &>(arr_to.getData()).getData();
for (size_t i = 0; i < size; ++i)
data_to.push_back(sample.quantileInterpolated(levels[i]));

View File

@ -186,21 +186,21 @@ public:
Sample & sample = const_cast<Sample &>(this->data(place).sample);
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
size_t size = levels.size();
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + size);
if (returns_float)
{
ColumnFloat64::Container_t & data_to = static_cast<ColumnFloat64 &>(arr_to.getData()).getData();
ColumnFloat64::Container & data_to = static_cast<ColumnFloat64 &>(arr_to.getData()).getData();
for (size_t i = 0; i < size; ++i)
data_to.push_back(sample.quantileInterpolated(levels[i]));
}
else
{
typename ColumnVector<ArgumentFieldType>::Container_t & data_to = static_cast<ColumnVector<ArgumentFieldType> &>(arr_to.getData()).getData();
typename ColumnVector<ArgumentFieldType>::Container & data_to = static_cast<ColumnVector<ArgumentFieldType> &>(arr_to.getData()).getData();
for (size_t i = 0; i < size; ++i)
data_to.push_back(sample.quantileInterpolated(levels[i]));

View File

@ -187,12 +187,12 @@ public:
auto & array = const_cast<typename AggregateFunctionQuantileExactData<T>::Array &>(this->data(place).array);
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
size_t num_levels = levels.size();
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + num_levels);
typename ColumnVector<T>::Container_t & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
typename ColumnVector<T>::Container & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
size_t old_size = data_to.size();
data_to.resize(old_size + num_levels);

View File

@ -230,7 +230,7 @@ public:
size_t size = map.size();
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
size_t num_levels = levels.size();
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + num_levels);
@ -238,7 +238,7 @@ public:
if (!num_levels)
return;
typename ColumnVector<ValueType>::Container_t & data_to = static_cast<ColumnVector<ValueType> &>(arr_to.getData()).getData();
typename ColumnVector<ValueType>::Container & data_to = static_cast<ColumnVector<ValueType> &>(arr_to.getData()).getData();
size_t old_size = data_to.size();
data_to.resize(old_size + num_levels);

View File

@ -540,7 +540,7 @@ public:
void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
{
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
size_t size = levels.size();
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + size);
@ -550,7 +550,7 @@ public:
if (returns_float)
{
typename ColumnFloat32::Container_t & data_to = static_cast<ColumnFloat32 &>(arr_to.getData()).getData();
typename ColumnFloat32::Container & data_to = static_cast<ColumnFloat32 &>(arr_to.getData()).getData();
size_t old_size = data_to.size();
data_to.resize(data_to.size() + size);
@ -559,7 +559,7 @@ public:
}
else
{
typename ColumnVector<T>::Container_t & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
typename ColumnVector<T>::Container & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
size_t old_size = data_to.size();
data_to.resize(data_to.size() + size);
@ -627,7 +627,7 @@ public:
void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
{
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
size_t size = levels.size();
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + size);
@ -637,7 +637,7 @@ public:
if (returns_float)
{
typename ColumnFloat32::Container_t & data_to = static_cast<ColumnFloat32 &>(arr_to.getData()).getData();
typename ColumnFloat32::Container & data_to = static_cast<ColumnFloat32 &>(arr_to.getData()).getData();
size_t old_size = data_to.size();
data_to.resize(data_to.size() + size);
@ -646,7 +646,7 @@ public:
}
else
{
typename ColumnVector<T>::Container_t & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
typename ColumnVector<T>::Container & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
size_t old_size = data_to.size();
data_to.resize(data_to.size() + size);

View File

@ -961,7 +961,7 @@ public:
void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
{
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
size_t size = levels.size();
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + size);
@ -969,7 +969,7 @@ public:
if (!size)
return;
typename ColumnFloat32::Container_t & data_to = static_cast<ColumnFloat32 &>(arr_to.getData()).getData();
typename ColumnFloat32::Container & data_to = static_cast<ColumnFloat32 &>(arr_to.getData()).getData();
size_t old_size = data_to.size();
data_to.resize(data_to.size() + size);
@ -1029,7 +1029,7 @@ public:
void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
{
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
size_t size = levels.size();
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + size);
@ -1037,7 +1037,7 @@ public:
if (!size)
return;
typename ColumnFloat32::Container_t & data_to = static_cast<ColumnFloat32 &>(arr_to.getData()).getData();
typename ColumnFloat32::Container & data_to = static_cast<ColumnFloat32 &>(arr_to.getData()).getData();
size_t old_size = data_to.size();
data_to.resize(data_to.size() + size);

View File

@ -102,7 +102,7 @@ public:
{
// Column 0 contains array of keys of known type
const ColumnArray & array_column = static_cast<const ColumnArray &>(*columns[0]);
const IColumn::Offsets_t & offsets = array_column.getOffsets();
const IColumn::Offsets & offsets = array_column.getOffsets();
const auto & keys_vec = static_cast<const ColumnVector<T> &>(array_column.getData());
const size_t keys_vec_offset = row_num == 0 ? 0 : offsets[row_num - 1];
const size_t keys_vec_size = (offsets[row_num] - keys_vec_offset);
@ -113,7 +113,7 @@ public:
{
Field value;
const ColumnArray & array_column = static_cast<const ColumnArray &>(*columns[col + 1]);
const IColumn::Offsets_t & offsets = array_column.getOffsets();
const IColumn::Offsets & offsets = array_column.getOffsets();
const size_t values_vec_offset = row_num == 0 ? 0 : offsets[row_num - 1];
const size_t values_vec_size = (offsets[row_num] - values_vec_offset);

View File

@ -108,7 +108,7 @@ public:
void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
{
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
const typename State::Set & set = this->data(place).value;
auto result_vec = set.topK(threshold);
@ -116,7 +116,7 @@ public:
offsets_to.push_back((offsets_to.size() == 0 ? 0 : offsets_to.back()) + size);
typename ColumnVector<T>::Container_t & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
typename ColumnVector<T>::Container & data_to = static_cast<ColumnVector<T> &>(arr_to.getData()).getData();
size_t old_size = data_to.size();
data_to.resize(old_size + size);
@ -237,7 +237,7 @@ public:
void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
{
ColumnArray & arr_to = static_cast<ColumnArray &>(to);
ColumnArray::Offsets_t & offsets_to = arr_to.getOffsets();
ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
IColumn & data_to = arr_to.getData();
auto result_vec = this->data(place).value.topK(threshold);

View File

@ -135,7 +135,7 @@ MutableColumnPtr ColumnAggregateFunction::filter(const Filter & filter, ssize_t
/// To save RAM in case of too strong filtering.
if (res_data.size() * 2 < res_data.capacity())
res_data = Container_t(res_data.cbegin(), res_data.cend());
res_data = Container(res_data.cbegin(), res_data.cend());
return std::move(res);
}
@ -326,7 +326,7 @@ void ColumnAggregateFunction::popBack(size_t n)
data.resize_assume_reserved(new_size);
}
MutableColumnPtr ColumnAggregateFunction::replicate(const IColumn::Offsets_t & offsets) const
MutableColumnPtr ColumnAggregateFunction::replicate(const IColumn::Offsets & offsets) const
{
size_t size = data.size();
if (size != offsets.size())
@ -339,7 +339,7 @@ MutableColumnPtr ColumnAggregateFunction::replicate(const IColumn::Offsets_t & o
auto & res_data = res->getData();
res_data.reserve(offsets.back());
IColumn::Offset_t prev_offset = 0;
IColumn::Offset prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t size_to_replicate = offsets[i] - prev_offset;

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
#include <Common/Arena.h>
@ -44,7 +44,7 @@ namespace DB
class ColumnAggregateFunction final : public COWPtrHelper<IColumn, ColumnAggregateFunction>
{
public:
using Container_t = PaddedPODArray<AggregateDataPtr>;
using Container = PaddedPODArray<AggregateDataPtr>;
private:
friend class COWPtrHelper<IColumn, ColumnAggregateFunction>;
@ -60,7 +60,7 @@ private:
ColumnPtr src;
/// Array of pointers to aggregation states, that are placed in arenas.
Container_t data;
Container data;
ColumnAggregateFunction() {}
@ -156,7 +156,7 @@ public:
MutableColumnPtr permute(const Permutation & perm, size_t limit) const override;
MutableColumnPtr replicate(const Offsets_t & offsets) const override;
MutableColumnPtr replicate(const Offsets & offsets) const override;
MutableColumns scatter(ColumnIndex num_columns, const Selector & selector) const override;
@ -170,12 +170,12 @@ public:
void getPermutation(bool reverse, size_t limit, int nan_direction_hint, Permutation & res) const override;
/** More efficient manipulation methods */
Container_t & getData()
Container & getData()
{
return data;
}
const Container_t & getData() const
const Container & getData() const
{
return data;
}

View File

@ -34,7 +34,7 @@ namespace ErrorCodes
ColumnArray::ColumnArray(const ColumnPtr & nested_column, const ColumnPtr & offsets_column)
: data(nested_column), offsets(offsets_column)
{
if (!typeid_cast<const ColumnOffsets_t *>(offsets_column.get()))
if (!typeid_cast<const ColumnOffsets *>(offsets_column.get()))
throw Exception("offsets_column must be a ColumnUInt64", ErrorCodes::ILLEGAL_COLUMN);
/** NOTE
@ -49,7 +49,7 @@ ColumnArray::ColumnArray(const ColumnPtr & nested_column)
if (!data->empty())
throw Exception("Not empty data passed to ColumnArray, but no offsets passed", ErrorCodes::ILLEGAL_COLUMN);
offsets = ColumnOffsets_t::create();
offsets = ColumnOffsets::create();
}
@ -76,7 +76,7 @@ MutableColumnPtr ColumnArray::cloneResized(size_t to_size) const
{
/// Copy column and append empty arrays for extra elements.
Offset_t offset = 0;
Offset offset = 0;
if (from_size > 0)
{
res->getOffsets().assign(getOffsets().begin(), getOffsets().end());
@ -311,8 +311,8 @@ bool ColumnArray::hasEqualOffsets(const ColumnArray & other) const
if (offsets == other.offsets)
return true;
const Offsets_t & offsets1 = getOffsets();
const Offsets_t & offsets2 = other.getOffsets();
const Offsets & offsets1 = getOffsets();
const Offsets & offsets2 = other.getOffsets();
return offsets1.size() == offsets2.size() && 0 == memcmp(&offsets1[0], &offsets2[0], sizeof(offsets1[0]) * offsets1.size());
}
@ -372,8 +372,8 @@ void ColumnArray::insertRangeFrom(const IColumn & src, size_t start, size_t leng
insertRangeFrom(src_concrete.getData(), nested_offset, nested_length);
Offsets_t & cur_offsets = getOffsets();
const Offsets_t & src_offsets = src_concrete.getOffsets();
Offsets & cur_offsets = getOffsets();
const Offsets & src_offsets = src_concrete.getOffsets();
if (start == 0 && cur_offsets.empty())
{
@ -418,7 +418,7 @@ MutableColumnPtr ColumnArray::filterNumber(const Filter & filt, ssize_t result_s
auto res = ColumnArray::create(data->cloneEmpty());
auto & res_elems = static_cast<ColumnVector<T> &>(res->getData()).getData();
Offsets_t & res_offsets = res->getOffsets();
Offsets & res_offsets = res->getOffsets();
filterArraysImpl<T>(static_cast<const ColumnVector<T> &>(*data).getData(), getOffsets(), res_elems, res_offsets, filt, result_size_hint);
return std::move(res);
@ -437,12 +437,12 @@ MutableColumnPtr ColumnArray::filterString(const Filter & filt, ssize_t result_s
const ColumnString & src_string = typeid_cast<const ColumnString &>(*data);
const ColumnString::Chars_t & src_chars = src_string.getChars();
const Offsets_t & src_string_offsets = src_string.getOffsets();
const Offsets_t & src_offsets = getOffsets();
const Offsets & src_string_offsets = src_string.getOffsets();
const Offsets & src_offsets = getOffsets();
ColumnString::Chars_t & res_chars = typeid_cast<ColumnString &>(res->getData()).getChars();
Offsets_t & res_string_offsets = typeid_cast<ColumnString &>(res->getData()).getOffsets();
Offsets_t & res_offsets = res->getOffsets();
Offsets & res_string_offsets = typeid_cast<ColumnString &>(res->getData()).getOffsets();
Offsets & res_offsets = res->getOffsets();
if (result_size_hint < 0) /// Other cases are not considered.
{
@ -451,11 +451,11 @@ MutableColumnPtr ColumnArray::filterString(const Filter & filt, ssize_t result_s
res_offsets.reserve(col_size);
}
Offset_t prev_src_offset = 0;
Offset_t prev_src_string_offset = 0;
Offset prev_src_offset = 0;
Offset prev_src_string_offset = 0;
Offset_t prev_res_offset = 0;
Offset_t prev_res_string_offset = 0;
Offset prev_res_offset = 0;
Offset prev_res_string_offset = 0;
for (size_t i = 0; i < col_size; ++i)
{
@ -520,7 +520,7 @@ MutableColumnPtr ColumnArray::filterGeneric(const Filter & filt, ssize_t result_
res->data = data->filter(nested_filt, nested_result_size_hint);
Offsets_t & res_offsets = res->getOffsets();
Offsets & res_offsets = res->getOffsets();
if (result_size_hint)
res_offsets.reserve(result_size_hint > 0 ? result_size_hint : size);
@ -607,7 +607,7 @@ MutableColumnPtr ColumnArray::permute(const Permutation & perm, size_t limit) co
auto res = ColumnArray::create(data->cloneEmpty());
Offsets_t & res_offsets = res->getOffsets();
Offsets & res_offsets = res->getOffsets();
res_offsets.resize(limit);
size_t current_offset = 0;
@ -652,7 +652,7 @@ void ColumnArray::getPermutation(bool reverse, size_t limit, int nan_direction_h
}
MutableColumnPtr ColumnArray::replicate(const Offsets_t & replicate_offsets) const
MutableColumnPtr ColumnArray::replicate(const Offsets & replicate_offsets) const
{
if (typeid_cast<const ColumnUInt8 *>(data.get())) return replicateNumber<UInt8>(replicate_offsets);
if (typeid_cast<const ColumnUInt16 *>(data.get())) return replicateNumber<UInt16>(replicate_offsets);
@ -673,7 +673,7 @@ MutableColumnPtr ColumnArray::replicate(const Offsets_t & replicate_offsets) con
template <typename T>
MutableColumnPtr ColumnArray::replicateNumber(const Offsets_t & replicate_offsets) const
MutableColumnPtr ColumnArray::replicateNumber(const Offsets & replicate_offsets) const
{
size_t col_size = size();
if (col_size != replicate_offsets.size())
@ -686,18 +686,18 @@ MutableColumnPtr ColumnArray::replicateNumber(const Offsets_t & replicate_offset
ColumnArray & res_ = typeid_cast<ColumnArray &>(*res);
const typename ColumnVector<T>::Container_t & src_data = typeid_cast<const ColumnVector<T> &>(*data).getData();
const Offsets_t & src_offsets = getOffsets();
const typename ColumnVector<T>::Container & src_data = typeid_cast<const ColumnVector<T> &>(*data).getData();
const Offsets & src_offsets = getOffsets();
typename ColumnVector<T>::Container_t & res_data = typeid_cast<ColumnVector<T> &>(res_.getData()).getData();
Offsets_t & res_offsets = res_.getOffsets();
typename ColumnVector<T>::Container & res_data = typeid_cast<ColumnVector<T> &>(res_.getData()).getData();
Offsets & res_offsets = res_.getOffsets();
res_data.reserve(data->size() / col_size * replicate_offsets.back());
res_offsets.reserve(replicate_offsets.back());
Offset_t prev_replicate_offset = 0;
Offset_t prev_data_offset = 0;
Offset_t current_new_offset = 0;
Offset prev_replicate_offset = 0;
Offset prev_data_offset = 0;
Offset current_new_offset = 0;
for (size_t i = 0; i < col_size; ++i)
{
@ -721,7 +721,7 @@ MutableColumnPtr ColumnArray::replicateNumber(const Offsets_t & replicate_offset
}
MutableColumnPtr ColumnArray::replicateString(const Offsets_t & replicate_offsets) const
MutableColumnPtr ColumnArray::replicateString(const Offsets & replicate_offsets) const
{
size_t col_size = size();
if (col_size != replicate_offsets.size())
@ -736,24 +736,24 @@ MutableColumnPtr ColumnArray::replicateString(const Offsets_t & replicate_offset
const ColumnString & src_string = typeid_cast<const ColumnString &>(*data);
const ColumnString::Chars_t & src_chars = src_string.getChars();
const Offsets_t & src_string_offsets = src_string.getOffsets();
const Offsets_t & src_offsets = getOffsets();
const Offsets & src_string_offsets = src_string.getOffsets();
const Offsets & src_offsets = getOffsets();
ColumnString::Chars_t & res_chars = typeid_cast<ColumnString &>(res_.getData()).getChars();
Offsets_t & res_string_offsets = typeid_cast<ColumnString &>(res_.getData()).getOffsets();
Offsets_t & res_offsets = res_.getOffsets();
Offsets & res_string_offsets = typeid_cast<ColumnString &>(res_.getData()).getOffsets();
Offsets & res_offsets = res_.getOffsets();
res_chars.reserve(src_chars.size() / col_size * replicate_offsets.back());
res_string_offsets.reserve(src_string_offsets.size() / col_size * replicate_offsets.back());
res_offsets.reserve(replicate_offsets.back());
Offset_t prev_replicate_offset = 0;
Offset prev_replicate_offset = 0;
Offset_t prev_src_offset = 0;
Offset_t prev_src_string_offset = 0;
Offset prev_src_offset = 0;
Offset prev_src_string_offset = 0;
Offset_t current_res_offset = 0;
Offset_t current_res_string_offset = 0;
Offset current_res_offset = 0;
Offset current_res_string_offset = 0;
for (size_t i = 0; i < col_size; ++i)
{
@ -796,7 +796,7 @@ MutableColumnPtr ColumnArray::replicateString(const Offsets_t & replicate_offset
}
MutableColumnPtr ColumnArray::replicateConst(const Offsets_t & replicate_offsets) const
MutableColumnPtr ColumnArray::replicateConst(const Offsets & replicate_offsets) const
{
size_t col_size = size();
if (col_size != replicate_offsets.size())
@ -805,15 +805,15 @@ MutableColumnPtr ColumnArray::replicateConst(const Offsets_t & replicate_offsets
if (0 == col_size)
return cloneEmpty();
const Offsets_t & src_offsets = getOffsets();
const Offsets & src_offsets = getOffsets();
auto res_column_offsets = ColumnOffsets_t::create();
Offsets_t & res_offsets = res_column_offsets->getData();
auto res_column_offsets = ColumnOffsets::create();
Offsets & res_offsets = res_column_offsets->getData();
res_offsets.reserve(replicate_offsets.back());
Offset_t prev_replicate_offset = 0;
Offset_t prev_data_offset = 0;
Offset_t current_new_offset = 0;
Offset prev_replicate_offset = 0;
Offset prev_data_offset = 0;
Offset current_new_offset = 0;
for (size_t i = 0; i < col_size; ++i)
{
@ -834,7 +834,7 @@ MutableColumnPtr ColumnArray::replicateConst(const Offsets_t & replicate_offsets
}
MutableColumnPtr ColumnArray::replicateGeneric(const Offsets_t & replicate_offsets) const
MutableColumnPtr ColumnArray::replicateGeneric(const Offsets & replicate_offsets) const
{
size_t col_size = size();
if (col_size != replicate_offsets.size())
@ -846,7 +846,7 @@ MutableColumnPtr ColumnArray::replicateGeneric(const Offsets_t & replicate_offse
if (0 == col_size)
return res;
IColumn::Offset_t prev_offset = 0;
IColumn::Offset prev_offset = 0;
for (size_t i = 0; i < col_size; ++i)
{
size_t size_to_replicate = replicate_offsets[i] - prev_offset;
@ -860,7 +860,7 @@ MutableColumnPtr ColumnArray::replicateGeneric(const Offsets_t & replicate_offse
}
MutableColumnPtr ColumnArray::replicateNullable(const Offsets_t & replicate_offsets) const
MutableColumnPtr ColumnArray::replicateNullable(const Offsets & replicate_offsets) const
{
const ColumnNullable & nullable = static_cast<const ColumnNullable &>(*data);
@ -878,7 +878,7 @@ MutableColumnPtr ColumnArray::replicateNullable(const Offsets_t & replicate_offs
}
MutableColumnPtr ColumnArray::replicateTuple(const Offsets_t & replicate_offsets) const
MutableColumnPtr ColumnArray::replicateTuple(const Offsets & replicate_offsets) const
{
const ColumnTuple & tuple = static_cast<const ColumnTuple &>(*data);

View File

@ -33,7 +33,7 @@ private:
public:
/** On the index i there is an offset to the beginning of the i + 1 -th element. */
using ColumnOffsets_t = ColumnVector<Offset_t>;
using ColumnOffsets = ColumnVector<Offset>;
std::string getName() const override;
const char * getFamilyName() const override { return "Array"; }
@ -58,7 +58,7 @@ public:
void reserve(size_t n) override;
size_t byteSize() const override;
size_t allocatedBytes() const override;
MutableColumnPtr replicate(const Offsets_t & replicate_offsets) const override;
MutableColumnPtr replicate(const Offsets & replicate_offsets) const override;
MutableColumnPtr convertToFullColumnIfConst() const override;
void getExtremes(Field & min, Field & max) const override;
@ -71,14 +71,14 @@ public:
//MutableColumnPtr getDataPtr() { return data->assumeMutable(); }
const ColumnPtr & getDataPtr() const { return data; }
Offsets_t & ALWAYS_INLINE getOffsets()
Offsets & ALWAYS_INLINE getOffsets()
{
return static_cast<ColumnOffsets_t &>(*offsets->assumeMutable()).getData();
return static_cast<ColumnOffsets &>(*offsets->assumeMutable()).getData();
}
const Offsets_t & ALWAYS_INLINE getOffsets() const
const Offsets & ALWAYS_INLINE getOffsets() const
{
return static_cast<const ColumnOffsets_t &>(*offsets).getData();
return static_cast<const ColumnOffsets &>(*offsets).getData();
}
MutableColumnPtr getOffsetsPtr() { return offsets->assumeMutable(); }
@ -107,23 +107,23 @@ private:
/// Multiply values if the nested column is ColumnVector<T>.
template <typename T>
MutableColumnPtr replicateNumber(const Offsets_t & replicate_offsets) const;
MutableColumnPtr replicateNumber(const Offsets & replicate_offsets) const;
/// Multiply the values if the nested column is ColumnString. The code is too complicated.
MutableColumnPtr replicateString(const Offsets_t & replicate_offsets) const;
MutableColumnPtr replicateString(const Offsets & replicate_offsets) const;
/** Non-constant arrays of constant values are quite rare.
* Most functions can not work with them, and does not create such columns as a result.
* An exception is the function `replicate`(see FunctionsMiscellaneous.h), which has service meaning for the implementation of lambda functions.
* Only for its sake is the implementation of the `replicate` method for ColumnArray(ColumnConst).
*/
MutableColumnPtr replicateConst(const Offsets_t & replicate_offsets) const;
MutableColumnPtr replicateConst(const Offsets & replicate_offsets) const;
/** The following is done by simply replicating of nested columns.
*/
MutableColumnPtr replicateTuple(const Offsets_t & replicate_offsets) const;
MutableColumnPtr replicateNullable(const Offsets_t & replicate_offsets) const;
MutableColumnPtr replicateGeneric(const Offsets_t & replicate_offsets) const;
MutableColumnPtr replicateTuple(const Offsets & replicate_offsets) const;
MutableColumnPtr replicateNullable(const Offsets & replicate_offsets) const;
MutableColumnPtr replicateGeneric(const Offsets & replicate_offsets) const;
/// Specializations for the filter function.

View File

@ -24,7 +24,7 @@ ColumnConst::ColumnConst(const ColumnPtr & data_, size_t s)
MutableColumnPtr ColumnConst::convertToFullColumn() const
{
return data->replicate(Offsets_t(1, s));
return data->replicate(Offsets(1, s));
}
}

View File

@ -155,7 +155,7 @@ public:
return ColumnConst::create(data, countBytesInFilter(filt));
}
MutableColumnPtr replicate(const Offsets_t & offsets) const override
MutableColumnPtr replicate(const Offsets & offsets) const override
{
if (s != offsets.size())
throw Exception("Size of offsets doesn't match size of column.", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH);

View File

@ -258,7 +258,7 @@ MutableColumnPtr ColumnFixedString::permute(const Permutation & perm, size_t lim
return std::move(res);
}
MutableColumnPtr ColumnFixedString::replicate(const Offsets_t & offsets) const
MutableColumnPtr ColumnFixedString::replicate(const Offsets & offsets) const
{
size_t col_size = size();
if (col_size != offsets.size())
@ -272,7 +272,7 @@ MutableColumnPtr ColumnFixedString::replicate(const Offsets_t & offsets) const
Chars_t & res_chars = res->chars;
res_chars.resize(n * offsets.back());
Offset_t curr_offset = 0;
Offset curr_offset = 0;
for (size_t i = 0; i < col_size; ++i)
for (size_t next_offset = offsets[i]; curr_offset < next_offset; ++curr_offset)
memcpySmallAllowReadWriteOverflow15(&res->chars[curr_offset * n], &chars[i * n], n);

View File

@ -108,7 +108,7 @@ public:
MutableColumnPtr permute(const Permutation & perm, size_t limit) const override;
MutableColumnPtr replicate(const Offsets_t & offsets) const override;
MutableColumnPtr replicate(const Offsets & offsets) const override;
MutableColumns scatter(ColumnIndex num_columns, const Selector & selector) const override
{

View File

@ -384,7 +384,7 @@ void ColumnNullable::getExtremes(Field & min, Field & max) const
}
MutableColumnPtr ColumnNullable::replicate(const Offsets_t & offsets) const
MutableColumnPtr ColumnNullable::replicate(const Offsets & offsets) const
{
ColumnPtr replicated_data = getNestedColumn().replicate(offsets);
ColumnPtr replicated_null_map = getNullMapColumn().replicate(offsets);

View File

@ -6,7 +6,7 @@
namespace DB
{
using NullMap = ColumnUInt8::Container_t;
using NullMap = ColumnUInt8::Container;
using ConstNullMapPtr = const NullMap *;
/// Class that specifies nullable columns. A nullable column represents
@ -57,7 +57,7 @@ public:
void reserve(size_t n) override;
size_t byteSize() const override;
size_t allocatedBytes() const override;
MutableColumnPtr replicate(const Offsets_t & replicate_offsets) const override;
MutableColumnPtr replicate(const Offsets & replicate_offsets) const override;
void updateHashWithValue(size_t n, SipHash & hash) const override;
void getExtremes(Field & min, Field & max) const override;

View File

@ -39,7 +39,7 @@ MutableColumnPtr ColumnString::cloneResized(size_t to_size) const
{
/// Copy column and append empty strings for extra elements.
Offset_t offset = 0;
Offset offset = 0;
if (from_size > 0)
{
res->offsets.assign(offsets.begin(), offsets.end());
@ -105,7 +105,7 @@ MutableColumnPtr ColumnString::filter(const Filter & filt, ssize_t result_size_h
auto res = ColumnString::create();
Chars_t & res_chars = res->chars;
Offsets_t & res_offsets = res->offsets;
Offsets & res_offsets = res->offsets;
filterArraysImpl<UInt8>(chars, offsets, res_chars, res_offsets, filt, result_size_hint);
return std::move(res);
@ -130,7 +130,7 @@ MutableColumnPtr ColumnString::permute(const Permutation & perm, size_t limit) c
auto res = ColumnString::create();
Chars_t & res_chars = res->chars;
Offsets_t & res_offsets = res->offsets;
Offsets & res_offsets = res->offsets;
if (limit == size)
res_chars.resize(chars.size());
@ -144,7 +144,7 @@ MutableColumnPtr ColumnString::permute(const Permutation & perm, size_t limit) c
res_offsets.resize(limit);
Offset_t current_new_offset = 0;
Offset current_new_offset = 0;
for (size_t i = 0; i < limit; ++i)
{
@ -208,7 +208,7 @@ void ColumnString::getPermutation(bool reverse, size_t limit, int /*nan_directio
}
MutableColumnPtr ColumnString::replicate(const Offsets_t & replicate_offsets) const
MutableColumnPtr ColumnString::replicate(const Offsets & replicate_offsets) const
{
size_t col_size = size();
if (col_size != replicate_offsets.size())
@ -220,13 +220,13 @@ MutableColumnPtr ColumnString::replicate(const Offsets_t & replicate_offsets) co
return std::move(res);
Chars_t & res_chars = res->chars;
Offsets_t & res_offsets = res->offsets;
Offsets & res_offsets = res->offsets;
res_chars.reserve(chars.size() / col_size * replicate_offsets.back());
res_offsets.reserve(replicate_offsets.back());
Offset_t prev_replicate_offset = 0;
Offset_t prev_string_offset = 0;
Offset_t current_new_offset = 0;
Offset prev_replicate_offset = 0;
Offset prev_string_offset = 0;
Offset current_new_offset = 0;
for (size_t i = 0; i < col_size; ++i)
{

View File

@ -26,7 +26,7 @@ private:
friend class COWPtrHelper<IColumn, ColumnString>;
/// Maps i'th position to offset to i+1'th element. Last offset maps to the end of all chars (is the size of all chars).
Offsets_t offsets;
Offsets offsets;
/// Bytes of strings, placed contiguously.
/// For convenience, every string ends with terminating zero byte. Note that strings could contain zero bytes in the middle.
@ -239,7 +239,7 @@ public:
/// Sorting with respect of collation.
void getPermutationWithCollation(const Collator & collator, bool reverse, size_t limit, Permutation & res) const;
MutableColumnPtr replicate(const Offsets_t & replicate_offsets) const override;
MutableColumnPtr replicate(const Offsets & replicate_offsets) const override;
MutableColumns scatter(ColumnIndex num_columns, const Selector & selector) const override
{
@ -259,8 +259,8 @@ public:
Chars_t & getChars() { return chars; }
const Chars_t & getChars() const { return chars; }
Offsets_t & getOffsets() { return offsets; }
const Offsets_t & getOffsets() const { return offsets; }
Offsets & getOffsets() { return offsets; }
const Offsets & getOffsets() const { return offsets; }
};

View File

@ -162,7 +162,7 @@ MutableColumnPtr ColumnTuple::permute(const Permutation & perm, size_t limit) co
return ColumnTuple::create(new_columns);
}
MutableColumnPtr ColumnTuple::replicate(const Offsets_t & offsets) const
MutableColumnPtr ColumnTuple::replicate(const Offsets & offsets) const
{
const size_t tuple_size = columns.size();
Columns new_columns(tuple_size);

View File

@ -51,7 +51,7 @@ public:
void insertRangeFrom(const IColumn & src, size_t start, size_t length) override;
MutableColumnPtr filter(const Filter & filt, ssize_t result_size_hint) const override;
MutableColumnPtr permute(const Permutation & perm, size_t limit) const override;
MutableColumnPtr replicate(const Offsets_t & offsets) const override;
MutableColumnPtr replicate(const Offsets & offsets) const override;
MutableColumns scatter(ColumnIndex num_columns, const Selector & selector) const override;
void gather(ColumnGathererStream & gatherer_stream) override;
int compareAt(size_t n, size_t m, const IColumn & rhs, int nan_direction_hint) const override;

View File

@ -153,7 +153,7 @@ MutableColumnPtr ColumnVector<T>::filter(const IColumn::Filter & filt, ssize_t r
throw Exception("Size of filter doesn't match size of column.", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH);
auto res = this->create();
Container_t & res_data = res->getData();
Container & res_data = res->getData();
if (result_size_hint)
res_data.reserve(result_size_hint > 0 ? result_size_hint : size);
@ -223,7 +223,7 @@ MutableColumnPtr ColumnVector<T>::permute(const IColumn::Permutation & perm, siz
throw Exception("Size of permutation is less than required.", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH);
auto res = this->create(limit);
typename Self::Container_t & res_data = res->getData();
typename Self::Container & res_data = res->getData();
for (size_t i = 0; i < limit; ++i)
res_data[i] = data[perm[i]];
@ -231,7 +231,7 @@ MutableColumnPtr ColumnVector<T>::permute(const IColumn::Permutation & perm, siz
}
template <typename T>
MutableColumnPtr ColumnVector<T>::replicate(const IColumn::Offsets_t & offsets) const
MutableColumnPtr ColumnVector<T>::replicate(const IColumn::Offsets & offsets) const
{
size_t size = data.size();
if (size != offsets.size())
@ -241,10 +241,10 @@ MutableColumnPtr ColumnVector<T>::replicate(const IColumn::Offsets_t & offsets)
return this->create();
auto res = this->create();
typename Self::Container_t & res_data = res->getData();
typename Self::Container & res_data = res->getData();
res_data.reserve(offsets.back());
IColumn::Offset_t prev_offset = 0;
IColumn::Offset prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t size_to_replicate = offsets[i] - prev_offset;

View File

@ -132,14 +132,17 @@ private:
public:
using value_type = T;
using Container_t = PaddedPODArray<value_type>;
using Container = PaddedPODArray<value_type>;
private:
ColumnVector() {}
ColumnVector(const size_t n) : data{n} {}
ColumnVector(const size_t n, const value_type x) : data{n, x} {}
ColumnVector(const size_t n) : data(n) {}
ColumnVector(const size_t n, const value_type x) : data(n, x) {}
ColumnVector(const ColumnVector & src) : data(src.data.begin(), src.data.end()) {};
/// Sugar constructor.
ColumnVector(std::initializer_list<T> il) : data{il} {}
public:
bool isNumeric() const override { return IsNumber<T>; }
@ -244,7 +247,7 @@ public:
MutableColumnPtr permute(const IColumn::Permutation & perm, size_t limit) const override;
MutableColumnPtr replicate(const IColumn::Offsets_t & offsets) const override;
MutableColumnPtr replicate(const IColumn::Offsets & offsets) const override;
void getExtremes(Field & min, Field & max) const override;
@ -263,12 +266,12 @@ public:
/** More efficient methods of manipulation - to manipulate with data directly. */
Container_t & getData()
Container & getData()
{
return data;
}
const Container_t & getData() const
const Container & getData() const
{
return data;
}
@ -284,7 +287,7 @@ public:
}
protected:
Container_t data;
Container data;
};

View File

@ -100,10 +100,10 @@ namespace
struct ResultOffsetsBuilder
{
IColumn::Offsets_t & res_offsets;
IColumn::Offset_t current_src_offset = 0;
IColumn::Offsets & res_offsets;
IColumn::Offset current_src_offset = 0;
explicit ResultOffsetsBuilder(IColumn::Offsets_t * res_offsets_) : res_offsets(*res_offsets_) {}
explicit ResultOffsetsBuilder(IColumn::Offsets * res_offsets_) : res_offsets(*res_offsets_) {}
void reserve(ssize_t result_size_hint, size_t src_size)
{
@ -118,14 +118,14 @@ namespace
template <size_t SIMD_BYTES>
void insertChunk(
const IColumn::Offset_t * src_offsets_pos,
const IColumn::Offset * src_offsets_pos,
bool first,
IColumn::Offset_t chunk_offset,
IColumn::Offset chunk_offset,
size_t chunk_size)
{
const auto offsets_size_old = res_offsets.size();
res_offsets.resize(offsets_size_old + SIMD_BYTES);
memcpy(&res_offsets[offsets_size_old], src_offsets_pos, SIMD_BYTES * sizeof(IColumn::Offset_t));
memcpy(&res_offsets[offsets_size_old], src_offsets_pos, SIMD_BYTES * sizeof(IColumn::Offset));
if (!first)
{
@ -147,15 +147,15 @@ namespace
struct NoResultOffsetsBuilder
{
explicit NoResultOffsetsBuilder(IColumn::Offsets_t *) {}
explicit NoResultOffsetsBuilder(IColumn::Offsets *) {}
void reserve(ssize_t, size_t) {}
void insertOne(size_t) {}
template <size_t SIMD_BYTES>
void insertChunk(
const IColumn::Offset_t *,
const IColumn::Offset *,
bool,
IColumn::Offset_t,
IColumn::Offset,
size_t)
{
}
@ -164,8 +164,8 @@ namespace
template <typename T, typename ResultOffsetsBuilder>
void filterArraysImplGeneric(
const PaddedPODArray<T> & src_elems, const IColumn::Offsets_t & src_offsets,
PaddedPODArray<T> & res_elems, IColumn::Offsets_t * res_offsets,
const PaddedPODArray<T> & src_elems, const IColumn::Offsets & src_offsets,
PaddedPODArray<T> & res_elems, IColumn::Offsets * res_offsets,
const IColumn::Filter & filt, ssize_t result_size_hint)
{
const size_t size = src_offsets.size();
@ -191,7 +191,7 @@ namespace
const auto offsets_begin = offsets_pos;
/// copy array ending at *end_offset_ptr
const auto copy_array = [&] (const IColumn::Offset_t * offset_ptr)
const auto copy_array = [&] (const IColumn::Offset * offset_ptr)
{
const auto offset = offset_ptr == offsets_begin ? 0 : offset_ptr[-1];
const auto size = *offset_ptr - offset;
@ -259,8 +259,8 @@ namespace
template <typename T>
void filterArraysImpl(
const PaddedPODArray<T> & src_elems, const IColumn::Offsets_t & src_offsets,
PaddedPODArray<T> & res_elems, IColumn::Offsets_t & res_offsets,
const PaddedPODArray<T> & src_elems, const IColumn::Offsets & src_offsets,
PaddedPODArray<T> & res_elems, IColumn::Offsets & res_offsets,
const IColumn::Filter & filt, ssize_t result_size_hint)
{
return filterArraysImplGeneric<T, ResultOffsetsBuilder>(src_elems, src_offsets, res_elems, &res_offsets, filt, result_size_hint);
@ -268,7 +268,7 @@ void filterArraysImpl(
template <typename T>
void filterArraysImplOnlyData(
const PaddedPODArray<T> & src_elems, const IColumn::Offsets_t & src_offsets,
const PaddedPODArray<T> & src_elems, const IColumn::Offsets & src_offsets,
PaddedPODArray<T> & res_elems,
const IColumn::Filter & filt, ssize_t result_size_hint)
{
@ -279,11 +279,11 @@ void filterArraysImplOnlyData(
/// Explicit instantiations - not to place the implementation of the function above in the header file.
#define INSTANTIATE(TYPE) \
template void filterArraysImpl<TYPE>( \
const PaddedPODArray<TYPE> &, const IColumn::Offsets_t &, \
PaddedPODArray<TYPE> &, IColumn::Offsets_t &, \
const PaddedPODArray<TYPE> &, const IColumn::Offsets &, \
PaddedPODArray<TYPE> &, IColumn::Offsets &, \
const IColumn::Filter &, ssize_t); \
template void filterArraysImplOnlyData<TYPE>( \
const PaddedPODArray<TYPE> &, const IColumn::Offsets_t &, \
const PaddedPODArray<TYPE> &, const IColumn::Offsets &, \
PaddedPODArray<TYPE> &, \
const IColumn::Filter &, ssize_t);

View File

@ -18,14 +18,14 @@ bool memoryIsZero(const void * data, size_t size);
/// The general implementation of `filter` function for ColumnArray and ColumnString.
template <typename T>
void filterArraysImpl(
const PaddedPODArray<T> & src_elems, const IColumn::Offsets_t & src_offsets,
PaddedPODArray<T> & res_elems, IColumn::Offsets_t & res_offsets,
const PaddedPODArray<T> & src_elems, const IColumn::Offsets & src_offsets,
PaddedPODArray<T> & res_elems, IColumn::Offsets & res_offsets,
const IColumn::Filter & filt, ssize_t result_size_hint);
/// Same as above, but not fills res_offsets.
template <typename T>
void filterArraysImplOnlyData(
const PaddedPODArray<T> & src_elems, const IColumn::Offsets_t & src_offsets,
const PaddedPODArray<T> & src_elems, const IColumn::Offsets & src_offsets,
PaddedPODArray<T> & res_elems,
const IColumn::Filter & filt, ssize_t result_size_hint);

View File

@ -200,9 +200,9 @@ public:
* (i-th element should be copied offsets[i] - offsets[i - 1] times.)
* It is necessary in ARRAY JOIN operation.
*/
using Offset_t = UInt64;
using Offsets_t = PaddedPODArray<Offset_t>;
virtual MutablePtr replicate(const Offsets_t & offsets) const = 0;
using Offset = UInt64;
using Offsets = PaddedPODArray<Offset>;
virtual MutablePtr replicate(const Offsets & offsets) const = 0;
/** Split column to smaller columns. Each value goes to column index, selected by corresponding element of 'selector'.
* Selector must contain values from 0 to num_columns - 1.

View File

@ -94,7 +94,7 @@ public:
res[i] = i;
}
MutableColumnPtr replicate(const Offsets_t & offsets) const override
MutableColumnPtr replicate(const Offsets & offsets) const override
{
if (s != offsets.size())
throw Exception("Size of offsets doesn't match size of column.", ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH);

View File

@ -166,6 +166,8 @@ public:
insert(from_begin, from_end);
}
PODArray(std::initializer_list<T> il) : PODArray(std::begin(il), std::end(il)) {}
~PODArray()
{
dealloc();

View File

@ -204,7 +204,7 @@ void TotalsHavingBlockInputStream::addToTotals(MutableColumns & totals, const Bl
/// Accumulate all aggregate states into that value.
const ColumnAggregateFunction::Container_t & vec = column->getData();
const ColumnAggregateFunction::Container & vec = column->getData();
size_t size = vec.size();
if (filter)

View File

@ -30,17 +30,13 @@ try
ColumnWithTypeAndName column1;
column1.name = "Sign";
column1.type = std::make_shared<DataTypeInt8>();
column1.column = ColumnInt8::create();
column1.column->insert(DB::Int64(1));
column1.column->insert(DB::Int64(-1));
column1.column = ColumnInt8::create(std::initializer_list{1, -1});
block1.insert(column1);
ColumnWithTypeAndName column2;
column2.name = "CounterID";
column2.type = std::make_shared<DataTypeUInt32>();
column2.column = ColumnUInt32::create();
column2.column->insert(DB::UInt64(123));
column2.column->insert(DB::UInt64(123));
column2.column = ColumnUInt32::create(std::initializer_list{123, 123});
block1.insert(column2);
}
@ -50,17 +46,13 @@ try
ColumnWithTypeAndName column1;
column1.name = "Sign";
column1.type = std::make_shared<DataTypeInt8>();
column1.column = ColumnInt8::create();
column1.column->insert(DB::Int64(1));
column1.column->insert(DB::Int64(1));
column1.column = ColumnInt8::create(std::initializer_list{1, 1});
block2.insert(column1);
ColumnWithTypeAndName column2;
column2.name = "CounterID";
column2.type = std::make_shared<DataTypeUInt32>();
column2.column = ColumnUInt32::create();
column2.column->insert(DB::UInt64(123));
column2.column->insert(DB::UInt64(456));
column2.column = ColumnUInt32::create(std::initializer_list{123, 456});
block2.insert(column2);
}

View File

@ -98,10 +98,10 @@ void DataTypeAggregateFunction::deserializeBinary(IColumn & column, ReadBuffer &
void DataTypeAggregateFunction::serializeBinaryBulk(const IColumn & column, WriteBuffer & ostr, size_t offset, size_t limit) const
{
const ColumnAggregateFunction & real_column = typeid_cast<const ColumnAggregateFunction &>(column);
const ColumnAggregateFunction::Container_t & vec = real_column.getData();
const ColumnAggregateFunction::Container & vec = real_column.getData();
ColumnAggregateFunction::Container_t::const_iterator it = vec.begin() + offset;
ColumnAggregateFunction::Container_t::const_iterator end = limit ? it + limit : vec.end();
ColumnAggregateFunction::Container::const_iterator it = vec.begin() + offset;
ColumnAggregateFunction::Container::const_iterator end = limit ? it + limit : vec.end();
if (end > vec.end())
end = vec.end();
@ -113,7 +113,7 @@ void DataTypeAggregateFunction::serializeBinaryBulk(const IColumn & column, Writ
void DataTypeAggregateFunction::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double /*avg_value_size_hint*/) const
{
ColumnAggregateFunction & real_column = typeid_cast<ColumnAggregateFunction &>(column);
ColumnAggregateFunction::Container_t & vec = real_column.getData();
ColumnAggregateFunction::Container & vec = real_column.getData();
Arena & arena = real_column.createOrGetArena();
real_column.set(function);

View File

@ -56,7 +56,7 @@ void DataTypeArray::deserializeBinary(Field & field, ReadBuffer & istr) const
void DataTypeArray::serializeBinary(const IColumn & column, size_t row_num, WriteBuffer & ostr) const
{
const ColumnArray & column_array = static_cast<const ColumnArray &>(column);
const ColumnArray::Offsets_t & offsets = column_array.getOffsets();
const ColumnArray::Offsets & offsets = column_array.getOffsets();
size_t offset = row_num == 0 ? 0 : offsets[row_num - 1];
size_t next_offset = offsets[row_num];
@ -73,7 +73,7 @@ void DataTypeArray::serializeBinary(const IColumn & column, size_t row_num, Writ
void DataTypeArray::deserializeBinary(IColumn & column, ReadBuffer & istr) const
{
ColumnArray & column_array = static_cast<ColumnArray &>(column);
ColumnArray::Offsets_t & offsets = column_array.getOffsets();
ColumnArray::Offsets & offsets = column_array.getOffsets();
size_t size;
readVarUInt(size, istr);
@ -102,7 +102,7 @@ namespace
void serializeArraySizesPositionIndependent(const IColumn & column, WriteBuffer & ostr, size_t offset, size_t limit)
{
const ColumnArray & column_array = typeid_cast<const ColumnArray &>(column);
const ColumnArray::Offsets_t & offset_values = column_array.getOffsets();
const ColumnArray::Offsets & offset_values = column_array.getOffsets();
size_t size = offset_values.size();
if (!size)
@ -112,10 +112,10 @@ namespace
? offset + limit
: size;
ColumnArray::Offset_t prev_offset = offset == 0 ? 0 : offset_values[offset - 1];
ColumnArray::Offset prev_offset = offset == 0 ? 0 : offset_values[offset - 1];
for (size_t i = offset; i < end; ++i)
{
ColumnArray::Offset_t current_offset = offset_values[i];
ColumnArray::Offset current_offset = offset_values[i];
writeIntBinary(current_offset - prev_offset, ostr);
prev_offset = current_offset;
}
@ -124,15 +124,15 @@ namespace
void deserializeArraySizesPositionIndependent(IColumn & column, ReadBuffer & istr, size_t limit)
{
ColumnArray & column_array = typeid_cast<ColumnArray &>(column);
ColumnArray::Offsets_t & offset_values = column_array.getOffsets();
ColumnArray::Offsets & offset_values = column_array.getOffsets();
size_t initial_size = offset_values.size();
offset_values.resize(initial_size + limit);
size_t i = initial_size;
ColumnArray::Offset_t current_offset = initial_size ? offset_values[initial_size - 1] : 0;
ColumnArray::Offset current_offset = initial_size ? offset_values[initial_size - 1] : 0;
while (i < initial_size + limit && !istr.eof())
{
ColumnArray::Offset_t current_size = 0;
ColumnArray::Offset current_size = 0;
readIntBinary(current_size, istr);
current_offset += current_size;
offset_values[i] = current_offset;
@ -170,12 +170,12 @@ void DataTypeArray::serializeBinaryBulkWithMultipleStreams(
if (position_independent_encoding)
serializeArraySizesPositionIndependent(column, *stream, offset, limit);
else
DataTypeNumber<ColumnArray::Offset_t>().serializeBinaryBulk(*column_array.getOffsetsPtr(), *stream, offset, limit);
DataTypeNumber<ColumnArray::Offset>().serializeBinaryBulk(*column_array.getOffsetsPtr(), *stream, offset, limit);
}
/// Then serialize contents of arrays.
path.back() = Substream::ArrayElements;
const ColumnArray::Offsets_t & offset_values = column_array.getOffsets();
const ColumnArray::Offsets & offset_values = column_array.getOffsets();
if (offset > offset_values.size())
return;
@ -216,12 +216,12 @@ void DataTypeArray::deserializeBinaryBulkWithMultipleStreams(
if (position_independent_encoding)
deserializeArraySizesPositionIndependent(column, *stream, limit);
else
DataTypeNumber<ColumnArray::Offset_t>().deserializeBinaryBulk(*column_array.getOffsetsPtr(), *stream, limit, 0);
DataTypeNumber<ColumnArray::Offset>().deserializeBinaryBulk(*column_array.getOffsetsPtr(), *stream, limit, 0);
}
path.back() = Substream::ArrayElements;
ColumnArray::Offsets_t & offset_values = column_array.getOffsets();
ColumnArray::Offsets & offset_values = column_array.getOffsets();
IColumn & nested_column = column_array.getData();
/// Number of values corresponding with `offset_values` must be read.
@ -242,7 +242,7 @@ template <typename Writer>
static void serializeTextImpl(const IColumn & column, size_t row_num, WriteBuffer & ostr, Writer && write_nested)
{
const ColumnArray & column_array = static_cast<const ColumnArray &>(column);
const ColumnArray::Offsets_t & offsets = column_array.getOffsets();
const ColumnArray::Offsets & offsets = column_array.getOffsets();
size_t offset = row_num == 0 ? 0 : offsets[row_num - 1];
size_t next_offset = offsets[row_num];
@ -264,7 +264,7 @@ template <typename Reader>
static void deserializeTextImpl(IColumn & column, ReadBuffer & istr, Reader && read_nested)
{
ColumnArray & column_array = static_cast<ColumnArray &>(column);
ColumnArray::Offsets_t & offsets = column_array.getOffsets();
ColumnArray::Offsets & offsets = column_array.getOffsets();
IColumn & nested_column = column_array.getData();
@ -356,7 +356,7 @@ void DataTypeArray::deserializeTextQuoted(IColumn & column, ReadBuffer & istr) c
void DataTypeArray::serializeTextJSON(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettingsJSON & settings) const
{
const ColumnArray & column_array = static_cast<const ColumnArray &>(column);
const ColumnArray::Offsets_t & offsets = column_array.getOffsets();
const ColumnArray::Offsets & offsets = column_array.getOffsets();
size_t offset = row_num == 0 ? 0 : offsets[row_num - 1];
size_t next_offset = offsets[row_num];
@ -383,7 +383,7 @@ void DataTypeArray::deserializeTextJSON(IColumn & column, ReadBuffer & istr) con
void DataTypeArray::serializeTextXML(const IColumn & column, size_t row_num, WriteBuffer & ostr) const
{
const ColumnArray & column_array = static_cast<const ColumnArray &>(column);
const ColumnArray::Offsets_t & offsets = column_array.getOffsets();
const ColumnArray::Offsets & offsets = column_array.getOffsets();
size_t offset = row_num == 0 ? 0 : offsets[row_num - 1];
size_t next_offset = offsets[row_num];
@ -421,7 +421,7 @@ void DataTypeArray::deserializeTextCSV(IColumn & column, ReadBuffer & istr, cons
MutableColumnPtr DataTypeArray::createColumn() const
{
return ColumnArray::create(nested->createColumn(), ColumnArray::ColumnOffsets_t::create());
return ColumnArray::create(nested->createColumn(), ColumnArray::ColumnOffsets::create());
}

View File

@ -213,7 +213,7 @@ void DataTypeNumberBase<T>::deserializeBinary(IColumn & column, ReadBuffer & ist
template <typename T>
void DataTypeNumberBase<T>::serializeBinaryBulk(const IColumn & column, WriteBuffer & ostr, size_t offset, size_t limit) const
{
const typename ColumnVector<T>::Container_t & x = typeid_cast<const ColumnVector<T> &>(column).getData();
const typename ColumnVector<T>::Container & x = typeid_cast<const ColumnVector<T> &>(column).getData();
size_t size = x.size();
@ -226,7 +226,7 @@ void DataTypeNumberBase<T>::serializeBinaryBulk(const IColumn & column, WriteBuf
template <typename T>
void DataTypeNumberBase<T>::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double /*avg_value_size_hint*/) const
{
typename ColumnVector<T>::Container_t & x = typeid_cast<ColumnVector<T> &>(column).getData();
typename ColumnVector<T>::Container & x = typeid_cast<ColumnVector<T> &>(column).getData();
size_t initial_size = x.size();
x.resize(initial_size + limit);
size_t size = istr.readBig(reinterpret_cast<char*>(&x[initial_size]), sizeof(typename ColumnVector<T>::value_type) * limit);

View File

@ -53,7 +53,7 @@ void DataTypeString::deserializeBinary(IColumn & column, ReadBuffer & istr) cons
{
ColumnString & column_string = static_cast<ColumnString &>(column);
ColumnString::Chars_t & data = column_string.getChars();
ColumnString::Offsets_t & offsets = column_string.getOffsets();
ColumnString::Offsets & offsets = column_string.getOffsets();
UInt64 size;
readVarUInt(size, istr);
@ -81,7 +81,7 @@ void DataTypeString::serializeBinaryBulk(const IColumn & column, WriteBuffer & o
{
const ColumnString & column_string = typeid_cast<const ColumnString &>(column);
const ColumnString::Chars_t & data = column_string.getChars();
const ColumnString::Offsets_t & offsets = column_string.getOffsets();
const ColumnString::Offsets & offsets = column_string.getOffsets();
size_t size = column.size();
if (!size)
@ -110,7 +110,7 @@ void DataTypeString::serializeBinaryBulk(const IColumn & column, WriteBuffer & o
template <int UNROLL_TIMES>
static NO_INLINE void deserializeBinarySSE2(ColumnString::Chars_t & data, ColumnString::Offsets_t & offsets, ReadBuffer & istr, size_t limit)
static NO_INLINE void deserializeBinarySSE2(ColumnString::Chars_t & data, ColumnString::Offsets & offsets, ReadBuffer & istr, size_t limit)
{
size_t offset = data.size();
for (size_t i = 0; i < limit; ++i)
@ -174,7 +174,7 @@ void DataTypeString::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr,
{
ColumnString & column_string = typeid_cast<ColumnString &>(column);
ColumnString::Chars_t & data = column_string.getChars();
ColumnString::Offsets_t & offsets = column_string.getOffsets();
ColumnString::Offsets & offsets = column_string.getOffsets();
double avg_chars_size;
@ -223,7 +223,7 @@ static inline void read(IColumn & column, Reader && reader)
{
ColumnString & column_string = static_cast<ColumnString &>(column);
ColumnString::Chars_t & data = column_string.getChars();
ColumnString::Offsets_t & offsets = column_string.getOffsets();
ColumnString::Offsets & offsets = column_string.getOffsets();
size_t old_chars_size = data.size();
size_t old_offsets_size = offsets.size();

View File

@ -25,7 +25,7 @@ try
{
auto column = ColumnString::create();
ColumnString::Chars_t & data = column->getChars();
ColumnString::Offsets_t & offsets = column->getOffsets();
ColumnString::Offsets & offsets = column->getOffsets();
data.resize(n * size);
offsets.resize(n);

View File

@ -13,7 +13,7 @@ int main(int, char **)
using namespace DB;
auto column = ColumnUInt64::create();
ColumnUInt64::Container_t & vec = column->getData();
ColumnUInt64::Container & vec = column->getData();
DataTypeUInt64 data_type;
Stopwatch stopwatch;

View File

@ -918,7 +918,7 @@ private:
auto col_res = ColumnVector<ResultType>::create();
typename ColumnVector<ResultType>::Container_t & vec_res = col_res->getData();
typename ColumnVector<ResultType>::Container & vec_res = col_res->getData();
vec_res.resize(col->getData().size());
UnaryOperationImpl<T0, Op<T0>>::vector(col->getData(), vec_res);

View File

@ -86,12 +86,12 @@ void FunctionArray::executeImpl(Block & block, const ColumnNumbers & arguments,
auto out = ColumnArray::create(elem_type->createColumn());
IColumn & out_data = out->getData();
IColumn::Offsets_t & out_offsets = out->getOffsets();
IColumn::Offsets & out_offsets = out->getOffsets();
out_data.reserve(block_size * num_elements);
out_offsets.resize(block_size);
IColumn::Offset_t current_offset = 0;
IColumn::Offset current_offset = 0;
for (size_t i = 0; i < block_size; ++i)
{
for (size_t j = 0; j < num_elements; ++j)
@ -163,14 +163,14 @@ struct ArrayElementNumImpl
*/
template <bool negative>
static void vectorConst(
const PaddedPODArray<T> & data, const ColumnArray::Offsets_t & offsets,
const ColumnArray::Offset_t index,
const PaddedPODArray<T> & data, const ColumnArray::Offsets & offsets,
const ColumnArray::Offset index,
PaddedPODArray<T> & result, ArrayImpl::NullMapBuilder & builder)
{
size_t size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -198,14 +198,14 @@ struct ArrayElementNumImpl
*/
template <typename TIndex>
static void vector(
const PaddedPODArray<T> & data, const ColumnArray::Offsets_t & offsets,
const PaddedPODArray<T> & data, const ColumnArray::Offsets & offsets,
const PaddedPODArray<TIndex> & indices,
PaddedPODArray<T> & result, ArrayImpl::NullMapBuilder & builder)
{
size_t size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -244,17 +244,17 @@ struct ArrayElementStringImpl
{
template <bool negative>
static void vectorConst(
const ColumnString::Chars_t & data, const ColumnArray::Offsets_t & offsets, const ColumnString::Offsets_t & string_offsets,
const ColumnArray::Offset_t index,
ColumnString::Chars_t & result_data, ColumnArray::Offsets_t & result_offsets,
const ColumnString::Chars_t & data, const ColumnArray::Offsets & offsets, const ColumnString::Offsets & string_offsets,
const ColumnArray::Offset index,
ColumnString::Chars_t & result_data, ColumnArray::Offsets & result_offsets,
ArrayImpl::NullMapBuilder & builder)
{
size_t size = offsets.size();
result_offsets.resize(size);
result_data.reserve(data.size());
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset_t current_result_offset = 0;
ColumnArray::Offset current_offset = 0;
ColumnArray::Offset current_result_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -267,11 +267,11 @@ struct ArrayElementStringImpl
if (builder)
builder.update(j);
ColumnArray::Offset_t string_pos = current_offset == 0 && adjusted_index == 0
ColumnArray::Offset string_pos = current_offset == 0 && adjusted_index == 0
? 0
: string_offsets[current_offset + adjusted_index - 1];
ColumnArray::Offset_t string_size = string_offsets[current_offset + adjusted_index] - string_pos;
ColumnArray::Offset string_size = string_offsets[current_offset + adjusted_index] - string_pos;
result_data.resize(current_result_offset + string_size);
memcpySmallAllowReadWriteOverflow15(&result_data[current_result_offset], &data[string_pos], string_size);
@ -298,17 +298,17 @@ struct ArrayElementStringImpl
*/
template <typename TIndex>
static void vector(
const ColumnString::Chars_t & data, const ColumnArray::Offsets_t & offsets, const ColumnString::Offsets_t & string_offsets,
const ColumnString::Chars_t & data, const ColumnArray::Offsets & offsets, const ColumnString::Offsets & string_offsets,
const PaddedPODArray<TIndex> & indices,
ColumnString::Chars_t & result_data, ColumnArray::Offsets_t & result_offsets,
ColumnString::Chars_t & result_data, ColumnArray::Offsets & result_offsets,
ArrayImpl::NullMapBuilder & builder)
{
size_t size = offsets.size();
result_offsets.resize(size);
result_data.reserve(data.size());
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset_t current_result_offset = 0;
ColumnArray::Offset current_offset = 0;
ColumnArray::Offset current_result_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -328,11 +328,11 @@ struct ArrayElementStringImpl
if (builder)
builder.update(j);
ColumnArray::Offset_t string_pos = current_offset == 0 && adjusted_index == 0
ColumnArray::Offset string_pos = current_offset == 0 && adjusted_index == 0
? 0
: string_offsets[current_offset + adjusted_index - 1];
ColumnArray::Offset_t string_size = string_offsets[current_offset + adjusted_index] - string_pos;
ColumnArray::Offset string_size = string_offsets[current_offset + adjusted_index] - string_pos;
result_data.resize(current_result_offset + string_size);
memcpySmallAllowReadWriteOverflow15(&result_data[current_result_offset], &data[string_pos], string_size);
@ -361,14 +361,14 @@ struct ArrayElementGenericImpl
{
template <bool negative>
static void vectorConst(
const IColumn & data, const ColumnArray::Offsets_t & offsets,
const ColumnArray::Offset_t index,
const IColumn & data, const ColumnArray::Offsets & offsets,
const ColumnArray::Offset index,
IColumn & result, ArrayImpl::NullMapBuilder & builder)
{
size_t size = offsets.size();
result.reserve(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -395,14 +395,14 @@ struct ArrayElementGenericImpl
*/
template <typename TIndex>
static void vector(
const IColumn & data, const ColumnArray::Offsets_t & offsets,
const IColumn & data, const ColumnArray::Offsets & offsets,
const PaddedPODArray<TIndex> & indices,
IColumn & result, ArrayImpl::NullMapBuilder & builder)
{
size_t size = offsets.size();
result.reserve(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -921,13 +921,13 @@ void FunctionArrayEnumerate::executeImpl(Block & block, const ColumnNumbers & ar
{
if (const ColumnArray * array = checkAndGetColumn<ColumnArray>(block.getByPosition(arguments[0]).column.get()))
{
const ColumnArray::Offsets_t & offsets = array->getOffsets();
const ColumnArray::Offsets & offsets = array->getOffsets();
auto res_nested = ColumnUInt32::create();
auto res_array = ColumnArray::create(res_nested, array->getOffsetsPtr());
block.getByPosition(result).column = res_array;
ColumnUInt32::Container_t & res_values = res_nested->getData();
ColumnUInt32::Container & res_values = res_nested->getData();
res_values.resize(array->getData().size());
size_t prev_off = 0;
for (size_t i = 0; i < offsets.size(); ++i)
@ -978,7 +978,7 @@ DataTypePtr FunctionArrayUniq::getReturnTypeImpl(const DataTypes & arguments) co
void FunctionArrayUniq::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result)
{
Columns array_columns(arguments.size());
const ColumnArray::Offsets_t * offsets = nullptr;
const ColumnArray::Offsets * offsets = nullptr;
ColumnRawPtrs data_columns(arguments.size());
ColumnRawPtrs original_data_columns(arguments.size());
ColumnRawPtrs null_maps(arguments.size());
@ -1003,7 +1003,7 @@ void FunctionArrayUniq::executeImpl(Block & block, const ColumnNumbers & argumen
array_columns[i] = array_ptr;
const ColumnArray::Offsets_t & offsets_i = array->getOffsets();
const ColumnArray::Offsets & offsets_i = array->getOffsets();
if (i == 0)
offsets = &offsets_i;
else if (offsets_i != *offsets)
@ -1029,7 +1029,7 @@ void FunctionArrayUniq::executeImpl(Block & block, const ColumnNumbers & argumen
auto res = ColumnUInt32::create();
block.getByPosition(result).column = res;
ColumnUInt32::Container_t & res_values = res->getData();
ColumnUInt32::Container & res_values = res->getData();
res_values.resize(offsets->size());
if (arguments.size() == 1)
@ -1057,7 +1057,7 @@ void FunctionArrayUniq::executeImpl(Block & block, const ColumnNumbers & argumen
}
template <typename T>
bool FunctionArrayUniq::executeNumber(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container_t & res_values)
bool FunctionArrayUniq::executeNumber(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container & res_values)
{
const IColumn * inner_col;
@ -1073,8 +1073,8 @@ bool FunctionArrayUniq::executeNumber(const ColumnArray * array, const IColumn *
const ColumnVector<T> * nested = checkAndGetColumn<ColumnVector<T>>(inner_col);
if (!nested)
return false;
const ColumnArray::Offsets_t & offsets = array->getOffsets();
const typename ColumnVector<T>::Container_t & values = nested->getData();
const ColumnArray::Offsets & offsets = array->getOffsets();
const typename ColumnVector<T>::Container & values = nested->getData();
using Set = ClearableHashSet<T, DefaultHash<T>, HashTableGrower<INITIAL_SIZE_DEGREE>,
HashTableAllocatorWithStackMemory<(1ULL << INITIAL_SIZE_DEGREE) * sizeof(T)>>;
@ -1104,7 +1104,7 @@ bool FunctionArrayUniq::executeNumber(const ColumnArray * array, const IColumn *
return true;
}
bool FunctionArrayUniq::executeString(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container_t & res_values)
bool FunctionArrayUniq::executeString(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container & res_values)
{
const IColumn * inner_col;
@ -1120,7 +1120,7 @@ bool FunctionArrayUniq::executeString(const ColumnArray * array, const IColumn *
const ColumnString * nested = checkAndGetColumn<ColumnString>(inner_col);
if (!nested)
return false;
const ColumnArray::Offsets_t & offsets = array->getOffsets();
const ColumnArray::Offsets & offsets = array->getOffsets();
using Set = ClearableHashSet<StringRef, StringRefHash, HashTableGrower<INITIAL_SIZE_DEGREE>,
HashTableAllocatorWithStackMemory<(1ULL << INITIAL_SIZE_DEGREE) * sizeof(StringRef)>>;
@ -1152,10 +1152,10 @@ bool FunctionArrayUniq::executeString(const ColumnArray * array, const IColumn *
bool FunctionArrayUniq::execute128bit(
const ColumnArray::Offsets_t & offsets,
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
const ColumnRawPtrs & null_maps,
ColumnUInt32::Container_t & res_values,
ColumnUInt32::Container & res_values,
bool has_nullable_columns)
{
size_t count = columns.size();
@ -1230,9 +1230,9 @@ bool FunctionArrayUniq::execute128bit(
}
void FunctionArrayUniq::executeHashed(
const ColumnArray::Offsets_t & offsets,
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
ColumnUInt32::Container_t & res_values)
ColumnUInt32::Container & res_values)
{
size_t count = columns.size();
@ -1286,7 +1286,7 @@ DataTypePtr FunctionArrayEnumerateUniq::getReturnTypeImpl(const DataTypes & argu
void FunctionArrayEnumerateUniq::executeImpl(Block & block, const ColumnNumbers & arguments, size_t result)
{
Columns array_columns(arguments.size());
const ColumnArray::Offsets_t * offsets = nullptr;
const ColumnArray::Offsets * offsets = nullptr;
ColumnRawPtrs data_columns(arguments.size());
ColumnRawPtrs original_data_columns(arguments.size());
ColumnRawPtrs null_maps(arguments.size());
@ -1309,7 +1309,7 @@ void FunctionArrayEnumerateUniq::executeImpl(Block & block, const ColumnNumbers
array = checkAndGetColumn<ColumnArray>(array_ptr.get());
}
array_columns[i] = array_ptr;
const ColumnArray::Offsets_t & offsets_i = array->getOffsets();
const ColumnArray::Offsets & offsets_i = array->getOffsets();
if (i == 0)
offsets = &offsets_i;
else if (offsets_i != *offsets)
@ -1336,7 +1336,7 @@ void FunctionArrayEnumerateUniq::executeImpl(Block & block, const ColumnNumbers
auto res_array = ColumnArray::create(res_nested, first_array->getOffsetsPtr());
block.getByPosition(result).column = res_array;
ColumnUInt32::Container_t & res_values = res_nested->getData();
ColumnUInt32::Container & res_values = res_nested->getData();
if (!offsets->empty())
res_values.resize(offsets->back());
@ -1366,7 +1366,7 @@ void FunctionArrayEnumerateUniq::executeImpl(Block & block, const ColumnNumbers
template <typename T>
bool FunctionArrayEnumerateUniq::executeNumber(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container_t & res_values)
bool FunctionArrayEnumerateUniq::executeNumber(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container & res_values)
{
const IColumn * inner_col;
@ -1382,8 +1382,8 @@ bool FunctionArrayEnumerateUniq::executeNumber(const ColumnArray * array, const
const ColumnVector<T> * nested = checkAndGetColumn<ColumnVector<T>>(inner_col);
if (!nested)
return false;
const ColumnArray::Offsets_t & offsets = array->getOffsets();
const typename ColumnVector<T>::Container_t & values = nested->getData();
const ColumnArray::Offsets & offsets = array->getOffsets();
const typename ColumnVector<T>::Container & values = nested->getData();
using ValuesToIndices = ClearableHashMap<T, UInt32, DefaultHash<T>, HashTableGrower<INITIAL_SIZE_DEGREE>,
HashTableAllocatorWithStackMemory<(1ULL << INITIAL_SIZE_DEGREE) * sizeof(T)>>;
@ -1411,7 +1411,7 @@ bool FunctionArrayEnumerateUniq::executeNumber(const ColumnArray * array, const
return true;
}
bool FunctionArrayEnumerateUniq::executeString(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container_t & res_values)
bool FunctionArrayEnumerateUniq::executeString(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container & res_values)
{
const IColumn * inner_col;
@ -1427,7 +1427,7 @@ bool FunctionArrayEnumerateUniq::executeString(const ColumnArray * array, const
const ColumnString * nested = checkAndGetColumn<ColumnString>(inner_col);
if (!nested)
return false;
const ColumnArray::Offsets_t & offsets = array->getOffsets();
const ColumnArray::Offsets & offsets = array->getOffsets();
size_t prev_off = 0;
using ValuesToIndices = ClearableHashMap<StringRef, UInt32, StringRefHash, HashTableGrower<INITIAL_SIZE_DEGREE>,
@ -1456,10 +1456,10 @@ bool FunctionArrayEnumerateUniq::executeString(const ColumnArray * array, const
}
bool FunctionArrayEnumerateUniq::execute128bit(
const ColumnArray::Offsets_t & offsets,
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
const ColumnRawPtrs & null_maps,
ColumnUInt32::Container_t & res_values,
ColumnUInt32::Container & res_values,
bool has_nullable_columns)
{
size_t count = columns.size();
@ -1519,9 +1519,9 @@ bool FunctionArrayEnumerateUniq::execute128bit(
}
void FunctionArrayEnumerateUniq::executeHashed(
const ColumnArray::Offsets_t & offsets,
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
ColumnUInt32::Container_t & res_values)
ColumnUInt32::Container & res_values)
{
size_t count = columns.size();
@ -1589,8 +1589,8 @@ namespace
template <typename T, bool nullable>
bool executeNumber(
const IColumn & src_data, const ColumnArray::Offsets_t & src_offsets,
IColumn & res_data_col, ColumnArray::Offsets_t & res_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_offsets,
IColumn & res_data_col, ColumnArray::Offsets & res_offsets,
const NullMap * src_null_map,
NullMap * res_null_map)
{
@ -1606,8 +1606,8 @@ namespace
if (nullable)
res_null_map->reserve(src_null_map->size());
ColumnArray::Offset_t src_prev_offset = 0;
ColumnArray::Offset_t res_prev_offset = 0;
ColumnArray::Offset src_prev_offset = 0;
ColumnArray::Offset res_prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
@ -1648,8 +1648,8 @@ namespace
template <bool nullable>
bool executeFixedString(
const IColumn & src_data, const ColumnArray::Offsets_t & src_offsets,
IColumn & res_data_col, ColumnArray::Offsets_t & res_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_offsets,
IColumn & res_data_col, ColumnArray::Offsets & res_offsets,
const NullMap * src_null_map,
NullMap * res_null_map)
{
@ -1670,8 +1670,8 @@ namespace
if (nullable)
res_null_map->reserve(src_null_map->size());
ColumnArray::Offset_t src_prev_offset = 0;
ColumnArray::Offset_t res_prev_offset = 0;
ColumnArray::Offset src_prev_offset = 0;
ColumnArray::Offset res_prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
@ -1715,19 +1715,19 @@ namespace
template <bool nullable>
bool executeString(
const IColumn & src_data, const ColumnArray::Offsets_t & src_array_offsets,
IColumn & res_data_col, ColumnArray::Offsets_t & res_array_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_array_offsets,
IColumn & res_data_col, ColumnArray::Offsets & res_array_offsets,
const NullMap * src_null_map,
NullMap * res_null_map)
{
if (const ColumnString * src_data_concrete = checkAndGetColumn<ColumnString>(&src_data))
{
const ColumnString::Offsets_t & src_string_offsets = src_data_concrete->getOffsets();
const ColumnString::Offsets & src_string_offsets = src_data_concrete->getOffsets();
auto concrete_res_string_offsets = typeid_cast<ColumnString *>(&res_data_col);
if (!concrete_res_string_offsets)
throw Exception{"Internal error", ErrorCodes::LOGICAL_ERROR};
ColumnString::Offsets_t & res_string_offsets = concrete_res_string_offsets->getOffsets();
ColumnString::Offsets & res_string_offsets = concrete_res_string_offsets->getOffsets();
const ColumnString::Chars_t & src_data = src_data_concrete->getChars();
@ -1744,11 +1744,11 @@ namespace
if (nullable)
res_null_map->reserve(src_null_map->size());
ColumnArray::Offset_t src_array_prev_offset = 0;
ColumnArray::Offset_t res_array_prev_offset = 0;
ColumnArray::Offset src_array_prev_offset = 0;
ColumnArray::Offset res_array_prev_offset = 0;
ColumnString::Offset_t src_string_prev_offset = 0;
ColumnString::Offset_t res_string_prev_offset = 0;
ColumnString::Offset src_string_prev_offset = 0;
ColumnString::Offset res_string_prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
@ -1811,8 +1811,8 @@ namespace
template <bool nullable>
void executeGeneric(
const IColumn & src_data, const ColumnArray::Offsets_t & src_offsets,
IColumn & res_data, ColumnArray::Offsets_t & res_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_offsets,
IColumn & res_data, ColumnArray::Offsets & res_offsets,
const NullMap * src_null_map,
NullMap * res_null_map)
{
@ -1823,8 +1823,8 @@ namespace
if (nullable)
res_null_map->reserve(src_null_map->size());
ColumnArray::Offset_t src_prev_offset = 0;
ColumnArray::Offset_t res_prev_offset = 0;
ColumnArray::Offset src_prev_offset = 0;
ColumnArray::Offset res_prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
@ -1859,8 +1859,8 @@ namespace
template <bool nullable>
void executeDispatch(
const IColumn & src_data, const ColumnArray::Offsets_t & src_array_offsets,
IColumn & res_data_col, ColumnArray::Offsets_t & res_array_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_array_offsets,
IColumn & res_data_col, ColumnArray::Offsets & res_array_offsets,
const NullMap * src_null_map,
NullMap * res_null_map)
{
@ -1896,9 +1896,9 @@ void FunctionEmptyArrayToSingle::executeImpl(Block & block, const ColumnNumbers
ColumnArray & res = static_cast<ColumnArray &>(*res_ptr);
const IColumn & src_data = array->getData();
const ColumnArray::Offsets_t & src_offsets = array->getOffsets();
const ColumnArray::Offsets & src_offsets = array->getOffsets();
IColumn & res_data = res.getData();
ColumnArray::Offsets_t & res_offsets = res.getOffsets();
ColumnArray::Offsets & res_offsets = res.getOffsets();
const NullMap * src_null_map = nullptr;
NullMap * res_null_map = nullptr;
@ -1978,13 +1978,13 @@ bool FunctionRange::executeInternal(Block & block, const IColumn * arg, const si
const auto data_col = ColumnVector<T>::create(total_values);
const auto out = ColumnArray::create(
data_col,
std::make_shared<ColumnArray::ColumnOffsets_t>(in->size()));
std::make_shared<ColumnArray::ColumnOffsets>(in->size()));
block.getByPosition(result).column = out;
auto & out_data = data_col->getData();
auto & out_offsets = out->getOffsets();
IColumn::Offset_t offset{};
IColumn::Offset offset{};
for (size_t row_idx = 0, rows = in->size(); row_idx < rows; ++row_idx)
{
for (size_t elem_idx = 0, elems = in_data[row_idx]; elem_idx < elems; ++elem_idx)
@ -2014,13 +2014,13 @@ bool FunctionRange::executeInternal(Block & block, const IColumn * arg, const si
const auto data_col = ColumnVector<T>::create(total_values);
const auto out = ColumnArray::create(
data_col,
std::make_shared<ColumnArray::ColumnOffsets_t>(in->size()));
std::make_shared<ColumnArray::ColumnOffsets>(in->size()));
block.getByPosition(result).column = out;
auto & out_data = data_col->getData();
auto & out_offsets = out->getOffsets();
IColumn::Offset_t offset{};
IColumn::Offset offset{};
for (size_t row_idx = 0, rows = in->size(); row_idx < rows; ++row_idx)
{
for (size_t elem_idx = 0, elems = in_data; elem_idx < elems; ++elem_idx)
@ -2088,7 +2088,7 @@ void FunctionArrayReverse::executeImpl(Block & block, const ColumnNumbers & argu
ColumnArray & res = static_cast<ColumnArray &>(*res_ptr);
const IColumn & src_data = array->getData();
const ColumnArray::Offsets_t & offsets = array->getOffsets();
const ColumnArray::Offsets & offsets = array->getOffsets();
IColumn & res_data = res.getData();
res.getOffsetsPtr() = array->getOffsetsPtr();
@ -2151,7 +2151,7 @@ bool FunctionArrayReverse::executeConst(Block & block, const ColumnNumbers & arg
template <typename T>
bool FunctionArrayReverse::executeNumber(
const IColumn & src_data, const ColumnArray::Offsets_t & src_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_offsets,
IColumn & res_data_col,
const ColumnNullable * nullable_col,
ColumnNullable * nullable_res_col)
@ -2159,7 +2159,7 @@ bool FunctionArrayReverse::executeNumber(
auto do_reverse = [](const auto & src_data, const auto & src_offsets, auto & res_data)
{
size_t size = src_offsets.size();
ColumnArray::Offset_t src_prev_offset = 0;
ColumnArray::Offset src_prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
@ -2205,7 +2205,7 @@ bool FunctionArrayReverse::executeNumber(
}
bool FunctionArrayReverse::executeFixedString(
const IColumn & src_data, const ColumnArray::Offsets_t & src_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_offsets,
IColumn & res_data_col,
const ColumnNullable * nullable_col,
ColumnNullable * nullable_res_col)
@ -2218,7 +2218,7 @@ bool FunctionArrayReverse::executeFixedString(
size_t size = src_offsets.size();
res_data.resize(src_data.size());
ColumnArray::Offset_t src_prev_offset = 0;
ColumnArray::Offset src_prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
@ -2248,7 +2248,7 @@ bool FunctionArrayReverse::executeFixedString(
auto & res_null_map = static_cast<ColumnUInt8 &>(nullable_res_col->getNullMapColumn()).getData();
res_null_map.resize(src_null_map.size());
ColumnArray::Offset_t src_prev_offset = 0;
ColumnArray::Offset src_prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
@ -2278,15 +2278,15 @@ bool FunctionArrayReverse::executeFixedString(
}
bool FunctionArrayReverse::executeString(
const IColumn & src_data, const ColumnArray::Offsets_t & src_array_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_array_offsets,
IColumn & res_data_col,
const ColumnNullable * nullable_col,
ColumnNullable * nullable_res_col)
{
if (const ColumnString * src_data_concrete = checkAndGetColumn<ColumnString>(&src_data))
{
const ColumnString::Offsets_t & src_string_offsets = src_data_concrete->getOffsets();
ColumnString::Offsets_t & res_string_offsets = typeid_cast<ColumnString &>(res_data_col).getOffsets();
const ColumnString::Offsets & src_string_offsets = src_data_concrete->getOffsets();
ColumnString::Offsets & res_string_offsets = typeid_cast<ColumnString &>(res_data_col).getOffsets();
const ColumnString::Chars_t & src_data = src_data_concrete->getChars();
ColumnString::Chars_t & res_data = typeid_cast<ColumnString &>(res_data_col).getChars();
@ -2295,8 +2295,8 @@ bool FunctionArrayReverse::executeString(
res_string_offsets.resize(src_string_offsets.size());
res_data.resize(src_data.size());
ColumnArray::Offset_t src_array_prev_offset = 0;
ColumnString::Offset_t res_string_prev_offset = 0;
ColumnArray::Offset src_array_prev_offset = 0;
ColumnString::Offset res_string_prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
@ -2329,7 +2329,7 @@ bool FunctionArrayReverse::executeString(
res_null_map.resize(src_string_offsets.size());
size_t size = src_string_offsets.size();
ColumnArray::Offset_t src_prev_offset = 0;
ColumnArray::Offset src_prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
@ -2459,7 +2459,7 @@ void FunctionArrayReduce::executeImpl(Block & block, const ColumnNumbers & argum
}
const IColumn ** aggregate_arguments = aggregate_arguments_vec.data();
const ColumnArray::Offsets_t & offsets = typeid_cast<const ColumnArray &>(!materialized_columns.empty()
const ColumnArray::Offsets & offsets = typeid_cast<const ColumnArray &>(!materialized_columns.empty()
? *materialized_columns.front().get()
: *block.getByPosition(arguments[1]).column.get()).getOffsets();
@ -2474,11 +2474,11 @@ void FunctionArrayReduce::executeImpl(Block & block, const ColumnNumbers & argum
throw Exception("State function " + agg_func.getName() + " inserts results into non-state column "
+ block.getByPosition(result).type->getName(), ErrorCodes::ILLEGAL_COLUMN);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < rows; ++i)
{
agg_func.create(place);
ColumnArray::Offset_t next_offset = offsets[i];
ColumnArray::Offset next_offset = offsets[i];
try
{
@ -2772,7 +2772,7 @@ void FunctionArrayPush::executeImpl(Block & block, const ColumnNumbers & argumen
appended_column = const_appended_column->getDataColumnPtr();
}
auto offsets = std::make_shared<ColumnArray::ColumnOffsets_t>(appended_column->size());
auto offsets = std::make_shared<ColumnArray::ColumnOffsets>(appended_column->size());
for (size_t i : ext::range(0, offsets->size()))
offsets->getElement(i) = i + 1;

View File

@ -210,14 +210,14 @@ private:
/// Both function arguments are ordinary.
template <typename ScalarOrVector>
static void vectorCase1(
const PaddedPODArray<T> & data, const ColumnArray::Offsets_t & offsets,
const PaddedPODArray<T> & data, const ColumnArray::Offsets & offsets,
const ScalarOrVector & value,
PaddedPODArray<typename IndexConv::ResultType> & result)
{
size_t size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -240,7 +240,7 @@ private:
/// The 2nd function argument is nullable.
template <typename ScalarOrVector>
static void vectorCase2(
const PaddedPODArray<T> & data, const ColumnArray::Offsets_t & offsets,
const PaddedPODArray<T> & data, const ColumnArray::Offsets & offsets,
const ScalarOrVector & value,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> & null_map_item)
@ -248,7 +248,7 @@ private:
size_t size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -271,7 +271,7 @@ private:
/// The 1st function argument is a non-constant array of nullable values.
template <typename ScalarOrVector>
static void vectorCase3(
const PaddedPODArray<T> & data, const ColumnArray::Offsets_t & offsets,
const PaddedPODArray<T> & data, const ColumnArray::Offsets & offsets,
const ScalarOrVector & value,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> & null_map_data)
@ -279,7 +279,7 @@ private:
size_t size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -306,7 +306,7 @@ private:
/// The 2nd function argument is nullable.
template <typename ScalarOrVector>
static void vectorCase4(
const PaddedPODArray<T> & data, const ColumnArray::Offsets_t & offsets,
const PaddedPODArray<T> & data, const ColumnArray::Offsets & offsets,
const ScalarOrVector & value,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> & null_map_data,
@ -315,7 +315,7 @@ private:
size_t size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -347,7 +347,7 @@ private:
public:
template <typename ScalarOrVector>
static void vector(
const PaddedPODArray<T> & data, const ColumnArray::Offsets_t & offsets,
const PaddedPODArray<T> & data, const ColumnArray::Offsets & offsets,
const ScalarOrVector & value,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> * null_map_data,
@ -371,7 +371,7 @@ struct ArrayIndexNumImpl<T, Null, IndexConv>
{
template <typename ScalarOrVector>
static void vector(
const PaddedPODArray<T> &, const ColumnArray::Offsets_t &,
const PaddedPODArray<T> &, const ColumnArray::Offsets &,
const ScalarOrVector &,
PaddedPODArray<typename IndexConv::ResultType> &,
const PaddedPODArray<UInt8> *,
@ -387,7 +387,7 @@ template <typename T, typename IndexConv>
struct ArrayIndexNumNullImpl
{
static void vector(
const PaddedPODArray<T> & /*data*/, const ColumnArray::Offsets_t & offsets,
const PaddedPODArray<T> & /*data*/, const ColumnArray::Offsets & offsets,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> * null_map_data)
{
@ -399,7 +399,7 @@ struct ArrayIndexNumNullImpl
const auto & null_map_ref = *null_map_data;
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -426,7 +426,7 @@ template <typename IndexConv>
struct ArrayIndexStringNullImpl
{
static void vector_const(
const ColumnString::Chars_t & /*data*/, const ColumnArray::Offsets_t & offsets, const ColumnString::Offsets_t & /*string_offsets*/,
const ColumnString::Chars_t & /*data*/, const ColumnArray::Offsets & offsets, const ColumnString::Offsets & /*string_offsets*/,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> * null_map_data)
{
@ -438,7 +438,7 @@ struct ArrayIndexStringNullImpl
const auto & null_map_ref = *null_map_data;
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
const auto array_size = offsets[i] - current_offset;
@ -464,7 +464,7 @@ template <typename IndexConv>
struct ArrayIndexStringImpl
{
static void vector_const(
const ColumnString::Chars_t & data, const ColumnArray::Offsets_t & offsets, const ColumnString::Offsets_t & string_offsets,
const ColumnString::Chars_t & data, const ColumnArray::Offsets & offsets, const ColumnString::Offsets & string_offsets,
const String & value,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> * null_map_data)
@ -473,7 +473,7 @@ struct ArrayIndexStringImpl
const auto value_size = value.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
const auto array_size = offsets[i] - current_offset;
@ -481,11 +481,11 @@ struct ArrayIndexStringImpl
for (size_t j = 0; j < array_size; ++j)
{
ColumnArray::Offset_t string_pos = current_offset == 0 && j == 0
ColumnArray::Offset string_pos = current_offset == 0 && j == 0
? 0
: string_offsets[current_offset + j - 1];
ColumnArray::Offset_t string_size = string_offsets[current_offset + j] - string_pos;
ColumnArray::Offset string_size = string_offsets[current_offset + j] - string_pos;
size_t k = (current_offset == 0 && j == 0) ? 0 : current_offset + j - 1;
if (null_map_data && ((*null_map_data)[k] == 1))
@ -504,8 +504,8 @@ struct ArrayIndexStringImpl
}
static void vector_vector(
const ColumnString::Chars_t & data, const ColumnArray::Offsets_t & offsets, const ColumnString::Offsets_t & string_offsets,
const ColumnString::Chars_t & item_values, const ColumnString::Offsets_t & item_offsets,
const ColumnString::Chars_t & data, const ColumnArray::Offsets & offsets, const ColumnString::Offsets & string_offsets,
const ColumnString::Chars_t & item_values, const ColumnString::Offsets & item_offsets,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> * null_map_data,
const PaddedPODArray<UInt8> * null_map_item)
@ -513,7 +513,7 @@ struct ArrayIndexStringImpl
const auto size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
const auto array_size = offsets[i] - current_offset;
@ -523,11 +523,11 @@ struct ArrayIndexStringImpl
for (size_t j = 0; j < array_size; ++j)
{
ColumnArray::Offset_t string_pos = current_offset == 0 && j == 0
ColumnArray::Offset string_pos = current_offset == 0 && j == 0
? 0
: string_offsets[current_offset + j - 1];
ColumnArray::Offset_t string_size = string_offsets[current_offset + j] - string_pos;
ColumnArray::Offset string_size = string_offsets[current_offset + j] - string_pos;
bool hit = false;
size_t k = (current_offset == 0 && j == 0) ? 0 : current_offset + j - 1;
@ -562,14 +562,14 @@ struct ArrayIndexGenericImpl
private:
/// Both function arguments are ordinary.
static void vectorCase1(
const IColumn & data, const ColumnArray::Offsets_t & offsets,
const IColumn & data, const ColumnArray::Offsets & offsets,
const IColumn & value,
PaddedPODArray<typename IndexConv::ResultType> & result)
{
size_t size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -591,7 +591,7 @@ private:
/// The 2nd function argument is nullable.
static void vectorCase2(
const IColumn & data, const ColumnArray::Offsets_t & offsets,
const IColumn & data, const ColumnArray::Offsets & offsets,
const IColumn & value,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> & null_map_item)
@ -599,7 +599,7 @@ private:
size_t size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -622,7 +622,7 @@ private:
/// The 1st function argument is a non-constant array of nullable values.
static void vectorCase3(
const IColumn & data, const ColumnArray::Offsets_t & offsets,
const IColumn & data, const ColumnArray::Offsets & offsets,
const IColumn & value,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> & null_map_data)
@ -630,7 +630,7 @@ private:
size_t size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -656,7 +656,7 @@ private:
/// The 1st function argument is a non-constant array of nullable values.
/// The 2nd function argument is nullable.
static void vectorCase4(
const IColumn & data, const ColumnArray::Offsets_t & offsets,
const IColumn & data, const ColumnArray::Offsets & offsets,
const IColumn & value,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> & null_map_data,
@ -665,7 +665,7 @@ private:
size_t size = offsets.size();
result.resize(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -693,7 +693,7 @@ private:
public:
static void vector(
const IColumn & data, const ColumnArray::Offsets_t & offsets,
const IColumn & data, const ColumnArray::Offsets & offsets,
const IColumn & value,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> * null_map_data,
@ -717,7 +717,7 @@ template <typename IndexConv>
struct ArrayIndexGenericNullImpl
{
static void vector(
const IColumn & /*data*/, const ColumnArray::Offsets_t & offsets,
const IColumn & /*data*/, const ColumnArray::Offsets & offsets,
PaddedPODArray<typename IndexConv::ResultType> & result,
const PaddedPODArray<UInt8> * null_map_data)
{
@ -729,7 +729,7 @@ struct ArrayIndexGenericNullImpl
const auto & null_map_ref = *null_map_data;
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
size_t array_size = offsets[i] - current_offset;
@ -1213,21 +1213,21 @@ private:
static constexpr size_t INITIAL_SIZE_DEGREE = 9;
template <typename T>
bool executeNumber(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container_t & res_values);
bool executeNumber(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container & res_values);
bool executeString(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container_t & res_values);
bool executeString(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container & res_values);
bool execute128bit(
const ColumnArray::Offsets_t & offsets,
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
const ColumnRawPtrs & null_maps,
ColumnUInt32::Container_t & res_values,
ColumnUInt32::Container & res_values,
bool has_nullable_columns);
void executeHashed(
const ColumnArray::Offsets_t & offsets,
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
ColumnUInt32::Container_t & res_values);
ColumnUInt32::Container & res_values);
};
@ -1252,21 +1252,21 @@ private:
static constexpr size_t INITIAL_SIZE_DEGREE = 9;
template <typename T>
bool executeNumber(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container_t & res_values);
bool executeNumber(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container & res_values);
bool executeString(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container_t & res_values);
bool executeString(const ColumnArray * array, const IColumn * null_map, ColumnUInt32::Container & res_values);
bool execute128bit(
const ColumnArray::Offsets_t & offsets,
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
const ColumnRawPtrs & null_maps,
ColumnUInt32::Container_t & res_values,
ColumnUInt32::Container & res_values,
bool has_nullable_columns);
void executeHashed(
const ColumnArray::Offsets_t & offsets,
const ColumnArray::Offsets & offsets,
const ColumnRawPtrs & columns,
ColumnUInt32::Container_t & res_values);
ColumnUInt32::Container & res_values);
};
@ -1303,7 +1303,7 @@ private:
block.getByPosition(result).column = ColumnArray::create(
std::make_shared<UnderlyingColumnType>(),
std::make_shared<ColumnArray::ColumnOffsets_t>(block.rows(), 0));
std::make_shared<ColumnArray::ColumnOffsets>(block.rows(), 0));
}
};
@ -1368,19 +1368,19 @@ private:
template <typename T>
bool executeNumber(
const IColumn & src_data, const ColumnArray::Offsets_t & src_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_offsets,
IColumn & res_data_col,
const ColumnNullable * nullable_col,
ColumnNullable * nullable_res_col);
bool executeFixedString(
const IColumn & src_data, const ColumnArray::Offsets_t & src_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_offsets,
IColumn & res_data_col,
const ColumnNullable * nullable_col,
ColumnNullable * nullable_res_col);
bool executeString(
const IColumn & src_data, const ColumnArray::Offsets_t & src_array_offsets,
const IColumn & src_data, const ColumnArray::Offsets & src_array_offsets,
IColumn & res_data_col,
const ColumnNullable * nullable_col,
ColumnNullable * nullable_res_col);

View File

@ -84,14 +84,14 @@ private:
}
void convert(const String & from_charset, const String & to_charset,
const ColumnString::Chars_t & from_chars, const ColumnString::Offsets_t & from_offsets,
ColumnString::Chars_t & to_chars, ColumnString::Offsets_t & to_offsets)
const ColumnString::Chars_t & from_chars, const ColumnString::Offsets & from_offsets,
ColumnString::Chars_t & to_chars, ColumnString::Offsets & to_offsets)
{
auto converter_from = getConverter(from_charset);
auto converter_to = getConverter(to_charset);
ColumnString::Offset_t current_from_offset = 0;
ColumnString::Offset_t current_to_offset = 0;
ColumnString::Offset current_from_offset = 0;
ColumnString::Offset current_to_offset = 0;
size_t size = from_offsets.size();
to_offsets.resize(size);

View File

@ -107,7 +107,7 @@ public:
block.getByPosition(result).column = col_res;
ColumnString::Chars_t & vec_res = col_res->getChars();
ColumnString::Offsets_t & offsets_res = col_res->getOffsets();
ColumnString::Offsets & offsets_res = col_res->getOffsets();
vec_res.resize(size * (IPV6_MAX_TEXT_LENGTH + 1));
offsets_res.resize(size);
@ -215,7 +215,7 @@ public:
block.getByPosition(result).column = col_res;
ColumnString::Chars_t & vec_res = col_res->getChars();
ColumnString::Offsets_t & offsets_res = col_res->getOffsets();
ColumnString::Offsets & offsets_res = col_res->getOffsets();
vec_res.resize(size * (IPV6_MAX_TEXT_LENGTH + 1));
offsets_res.resize(size);
@ -425,7 +425,7 @@ public:
vec_res.resize(col_in->size() * ipv6_bytes_length);
const ColumnString::Chars_t & vec_src = col_in->getChars();
const ColumnString::Offsets_t & offsets_src = col_in->getOffsets();
const ColumnString::Offsets & offsets_src = col_in->getOffsets();
size_t src_offset = 0;
for (size_t out_offset = 0, i = 0;
@ -531,12 +531,12 @@ public:
if (const ColumnUInt32 * col = typeid_cast<const ColumnUInt32 *>(column.get()))
{
const ColumnUInt32::Container_t & vec_in = col->getData();
const ColumnUInt32::Container & vec_in = col->getData();
auto col_res = ColumnString::create();
ColumnString::Chars_t & vec_res = col_res->getChars();
ColumnString::Offsets_t & offsets_res = col_res->getOffsets();
ColumnString::Offsets & offsets_res = col_res->getOffsets();
vec_res.resize(vec_in.size() * (IPV4_MAX_TEXT_LENGTH + 1)); /// the longest value is: 255.255.255.255\0
offsets_res.resize(vec_in.size());
@ -617,11 +617,11 @@ public:
auto col_res = ColumnUInt32::create();
block.getByPosition(result).column = col_res;
ColumnUInt32::Container_t & vec_res = col_res->getData();
ColumnUInt32::Container & vec_res = col_res->getData();
vec_res.resize(col->size());
const ColumnString::Chars_t & vec_src = col->getChars();
const ColumnString::Offsets_t & offsets_src = col->getOffsets();
const ColumnString::Offsets & offsets_src = col->getOffsets();
size_t prev_offset = 0;
for (size_t i = 0; i < vec_res.size(); ++i)
@ -743,12 +743,12 @@ public:
if (const ColumnUInt64 * col = typeid_cast<const ColumnUInt64 *>(column.get()))
{
const ColumnUInt64::Container_t & vec_in = col->getData();
const ColumnUInt64::Container & vec_in = col->getData();
auto col_res = ColumnString::create();
ColumnString::Chars_t & vec_res = col_res->getChars();
ColumnString::Offsets_t & offsets_res = col_res->getOffsets();
ColumnString::Offsets & offsets_res = col_res->getOffsets();
vec_res.resize(vec_in.size() * 18); /// the value is: xx:xx:xx:xx:xx:xx\0
offsets_res.resize(vec_in.size());
@ -856,11 +856,11 @@ public:
auto col_res = ColumnUInt64::create();
block.getByPosition(result).column = col_res;
ColumnUInt64::Container_t & vec_res = col_res->getData();
ColumnUInt64::Container & vec_res = col_res->getData();
vec_res.resize(col->size());
const ColumnString::Chars_t & vec_src = col->getChars();
const ColumnString::Offsets_t & offsets_src = col->getOffsets();
const ColumnString::Offsets & offsets_src = col->getOffsets();
size_t prev_offset = 0;
for (size_t i = 0; i < vec_res.size(); ++i)
@ -934,7 +934,7 @@ public:
block.getByPosition(result).column = col_res;
ColumnString::Chars_t & vec_res = col_res->getChars();
ColumnString::Offsets_t & offsets_res = col_res->getOffsets();
ColumnString::Offsets & offsets_res = col_res->getOffsets();
vec_res.resize(size * (uuid_text_length + 1));
offsets_res.resize(size);
@ -1107,7 +1107,7 @@ public:
auto col_to = ColumnVector<UInt128>::create();
block.safeGetByPosition(result).column = col_to;
typename ColumnVector<UInt128>::Container_t & vec_to = col_to->getData();
typename ColumnVector<UInt128>::Container & vec_to = col_to->getData();
size_t size = block.rows();
vec_to.resize(size);
@ -1186,9 +1186,9 @@ public:
auto col_str = ColumnString::create();
col_res = col_str;
ColumnString::Chars_t & out_vec = col_str->getChars();
ColumnString::Offsets_t & out_offsets = col_str->getOffsets();
ColumnString::Offsets & out_offsets = col_str->getOffsets();
const typename ColumnVector<T>::Container_t & in_vec = col_vec->getData();
const typename ColumnVector<T>::Container & in_vec = col_vec->getData();
size_t size = in_vec.size();
out_offsets.resize(size);
@ -1240,10 +1240,10 @@ public:
auto col_str = ColumnString::create();
col_res = col_str;
ColumnString::Chars_t & out_vec = col_str->getChars();
ColumnString::Offsets_t & out_offsets = col_str->getOffsets();
ColumnString::Offsets & out_offsets = col_str->getOffsets();
const ColumnString::Chars_t & in_vec = col_str_in->getChars();
const ColumnString::Offsets_t & in_offsets = col_str_in->getOffsets();
const ColumnString::Offsets & in_offsets = col_str_in->getOffsets();
size_t size = in_offsets.size();
out_offsets.resize(size);
@ -1286,7 +1286,7 @@ public:
col_res = col_str;
ColumnString::Chars_t & out_vec = col_str->getChars();
ColumnString::Offsets_t & out_offsets = col_str->getOffsets();
ColumnString::Offsets & out_offsets = col_str->getOffsets();
const ColumnString::Chars_t & in_vec = col_fstr_in->getChars();
@ -1397,10 +1397,10 @@ public:
auto col_res = ColumnString::create();
ColumnString::Chars_t & out_vec = col_res->getChars();
ColumnString::Offsets_t & out_offsets = col_res->getOffsets();
ColumnString::Offsets & out_offsets = col_res->getOffsets();
const ColumnString::Chars_t & in_vec = col->getChars();
const ColumnString::Offsets_t & in_offsets = col->getOffsets();
const ColumnString::Offsets & in_offsets = col->getOffsets();
size_t size = in_offsets.size();
out_offsets.resize(size);
@ -1469,10 +1469,10 @@ public:
auto col_array = ColumnArray::create(col_values);
out_column = col_array;
ColumnArray::Offsets_t & res_offsets = col_array->getOffsets();
typename ColumnVector<T>::Container_t & res_values = col_values->getData();
ColumnArray::Offsets & res_offsets = col_array->getOffsets();
typename ColumnVector<T>::Container & res_values = col_values->getData();
const typename ColumnVector<T>::Container_t & vec_from = col_from->getData();
const typename ColumnVector<T>::Container & vec_from = col_from->getData();
size_t size = vec_from.size();
res_offsets.resize(size);
res_values.reserve(size * 2);
@ -1552,10 +1552,10 @@ public:
auto col_str = ColumnString::create();
col_res = col_str;
ColumnString::Chars_t & out_vec = col_str->getChars();
ColumnString::Offsets_t & out_offsets = col_str->getOffsets();
ColumnString::Offsets & out_offsets = col_str->getOffsets();
const ColumnString::Chars_t & in_vec = col_str_in->getChars();
const ColumnString::Offsets_t & in_offsets = col_str_in->getOffsets();
const ColumnString::Offsets & in_offsets = col_str_in->getOffsets();
size_t size = in_offsets.size();
out_offsets.resize(size);
@ -1564,7 +1564,7 @@ public:
char * begin = reinterpret_cast<char *>(&out_vec[0]);
char * pos = begin;
ColumnString::Offset_t current_in_offset = 0;
ColumnString::Offset current_in_offset = 0;
for (size_t i = 0; i < size; ++i)
{
@ -1600,7 +1600,7 @@ public:
col_res = col_str;
ColumnString::Chars_t & out_vec = col_str->getChars();
ColumnString::Offsets_t & out_offsets = col_str->getOffsets();
ColumnString::Offsets & out_offsets = col_str->getOffsets();
const ColumnString::Chars_t & in_vec = col_fstr_in->getChars();

View File

@ -171,8 +171,8 @@ template <typename Op>
struct StringComparisonImpl
{
static void NO_INLINE string_vector_string_vector(
const ColumnString::Chars_t & a_data, const ColumnString::Offsets_t & a_offsets,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets_t & b_offsets,
const ColumnString::Chars_t & a_data, const ColumnString::Offsets & a_offsets,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets & b_offsets,
PaddedPODArray<UInt8> & c)
{
size_t size = a_offsets.size();
@ -201,8 +201,8 @@ struct StringComparisonImpl
}
static void NO_INLINE string_vector_fixed_string_vector(
const ColumnString::Chars_t & a_data, const ColumnString::Offsets_t & a_offsets,
const ColumnString::Chars_t & b_data, ColumnString::Offset_t b_n,
const ColumnString::Chars_t & a_data, const ColumnString::Offsets & a_offsets,
const ColumnString::Chars_t & b_data, ColumnString::Offset b_n,
PaddedPODArray<UInt8> & c)
{
size_t size = a_offsets.size();
@ -223,12 +223,12 @@ struct StringComparisonImpl
}
static void NO_INLINE string_vector_constant(
const ColumnString::Chars_t & a_data, const ColumnString::Offsets_t & a_offsets,
const ColumnString::Chars_t & a_data, const ColumnString::Offsets & a_offsets,
const std::string & b,
PaddedPODArray<UInt8> & c)
{
size_t size = a_offsets.size();
ColumnString::Offset_t b_size = b.size() + 1;
ColumnString::Offset b_size = b.size() + 1;
const UInt8 * b_data = reinterpret_cast<const UInt8 *>(b.data());
for (size_t i = 0; i < size; ++i)
{
@ -247,8 +247,8 @@ struct StringComparisonImpl
}
static void fixed_string_vector_string_vector(
const ColumnString::Chars_t & a_data, ColumnString::Offset_t a_n,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets_t & b_offsets,
const ColumnString::Chars_t & a_data, ColumnString::Offset a_n,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets & b_offsets,
PaddedPODArray<UInt8> & c)
{
StringComparisonImpl<typename Op::SymmetricOp>::string_vector_fixed_string_vector(b_data, b_offsets, a_data, a_n, c);
@ -277,8 +277,8 @@ struct StringComparisonImpl
}
static void NO_INLINE fixed_string_vector_fixed_string_vector(
const ColumnString::Chars_t & a_data, ColumnString::Offset_t a_n,
const ColumnString::Chars_t & b_data, ColumnString::Offset_t b_n,
const ColumnString::Chars_t & a_data, ColumnString::Offset a_n,
const ColumnString::Chars_t & b_data, ColumnString::Offset b_n,
PaddedPODArray<UInt8> & c)
{
/** Specialization if both sizes are 16.
@ -302,11 +302,11 @@ struct StringComparisonImpl
}
static void NO_INLINE fixed_string_vector_constant(
const ColumnString::Chars_t & a_data, ColumnString::Offset_t a_n,
const ColumnString::Chars_t & a_data, ColumnString::Offset a_n,
const std::string & b,
PaddedPODArray<UInt8> & c)
{
ColumnString::Offset_t b_n = b.size();
ColumnString::Offset b_n = b.size();
if (a_n == 16 && b_n == 16)
{
fixed_string_vector_constant_16(a_data, b, c);
@ -325,7 +325,7 @@ struct StringComparisonImpl
static void constant_string_vector(
const std::string & a,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets_t & b_offsets,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets & b_offsets,
PaddedPODArray<UInt8> & c)
{
StringComparisonImpl<typename Op::SymmetricOp>::string_vector_constant(b_data, b_offsets, a, c);
@ -333,7 +333,7 @@ struct StringComparisonImpl
static void constant_fixed_string_vector(
const std::string & a,
const ColumnString::Chars_t & b_data, ColumnString::Offset_t b_n,
const ColumnString::Chars_t & b_data, ColumnString::Offset b_n,
PaddedPODArray<UInt8> & c)
{
StringComparisonImpl<typename Op::SymmetricOp>::fixed_string_vector_constant(b_data, b_n, a, c);
@ -358,8 +358,8 @@ template <bool positive>
struct StringEqualsImpl
{
static void NO_INLINE string_vector_string_vector(
const ColumnString::Chars_t & a_data, const ColumnString::Offsets_t & a_offsets,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets_t & b_offsets,
const ColumnString::Chars_t & a_data, const ColumnString::Offsets & a_offsets,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets & b_offsets,
PaddedPODArray<UInt8> & c)
{
size_t size = a_offsets.size();
@ -371,8 +371,8 @@ struct StringEqualsImpl
}
static void NO_INLINE string_vector_fixed_string_vector(
const ColumnString::Chars_t & a_data, const ColumnString::Offsets_t & a_offsets,
const ColumnString::Chars_t & b_data, ColumnString::Offset_t b_n,
const ColumnString::Chars_t & a_data, const ColumnString::Offsets & a_offsets,
const ColumnString::Chars_t & b_data, ColumnString::Offset b_n,
PaddedPODArray<UInt8> & c)
{
size_t size = a_offsets.size();
@ -384,12 +384,12 @@ struct StringEqualsImpl
}
static void NO_INLINE string_vector_constant(
const ColumnString::Chars_t & a_data, const ColumnString::Offsets_t & a_offsets,
const ColumnString::Chars_t & a_data, const ColumnString::Offsets & a_offsets,
const std::string & b,
PaddedPODArray<UInt8> & c)
{
size_t size = a_offsets.size();
ColumnString::Offset_t b_n = b.size();
ColumnString::Offset b_n = b.size();
const UInt8 * b_data = reinterpret_cast<const UInt8 *>(b.data());
for (size_t i = 0; i < size; ++i)
c[i] = positive == ((i == 0)
@ -448,8 +448,8 @@ struct StringEqualsImpl
#endif
static void NO_INLINE fixed_string_vector_fixed_string_vector(
const ColumnString::Chars_t & a_data, ColumnString::Offset_t a_n,
const ColumnString::Chars_t & b_data, ColumnString::Offset_t b_n,
const ColumnString::Chars_t & a_data, ColumnString::Offset a_n,
const ColumnString::Chars_t & b_data, ColumnString::Offset b_n,
PaddedPODArray<UInt8> & c)
{
/** Specialization if both sizes are 16.
@ -470,11 +470,11 @@ struct StringEqualsImpl
}
static void NO_INLINE fixed_string_vector_constant(
const ColumnString::Chars_t & a_data, ColumnString::Offset_t a_n,
const ColumnString::Chars_t & a_data, ColumnString::Offset a_n,
const std::string & b,
PaddedPODArray<UInt8> & c)
{
ColumnString::Offset_t b_n = b.size();
ColumnString::Offset b_n = b.size();
#if __SSE2__
if (a_n == 16 && b_n == 16)
{
@ -491,8 +491,8 @@ struct StringEqualsImpl
}
static void fixed_string_vector_string_vector(
const ColumnString::Chars_t & a_data, ColumnString::Offset_t a_n,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets_t & b_offsets,
const ColumnString::Chars_t & a_data, ColumnString::Offset a_n,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets & b_offsets,
PaddedPODArray<UInt8> & c)
{
string_vector_fixed_string_vector(b_data, b_offsets, a_data, a_n, c);
@ -500,7 +500,7 @@ struct StringEqualsImpl
static void constant_string_vector(
const std::string & a,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets_t & b_offsets,
const ColumnString::Chars_t & b_data, const ColumnString::Offsets & b_offsets,
PaddedPODArray<UInt8> & c)
{
string_vector_constant(b_data, b_offsets, a, c);
@ -508,7 +508,7 @@ struct StringEqualsImpl
static void constant_fixed_string_vector(
const std::string & a,
const ColumnString::Chars_t & b_data, ColumnString::Offset_t b_n,
const ColumnString::Chars_t & b_data, ColumnString::Offset b_n,
PaddedPODArray<UInt8> & c)
{
fixed_string_vector_constant(b_data, b_n, a, c);
@ -585,7 +585,7 @@ private:
{
auto col_res = ColumnUInt8::create();
ColumnUInt8::Container_t & vec_res = col_res->getData();
ColumnUInt8::Container & vec_res = col_res->getData();
vec_res.resize(col_left->getData().size());
NumComparisonImpl<T0, T1, Op<T0, T1>>::vector_vector(col_left->getData(), col_right->getData(), vec_res);
@ -596,7 +596,7 @@ private:
{
auto col_res = ColumnUInt8::create();
ColumnUInt8::Container_t & vec_res = col_res->getData();
ColumnUInt8::Container & vec_res = col_res->getData();
vec_res.resize(col_left->size());
NumComparisonImpl<T0, T1, Op<T0, T1>>::vector_constant(col_left->getData(), col_right->template getValue<T1>(), vec_res);
@ -614,7 +614,7 @@ private:
{
auto col_res = ColumnUInt8::create();
ColumnUInt8::Container_t & vec_res = col_res->getData();
ColumnUInt8::Container & vec_res = col_res->getData();
vec_res.resize(col_left->size());
NumComparisonImpl<T0, T1, Op<T0, T1>>::constant_vector(col_left->template getValue<T0>(), col_right->getData(), vec_res);
@ -694,7 +694,7 @@ private:
auto c_res = ColumnUInt8::create();
block.getByPosition(result).column = c_res;
ColumnUInt8::Container_t & vec_res = c_res->getData();
ColumnUInt8::Container & vec_res = c_res->getData();
vec_res.resize(c0->size());
if (c0_const && c1_const)
@ -986,7 +986,7 @@ private:
auto c_res = ColumnUInt8::create();
block.getByPosition(result).column = c_res;
ColumnUInt8::Container_t & vec_res = c_res->getData();
ColumnUInt8::Container & vec_res = c_res->getData();
vec_res.resize(c0->size());
if (c0_const && c1_const)

View File

@ -39,7 +39,7 @@ private:
auto col_res = ColumnVector<ResultType>::create();
block.getByPosition(result).column = col_res;
typename ColumnVector<ResultType>::Container_t & vec_res = col_res->getData();
typename ColumnVector<ResultType>::Container & vec_res = col_res->getData();
vec_res.resize(size);
return vec_res;

View File

@ -77,8 +77,8 @@ struct ConvertImpl
auto col_to = ColumnVector<ToFieldType>::create();
block.getByPosition(result).column = col_to;
const typename ColumnVector<FromFieldType>::Container_t & vec_from = col_from->getData();
typename ColumnVector<ToFieldType>::Container_t & vec_to = col_to->getData();
const typename ColumnVector<FromFieldType>::Container & vec_from = col_from->getData();
typename ColumnVector<ToFieldType>::Container & vec_to = col_to->getData();
size_t size = vec_from.size();
vec_to.resize(size);
@ -219,9 +219,9 @@ struct ConvertImpl<FromDataType, typename std::enable_if<!std::is_same<FromDataT
auto col_to = ColumnString::create();
block.getByPosition(result).column = col_to;
const typename ColumnVector<FromFieldType>::Container_t & vec_from = col_from->getData();
const typename ColumnVector<FromFieldType>::Container & vec_from = col_from->getData();
ColumnString::Chars_t & data_to = col_to->getChars();
ColumnString::Offsets_t & offsets_to = col_to->getOffsets();
ColumnString::Offsets & offsets_to = col_to->getOffsets();
size_t size = vec_from.size();
if constexpr (std::is_same<FromDataType, DataTypeDate>::value)
@ -267,7 +267,7 @@ struct ConvertImplGenericToString
block.getByPosition(result).column = col_to;
ColumnString::Chars_t & data_to = col_to->getChars();
ColumnString::Offsets_t & offsets_to = col_to->getOffsets();
ColumnString::Offsets & offsets_to = col_to->getOffsets();
data_to.resize(size * 2); /// Using coefficient 2 for initial size is arbitary.
offsets_to.resize(size);
@ -337,12 +337,12 @@ struct ConvertImpl<typename std::enable_if<!std::is_same<ToDataType, DataTypeStr
auto col_to = ColumnVector<ToFieldType>::create();
block.getByPosition(result).column = col_to;
typename ColumnVector<ToFieldType>::Container_t & vec_to = col_to->getData();
typename ColumnVector<ToFieldType>::Container & vec_to = col_to->getData();
size_t size = col_from->size();
vec_to.resize(size);
const ColumnString::Chars_t & chars = col_from->getChars();
const IColumn::Offsets_t & offsets = col_from->getOffsets();
const IColumn::Offsets & offsets = col_from->getOffsets();
size_t current_offset = 0;
@ -392,12 +392,12 @@ struct ConvertOrZeroImpl
auto col_to = ColumnVector<ToFieldType>::create();
block.getByPosition(result).column = col_to;
typename ColumnVector<ToFieldType>::Container_t & vec_to = col_to->getData();
typename ColumnVector<ToFieldType>::Container & vec_to = col_to->getData();
size_t size = col_from->size();
vec_to.resize(size);
const ColumnString::Chars_t & chars = col_from->getChars();
const IColumn::Offsets_t & offsets = col_from->getOffsets();
const IColumn::Offsets & offsets = col_from->getOffsets();
size_t current_offset = 0;
@ -442,7 +442,7 @@ struct ConvertImplGenericFromString
column_to.reserve(size);
const ColumnString::Chars_t & chars = col_from_string->getChars();
const IColumn::Offsets_t & offsets = col_from_string->getOffsets();
const IColumn::Offsets & offsets = col_from_string->getOffsets();
size_t current_offset = 0;
@ -508,7 +508,7 @@ struct ConvertImpl<DataTypeFixedString, ToDataType, Name>
const ColumnFixedString::Chars_t & data_from = col_from->getChars();
size_t n = col_from->getN();
typename ColumnVector<ToFieldType>::Container_t & vec_to = col_to->getData();
typename ColumnVector<ToFieldType>::Container & vec_to = col_to->getData();
size_t size = col_from->size();
vec_to.resize(size);
@ -551,7 +551,7 @@ struct ConvertImpl<DataTypeFixedString, DataTypeString, Name>
const ColumnFixedString::Chars_t & data_from = col_from->getChars();
ColumnString::Chars_t & data_to = col_to->getChars();
ColumnString::Offsets_t & offsets_to = col_to->getOffsets();
ColumnString::Offsets & offsets_to = col_to->getOffsets();
size_t size = col_from->size();
size_t n = col_from->getN();
data_to.resize(size * (n + 1)); /// + 1 - zero terminator

View File

@ -1111,8 +1111,8 @@ public:
{
auto res = ColumnUInt32::create();
ColumnPtr res_holder = res;
ColumnUInt32::Container_t & res_vec = res->getData();
const ColumnUInt32::Container_t & vec = times->getData();
ColumnUInt32::Container & res_vec = res->getData();
const ColumnUInt32::Container & vec = times->getData();
size_t size = vec.size();
res_vec.resize(size);
@ -1135,14 +1135,14 @@ struct TimeSlotsImpl
{
static void vector_vector(
const PaddedPODArray<UInt32> & starts, const PaddedPODArray<DurationType> & durations,
PaddedPODArray<UInt32> & result_values, ColumnArray::Offsets_t & result_offsets)
PaddedPODArray<UInt32> & result_values, ColumnArray::Offsets & result_offsets)
{
size_t size = starts.size();
result_offsets.resize(size);
result_values.reserve(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
for (UInt32 value = starts[i] / TIME_SLOT_SIZE; value <= (starts[i] + durations[i]) / TIME_SLOT_SIZE; ++value)
@ -1157,14 +1157,14 @@ struct TimeSlotsImpl
static void vector_constant(
const PaddedPODArray<UInt32> & starts, DurationType duration,
PaddedPODArray<UInt32> & result_values, ColumnArray::Offsets_t & result_offsets)
PaddedPODArray<UInt32> & result_values, ColumnArray::Offsets & result_offsets)
{
size_t size = starts.size();
result_offsets.resize(size);
result_values.reserve(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
for (UInt32 value = starts[i] / TIME_SLOT_SIZE; value <= (starts[i] + duration) / TIME_SLOT_SIZE; ++value)
@ -1179,14 +1179,14 @@ struct TimeSlotsImpl
static void constant_vector(
UInt32 start, const PaddedPODArray<DurationType> & durations,
PaddedPODArray<UInt32> & result_values, ColumnArray::Offsets_t & result_offsets)
PaddedPODArray<UInt32> & result_values, ColumnArray::Offsets & result_offsets)
{
size_t size = durations.size();
result_offsets.resize(size);
result_values.reserve(size);
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
for (UInt32 value = start / TIME_SLOT_SIZE; value <= (start + durations[i]) / TIME_SLOT_SIZE; ++value)
@ -1245,7 +1245,7 @@ public:
auto res = ColumnArray::create(ColumnUInt32::create());
ColumnPtr res_holder = res;
ColumnUInt32::Container_t & res_values = typeid_cast<ColumnUInt32 &>(res->getData()).getData();
ColumnUInt32::Container & res_values = typeid_cast<ColumnUInt32 &>(res->getData()).getData();
if (starts && durations)
{

View File

@ -243,8 +243,8 @@ public:
auto col_to = ColumnVector<T>::create();
block.getByPosition(result).column = col_to;
const typename ColumnVector<T>::Container_t & vec_from = col_from->getData();
typename ColumnVector<T>::Container_t & vec_to = col_to->getData();
const typename ColumnVector<T>::Container & vec_from = col_from->getData();
typename ColumnVector<T>::Container & vec_to = col_to->getData();
size_t size = vec_from.size();
vec_to.resize(size);
@ -341,9 +341,9 @@ public:
auto col_to = ColumnUInt8::create();
block.getByPosition(result).column = col_to;
const typename ColumnVector<T>::Container_t & vec_from1 = col_vec1->getData();
const typename ColumnVector<T>::Container_t & vec_from2 = col_vec2->getData();
typename ColumnUInt8::Container_t & vec_to = col_to->getData();
const typename ColumnVector<T>::Container & vec_from1 = col_vec1->getData();
const typename ColumnVector<T>::Container & vec_from2 = col_vec2->getData();
typename ColumnUInt8::Container & vec_to = col_to->getData();
size_t size = vec_from1.size();
vec_to.resize(size);
@ -355,9 +355,9 @@ public:
auto col_to = ColumnUInt8::create();
block.getByPosition(result).column = col_to;
const typename ColumnVector<T>::Container_t & vec_from1 = col_vec1->getData();
const typename ColumnVector<T>::Container & vec_from1 = col_vec1->getData();
const T const_from2 = col_const2->template getValue<T>();
typename ColumnUInt8::Container_t & vec_to = col_to->getData();
typename ColumnUInt8::Container & vec_to = col_to->getData();
size_t size = vec_from1.size();
vec_to.resize(size);
@ -370,8 +370,8 @@ public:
block.getByPosition(result).column = col_to;
const T const_from1 = col_const1->template getValue<T>();
const typename ColumnVector<T>::Container_t & vec_from2 = col_vec2->getData();
typename ColumnUInt8::Container_t & vec_to = col_to->getData();
const typename ColumnVector<T>::Container & vec_from2 = col_vec2->getData();
typename ColumnUInt8::Container & vec_to = col_to->getData();
size_t size = vec_from2.size();
vec_to.resize(size);
@ -468,10 +468,10 @@ public:
auto col_array = ColumnArray::create(col_values);
block.getByPosition(result).column = col_array;
ColumnArray::Offsets_t & res_offsets = col_array->getOffsets();
typename ColumnVector<T>::Container_t & res_values = col_values->getData();
ColumnArray::Offsets & res_offsets = col_array->getOffsets();
typename ColumnVector<T>::Container & res_values = col_values->getData();
const typename ColumnVector<T>::Container_t & vec_from = col_from->getData();
const typename ColumnVector<T>::Container & vec_from = col_from->getData();
size_t size = vec_from.size();
res_offsets.resize(size);
res_values.reserve(size * 4);
@ -737,7 +737,7 @@ public:
auto col_to = ColumnString::create();
block.getByPosition(result).column = col_to;
const ColumnUInt32::Container_t & region_ids = col_from->getData();
const ColumnUInt32::Container & region_ids = col_from->getData();
for (size_t i = 0; i < region_ids.size(); ++i)
{

View File

@ -94,9 +94,9 @@ private:
auto col_to = ColumnString::create();
block.getByPosition(result).column = col_to;
const typename ColumnVector<T>::Container_t & vec_from = col_from->getData();
const typename ColumnVector<T>::Container & vec_from = col_from->getData();
ColumnString::Chars_t & data_to = col_to->getChars();
ColumnString::Offsets_t & offsets_to = col_to->getOffsets();
ColumnString::Offsets & offsets_to = col_to->getOffsets();
size_t size = vec_from.size();
data_to.resize(size * 2);
offsets_to.resize(size);
@ -172,9 +172,9 @@ private:
auto col_to = ColumnString::create();
block.getByPosition(result).column = col_to;
const typename ColumnVector<T>::Container_t & vec_from = col_from->getData();
const typename ColumnVector<T>::Container & vec_from = col_from->getData();
ColumnString::Chars_t & data_to = col_to->getChars();
ColumnString::Offsets_t & offsets_to = col_to->getOffsets();
ColumnString::Offsets & offsets_to = col_to->getOffsets();
size_t size = vec_from.size();
data_to.resize(size * 2);
offsets_to.resize(size);

View File

@ -209,8 +209,8 @@ public:
block.getByPosition(result).column = col_to;
const typename ColumnString::Chars_t & data = col_from->getChars();
const typename ColumnString::Offsets_t & offsets = col_from->getOffsets();
typename ColumnUInt64::Container_t & vec_to = col_to->getData();
const typename ColumnString::Offsets & offsets = col_from->getOffsets();
typename ColumnUInt64::Container & vec_to = col_to->getData();
size_t size = offsets.size();
vec_to.resize(size);
@ -260,7 +260,7 @@ public:
block.getByPosition(result).column = col_to;
const typename ColumnString::Chars_t & data = col_from->getChars();
const typename ColumnString::Offsets_t & offsets = col_from->getOffsets();
const typename ColumnString::Offsets & offsets = col_from->getOffsets();
auto & chars_to = col_to->getChars();
const auto size = offsets.size();
chars_to.resize(size * Impl::length);
@ -297,8 +297,8 @@ private:
auto col_to = ColumnVector<ToType>::create();
block.getByPosition(result).column = col_to;
const typename ColumnVector<FromType>::Container_t & vec_from = col_from->getData();
typename ColumnVector<ToType>::Container_t & vec_to = col_to->getData();
const typename ColumnVector<FromType>::Container & vec_from = col_from->getData();
typename ColumnVector<ToType>::Container & vec_to = col_to->getData();
size_t size = vec_from.size();
vec_to.resize(size);
@ -376,11 +376,11 @@ public:
private:
template <typename FromType, bool first>
void executeIntType(const IColumn * column, ColumnUInt64::Container_t & vec_to)
void executeIntType(const IColumn * column, ColumnUInt64::Container & vec_to)
{
if (const ColumnVector<FromType> * col_from = checkAndGetColumn<ColumnVector<FromType>>(column))
{
const typename ColumnVector<FromType>::Container_t & vec_from = col_from->getData();
const typename ColumnVector<FromType>::Container & vec_from = col_from->getData();
size_t size = vec_from.size();
for (size_t i = 0; i < size; ++i)
{
@ -412,12 +412,12 @@ private:
}
template <bool first>
void executeString(const IColumn * column, ColumnUInt64::Container_t & vec_to)
void executeString(const IColumn * column, ColumnUInt64::Container & vec_to)
{
if (const ColumnString * col_from = checkAndGetColumn<ColumnString>(column))
{
const typename ColumnString::Chars_t & data = col_from->getChars();
const typename ColumnString::Offsets_t & offsets = col_from->getOffsets();
const typename ColumnString::Offsets & offsets = col_from->getOffsets();
size_t size = offsets.size();
for (size_t i = 0; i < size; ++i)
@ -469,17 +469,17 @@ private:
}
template <bool first>
void executeArray(const IDataType * type, const IColumn * column, ColumnUInt64::Container_t & vec_to)
void executeArray(const IDataType * type, const IColumn * column, ColumnUInt64::Container & vec_to)
{
const IDataType * nested_type = typeid_cast<const DataTypeArray *>(type)->getNestedType().get();
if (const ColumnArray * col_from = checkAndGetColumn<ColumnArray>(column))
{
const IColumn * nested_column = &col_from->getData();
const ColumnArray::Offsets_t & offsets = col_from->getOffsets();
const ColumnArray::Offsets & offsets = col_from->getOffsets();
const size_t nested_size = nested_column->size();
ColumnUInt64::Container_t vec_temp(nested_size);
ColumnUInt64::Container vec_temp(nested_size);
executeAny<true>(nested_type, nested_column, vec_temp);
const size_t size = offsets.size();
@ -512,7 +512,7 @@ private:
}
template <bool first>
void executeAny(const IDataType * from_type, const IColumn * icolumn, ColumnUInt64::Container_t & vec_to)
void executeAny(const IDataType * from_type, const IColumn * icolumn, ColumnUInt64::Container & vec_to)
{
if (checkDataType<DataTypeUInt8>(from_type)) executeIntType<UInt8, first>(icolumn, vec_to);
else if (checkDataType<DataTypeUInt16>(from_type)) executeIntType<UInt16, first>(icolumn, vec_to);
@ -536,7 +536,7 @@ private:
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
}
void executeForArgument(const IDataType * type, const IColumn * column, ColumnUInt64::Container_t & vec_to, bool & is_first)
void executeForArgument(const IDataType * type, const IColumn * column, ColumnUInt64::Container & vec_to, bool & is_first)
{
/// Flattening of tuples.
if (const ColumnTuple * tuple = typeid_cast<const ColumnTuple *>(column))
@ -589,7 +589,7 @@ public:
auto col_to = ColumnUInt64::create(rows);
block.getByPosition(result).column = col_to;
ColumnUInt64::Container_t & vec_to = col_to->getData();
ColumnUInt64::Container & vec_to = col_to->getData();
if (arguments.empty())
{

View File

@ -84,16 +84,16 @@ struct ArrayFilterImpl
else
return ColumnArray::create(
array.getDataPtr()->cloneEmpty(),
std::make_shared<ColumnArray::ColumnOffsets_t>(array.size(), 0));
std::make_shared<ColumnArray::ColumnOffsets>(array.size(), 0));
}
const IColumn::Filter & filter = column_filter->getData();
ColumnPtr filtered = array.getData().filter(filter, -1);
const IColumn::Offsets_t & in_offsets = array.getOffsets();
auto column_offsets = std::make_shared<ColumnArray::ColumnOffsets_t>(in_offsets.size());
const IColumn::Offsets & in_offsets = array.getOffsets();
auto column_offsets = std::make_shared<ColumnArray::ColumnOffsets>(in_offsets.size());
ColumnPtr column_offsets_ptr = column_offsets;
IColumn::Offsets_t & out_offsets = column_offsets->getData();
IColumn::Offsets & out_offsets = column_offsets->getData();
size_t in_pos = 0;
size_t out_pos = 0;
@ -135,9 +135,9 @@ struct ArrayCountImpl
if (column_filter_const->getValue<UInt8>())
{
const IColumn::Offsets_t & offsets = array.getOffsets();
const IColumn::Offsets & offsets = array.getOffsets();
auto out_column = ColumnUInt32::create(offsets.size());
ColumnUInt32::Container_t & out_counts = out_column->getData();
ColumnUInt32::Container & out_counts = out_column->getData();
size_t pos = 0;
for (size_t i = 0; i < offsets.size(); ++i)
@ -153,9 +153,9 @@ struct ArrayCountImpl
}
const IColumn::Filter & filter = column_filter->getData();
const IColumn::Offsets_t & offsets = array.getOffsets();
const IColumn::Offsets & offsets = array.getOffsets();
auto out_column = ColumnUInt32::create(offsets.size());
ColumnUInt32::Container_t & out_counts = out_column->getData();
ColumnUInt32::Container & out_counts = out_column->getData();
size_t pos = 0;
for (size_t i = 0; i < offsets.size(); ++i)
@ -197,9 +197,9 @@ struct ArrayExistsImpl
if (column_filter_const->getValue<UInt8>())
{
const IColumn::Offsets_t & offsets = array.getOffsets();
const IColumn::Offsets & offsets = array.getOffsets();
auto out_column = ColumnUInt8::create(offsets.size());
ColumnUInt8::Container_t & out_exists = out_column->getData();
ColumnUInt8::Container & out_exists = out_column->getData();
size_t pos = 0;
for (size_t i = 0; i < offsets.size(); ++i)
@ -215,9 +215,9 @@ struct ArrayExistsImpl
}
const IColumn::Filter & filter = column_filter->getData();
const IColumn::Offsets_t & offsets = array.getOffsets();
const IColumn::Offsets & offsets = array.getOffsets();
auto out_column = ColumnUInt8::create(offsets.size());
ColumnUInt8::Container_t & out_exists = out_column->getData();
ColumnUInt8::Container & out_exists = out_column->getData();
size_t pos = 0;
for (size_t i = 0; i < offsets.size(); ++i)
@ -265,9 +265,9 @@ struct ArrayAllImpl
return DataTypeUInt8().createColumnConst(array.size(), UInt64(1));
else
{
const IColumn::Offsets_t & offsets = array.getOffsets();
const IColumn::Offsets & offsets = array.getOffsets();
auto out_column = ColumnUInt8::create(offsets.size());
ColumnUInt8::Container_t & out_all = out_column->getData();
ColumnUInt8::Container & out_all = out_column->getData();
size_t pos = 0;
for (size_t i = 0; i < offsets.size(); ++i)
@ -281,9 +281,9 @@ struct ArrayAllImpl
}
const IColumn::Filter & filter = column_filter->getData();
const IColumn::Offsets_t & offsets = array.getOffsets();
const IColumn::Offsets & offsets = array.getOffsets();
auto out_column = ColumnUInt8::create(offsets.size());
ColumnUInt8::Container_t & out_all = out_column->getData();
ColumnUInt8::Container & out_all = out_column->getData();
size_t pos = 0;
for (size_t i = 0; i < offsets.size(); ++i)
@ -333,7 +333,7 @@ struct ArraySumImpl
}
template <typename Element, typename Result>
static bool executeType(const ColumnPtr & mapped, const ColumnArray::Offsets_t & offsets, ColumnPtr & res_ptr)
static bool executeType(const ColumnPtr & mapped, const ColumnArray::Offsets & offsets, ColumnPtr & res_ptr)
{
const ColumnVector<Element> * column = checkAndGetColumn<ColumnVector<Element>>(&*mapped);
@ -348,7 +348,7 @@ struct ArraySumImpl
auto res_column = ColumnVector<Result>::create(offsets.size());
res_ptr = res_column;
typename ColumnVector<Result>::Container_t & res = res_column->getData();
typename ColumnVector<Result>::Container & res = res_column->getData();
size_t pos = 0;
for (size_t i = 0; i < offsets.size(); ++i)
@ -360,10 +360,10 @@ struct ArraySumImpl
return true;
}
const typename ColumnVector<Element>::Container_t & data = column->getData();
const typename ColumnVector<Element>::Container & data = column->getData();
auto res_column = ColumnVector<Result>::create(offsets.size());
res_ptr = res_column;
typename ColumnVector<Result>::Container_t & res = res_column->getData();
typename ColumnVector<Result>::Container & res = res_column->getData();
size_t pos = 0;
for (size_t i = 0; i < offsets.size(); ++i)
@ -381,7 +381,7 @@ struct ArraySumImpl
static ColumnPtr execute(const ColumnArray & array, ColumnPtr mapped)
{
const IColumn::Offsets_t & offsets = array.getOffsets();
const IColumn::Offsets & offsets = array.getOffsets();
ColumnPtr res;
if (executeType< UInt8 , UInt64>(mapped, offsets, res) ||
@ -445,7 +445,7 @@ struct ArrayFirstImpl
{
ColumnPtr out{array.getData().cloneEmpty()};
out->insertDefault();
return out->replicate(IColumn::Offsets_t(1, array.size()));
return out->replicate(IColumn::Offsets(1, array.size()));
}
}
@ -576,7 +576,7 @@ struct ArraySortImpl
static ColumnPtr execute(const ColumnArray & array, ColumnPtr mapped)
{
const ColumnArray::Offsets_t & offsets = array.getOffsets();
const ColumnArray::Offsets & offsets = array.getOffsets();
size_t size = offsets.size();
size_t nested_size = array.getData().size();
@ -585,7 +585,7 @@ struct ArraySortImpl
for (size_t i = 0; i < nested_size; ++i)
permutation[i] = i;
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
for (size_t i = 0; i < size; ++i)
{
auto next_offset = offsets[i];
@ -838,7 +838,7 @@ public:
{
/// The first condition is optimization: do not compare data if the pointers are equal.
if (column_array->getOffsetsPtr() != offsets_column
&& column_array->getOffsets() != typeid_cast<const ColumnArray::ColumnOffsets_t &>(*offsets_column).getData())
&& column_array->getOffsets() != typeid_cast<const ColumnArray::ColumnOffsets &>(*offsets_column).getData())
throw Exception("Arrays passed to " + getName() + " must have equal size", ErrorCodes::SIZES_OF_ARRAYS_DOESNT_MATCH);
}

View File

@ -93,7 +93,7 @@ struct NotImpl
};
using UInt8Container = ColumnUInt8::Container_t;
using UInt8Container = ColumnUInt8::Container;
using UInt8ColumnPtrs = std::vector<const ColumnUInt8 *>;
@ -200,7 +200,7 @@ private:
auto col = checkAndGetColumn<ColumnVector<T>>(column);
if (!col)
return false;
const typename ColumnVector<T>::Container_t & vec = col->getData();
const typename ColumnVector<T>::Container & vec = col->getData();
size_t n = res.size();
for (size_t i = 0; i < n; ++i)
{
@ -229,7 +229,7 @@ private:
auto col = checkAndGetColumn<ColumnVector<T>>(column);
if (!col)
return false;
const typename ColumnVector<T>::Container_t & other_vec = col->getData();
const typename ColumnVector<T>::Container & other_vec = col->getData();
size_t n = res.size();
for (size_t i = 0; i < n; ++i)
{
@ -387,7 +387,7 @@ private:
auto col_res = ColumnUInt8::create();
block.getByPosition(result).column = col_res;
typename ColumnUInt8::Container_t & vec_res = col_res->getData();
typename ColumnUInt8::Container & vec_res = col_res->getData();
vec_res.resize(col->getData().size());
UnaryOperationImpl<T, Impl<T>>::vector(col->getData(), vec_res);

View File

@ -1187,7 +1187,7 @@ private:
template <typename T>
static void fill(const PaddedPODArray<T> & src,
ColumnString::Chars_t & dst_chars,
ColumnString::Offsets_t & dst_offsets,
ColumnString::Offsets & dst_offsets,
Int64 min,
Int64 max,
Float64 max_width)

View File

@ -155,7 +155,7 @@ public:
auto col_to = ColumnVector<ToType>::create();
block.getByPosition(result).column = col_to;
typename ColumnVector<ToType>::Container_t & vec_to = col_to->getData();
typename ColumnVector<ToType>::Container & vec_to = col_to->getData();
size_t size = block.rows();
vec_to.resize(size);
@ -201,7 +201,7 @@ public:
if (!is_initialized)
{
is_initialized = true;
typename ColumnVector<ToType>::Container_t vec_to(1);
typename ColumnVector<ToType>::Container vec_to(1);
Impl::execute(&vec_to[0], vec_to.size());
value = vec_to[0];
}

View File

@ -58,9 +58,9 @@ public:
auto col_to = ColumnString::create();
block.getByPosition(result).column = col_to;
const typename ColumnVector<T>::Container_t & vec_from = col_from->getData();
const typename ColumnVector<T>::Container & vec_from = col_from->getData();
ColumnString::Chars_t & data_to = col_to->getChars();
ColumnString::Offsets_t & offsets_to = col_to->getOffsets();
ColumnString::Offsets & offsets_to = col_to->getOffsets();
size_t size = vec_from.size();
data_to.resize(size * (sizeof(T) + 1));
offsets_to.resize(size);
@ -145,9 +145,9 @@ public:
block.getByPosition(result).column = col_res;
ColumnString::Chars_t & data_from = col_from->getChars();
ColumnString::Offsets_t & offsets_from = col_from->getOffsets();
ColumnString::Offsets & offsets_from = col_from->getOffsets();
size_t size = offsets_from.size();
typename ColumnVector<ToFieldType>::Container_t & vec_res = col_res->getData();
typename ColumnVector<ToFieldType>::Container & vec_res = col_res->getData();
vec_res.resize(size);
size_t offset = 0;
@ -167,7 +167,7 @@ public:
ColumnString::Chars_t & data_from = col_from->getChars();
size_t step = col_from->getN();
size_t size = data_from.size() / step;
typename ColumnVector<ToFieldType>::Container_t & vec_res = col_res->getData();
typename ColumnVector<ToFieldType>::Container & vec_res = col_res->getData();
vec_res.resize(size);
size_t offset = 0;

View File

@ -371,7 +371,7 @@ private:
using Data = std::array<T, Op::data_count>;
public:
static NO_INLINE void apply(const PaddedPODArray<T> & in, size_t scale, typename ColumnVector<T>::Container_t & out)
static NO_INLINE void apply(const PaddedPODArray<T> & in, size_t scale, typename ColumnVector<T>::Container & out)
{
auto mm_scale = Op::prepare(scale);
@ -413,7 +413,7 @@ private:
public:
template <size_t scale>
static NO_INLINE void applyImpl(const PaddedPODArray<T> & in, typename ColumnVector<T>::Container_t & out)
static NO_INLINE void applyImpl(const PaddedPODArray<T> & in, typename ColumnVector<T>::Container & out)
{
const T* end_in = in.data() + in.size();
@ -428,7 +428,7 @@ public:
}
}
static NO_INLINE void apply(const PaddedPODArray<T> & in, size_t scale, typename ColumnVector<T>::Container_t & out)
static NO_INLINE void apply(const PaddedPODArray<T> & in, size_t scale, typename ColumnVector<T>::Container & out)
{
/// Manual function cloning for compiler to generate integer division by constant.
switch (scale)
@ -493,7 +493,7 @@ struct Dispatcher
auto col_res = ColumnVector<T>::create();
block.getByPosition(result).column = col_res;
typename ColumnVector<T>::Container_t & vec_res = col_res->getData();
typename ColumnVector<T>::Container & vec_res = col_res->getData();
vec_res.resize(col->getData().size());
if (vec_res.empty())

View File

@ -28,10 +28,10 @@ namespace ErrorCodes
template <bool negative = false>
struct EmptyImpl
{
static void vector(const ColumnString::Chars_t & /*data*/, const ColumnString::Offsets_t & offsets, PaddedPODArray<UInt8> & res)
static void vector(const ColumnString::Chars_t & /*data*/, const ColumnString::Offsets & offsets, PaddedPODArray<UInt8> & res)
{
size_t size = offsets.size();
ColumnString::Offset_t prev_offset = 1;
ColumnString::Offset prev_offset = 1;
for (size_t i = 0; i < size; ++i)
{
res[i] = negative ^ (offsets[i] == prev_offset);
@ -48,10 +48,10 @@ struct EmptyImpl
{
}
static void array(const ColumnString::Offsets_t & offsets, PaddedPODArray<UInt8> & res)
static void array(const ColumnString::Offsets & offsets, PaddedPODArray<UInt8> & res)
{
size_t size = offsets.size();
ColumnString::Offset_t prev_offset = 0;
ColumnString::Offset prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
res[i] = negative ^ (offsets[i] == prev_offset);
@ -65,7 +65,7 @@ struct EmptyImpl
*/
struct LengthImpl
{
static void vector(const ColumnString::Chars_t & /*data*/, const ColumnString::Offsets_t & offsets, PaddedPODArray<UInt64> & res)
static void vector(const ColumnString::Chars_t & /*data*/, const ColumnString::Offsets & offsets, PaddedPODArray<UInt64> & res)
{
size_t size = offsets.size();
for (size_t i = 0; i < size; ++i)
@ -81,7 +81,7 @@ struct LengthImpl
{
}
static void array(const ColumnString::Offsets_t & offsets, PaddedPODArray<UInt64> & res)
static void array(const ColumnString::Offsets & offsets, PaddedPODArray<UInt64> & res)
{
size_t size = offsets.size();
for (size_t i = 0; i < size; ++i)
@ -97,11 +97,11 @@ struct LengthImpl
*/
struct LengthUTF8Impl
{
static void vector(const ColumnString::Chars_t & data, const ColumnString::Offsets_t & offsets, PaddedPODArray<UInt64> & res)
static void vector(const ColumnString::Chars_t & data, const ColumnString::Offsets & offsets, PaddedPODArray<UInt64> & res)
{
size_t size = offsets.size();
ColumnString::Offset_t prev_offset = 0;
ColumnString::Offset prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
res[i] = UTF8::countCodePoints(&data[prev_offset], offsets[i] - prev_offset - 1);
@ -123,7 +123,7 @@ struct LengthUTF8Impl
}
}
static void array(const ColumnString::Offsets_t &, PaddedPODArray<UInt64> &)
static void array(const ColumnString::Offsets &, PaddedPODArray<UInt64> &)
{
throw Exception("Cannot apply function lengthUTF8 to Array argument", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
}
@ -134,9 +134,9 @@ template <char not_case_lower_bound, char not_case_upper_bound>
struct LowerUpperImpl
{
static void vector(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
ColumnString::Chars_t & res_data,
ColumnString::Offsets_t & res_offsets)
ColumnString::Offsets & res_offsets)
{
res_data.resize(data.size());
res_offsets.assign(offsets);
@ -195,15 +195,15 @@ private:
struct ReverseImpl
{
static void vector(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
ColumnString::Chars_t & res_data,
ColumnString::Offsets_t & res_offsets)
ColumnString::Offsets & res_offsets)
{
res_data.resize(data.size());
res_offsets.assign(offsets);
size_t size = offsets.size();
ColumnString::Offset_t prev_offset = 0;
ColumnString::Offset prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
for (size_t j = prev_offset; j < offsets[i] - 1; ++j)
@ -232,18 +232,18 @@ struct ReverseImpl
struct ReverseUTF8Impl
{
static void vector(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
ColumnString::Chars_t & res_data,
ColumnString::Offsets_t & res_offsets)
ColumnString::Offsets & res_offsets)
{
res_data.resize(data.size());
res_offsets.assign(offsets);
size_t size = offsets.size();
ColumnString::Offset_t prev_offset = 0;
ColumnString::Offset prev_offset = 0;
for (size_t i = 0; i < size; ++i)
{
ColumnString::Offset_t j = prev_offset;
ColumnString::Offset j = prev_offset;
while (j < offsets[i] - 1)
{
if (data[j] < 0xBF)
@ -285,9 +285,9 @@ template <char not_case_lower_bound,
int to_case(int),
void cyrillic_to_case(const UInt8 *&, UInt8 *&)>
void LowerUpperUTF8Impl<not_case_lower_bound, not_case_upper_bound, to_case, cyrillic_to_case>::vector(const ColumnString::Chars_t & data,
const IColumn::Offsets_t & offsets,
const IColumn::Offsets & offsets,
ColumnString::Chars_t & res_data,
IColumn::Offsets_t & res_offsets)
IColumn::Offsets & res_offsets)
{
res_data.resize(data.size());
res_offsets.assign(offsets);
@ -443,24 +443,24 @@ void LowerUpperUTF8Impl<not_case_lower_bound, not_case_upper_bound, to_case, cyr
struct SubstringUTF8Impl
{
static void vector(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
size_t start,
size_t length,
ColumnString::Chars_t & res_data,
ColumnString::Offsets_t & res_offsets)
ColumnString::Offsets & res_offsets)
{
res_data.reserve(data.size());
size_t size = offsets.size();
res_offsets.resize(size);
ColumnString::Offset_t prev_offset = 0;
ColumnString::Offset_t res_offset = 0;
ColumnString::Offset prev_offset = 0;
ColumnString::Offset res_offset = 0;
for (size_t i = 0; i < size; ++i)
{
ColumnString::Offset_t j = prev_offset;
ColumnString::Offset_t pos = 1;
ColumnString::Offset_t bytes_start = 0;
ColumnString::Offset_t bytes_length = 0;
ColumnString::Offset j = prev_offset;
ColumnString::Offset pos = 1;
ColumnString::Offset bytes_start = 0;
ColumnString::Offset bytes_length = 0;
while (j < offsets[i] - 1)
{
if (pos == start)
@ -544,7 +544,7 @@ public:
auto col_res = ColumnVector<ResultType>::create();
block.getByPosition(result).column = col_res;
typename ColumnVector<ResultType>::Container_t & vec_res = col_res->getData();
typename ColumnVector<ResultType>::Container & vec_res = col_res->getData();
vec_res.resize(col->size());
Impl::vector(col->getChars(), col->getOffsets(), vec_res);
}
@ -563,7 +563,7 @@ public:
auto col_res = ColumnVector<ResultType>::create();
block.getByPosition(result).column = col_res;
typename ColumnVector<ResultType>::Container_t & vec_res = col_res->getData();
typename ColumnVector<ResultType>::Container & vec_res = col_res->getData();
vec_res.resize(col->size());
Impl::vector_fixed_to_vector(col->getChars(), col->getN(), vec_res);
}
@ -573,7 +573,7 @@ public:
auto col_res = ColumnVector<ResultType>::create();
block.getByPosition(result).column = col_res;
typename ColumnVector<ResultType>::Container_t & vec_res = col_res->getData();
typename ColumnVector<ResultType>::Container & vec_res = col_res->getData();
vec_res.resize(col->size());
Impl::array(col->getOffsets(), vec_res);
}
@ -1041,8 +1041,8 @@ private:
dst_data.resize(src_data.size() + size);
dst_offsets.resize(size);
ColumnString::Offset_t src_offset{};
ColumnString::Offset_t dst_offset{};
ColumnString::Offset src_offset{};
ColumnString::Offset dst_offset{};
for (const auto i : ext::range(0, size))
{

View File

@ -109,9 +109,9 @@ template <char not_case_lower_bound,
struct LowerUpperUTF8Impl
{
static void vector(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
ColumnString::Chars_t & res_data,
ColumnString::Offsets_t & res_offsets);
ColumnString::Offsets & res_offsets);
static void vector_fixed(const ColumnString::Chars_t & data, size_t n, ColumnString::Chars_t & res_data);

View File

@ -352,14 +352,14 @@ public:
auto col_res = ColumnArray::create(ColumnString::create());
ColumnPtr col_res_holder = col_res;
ColumnString & res_strings = typeid_cast<ColumnString &>(col_res->getData());
ColumnArray::Offsets_t & res_offsets = col_res->getOffsets();
ColumnArray::Offsets & res_offsets = col_res->getOffsets();
ColumnString::Chars_t & res_strings_chars = res_strings.getChars();
ColumnString::Offsets_t & res_strings_offsets = res_strings.getOffsets();
ColumnString::Offsets & res_strings_offsets = res_strings.getOffsets();
if (col_str)
{
const ColumnString::Chars_t & src_chars = col_str->getChars();
const ColumnString::Offsets_t & src_offsets = col_str->getOffsets();
const ColumnString::Offsets & src_offsets = col_str->getOffsets();
res_offsets.reserve(src_offsets.size());
res_strings_offsets.reserve(src_offsets.size() * 5); /// Constant 5 - at random.
@ -369,9 +369,9 @@ public:
Pos token_end = nullptr;
size_t size = src_offsets.size();
ColumnString::Offset_t current_src_offset = 0;
ColumnArray::Offset_t current_dst_offset = 0;
ColumnString::Offset_t current_dst_strings_offset = 0;
ColumnString::Offset current_src_offset = 0;
ColumnArray::Offset current_dst_offset = 0;
ColumnString::Offset current_dst_strings_offset = 0;
for (size_t i = 0; i < size; ++i)
{
Pos pos = reinterpret_cast<Pos>(&src_chars[current_src_offset]);
@ -429,11 +429,11 @@ class FunctionArrayStringConcat : public IFunction
private:
void executeInternal(
const ColumnString::Chars_t & src_chars,
const ColumnString::Offsets_t & src_string_offsets,
const ColumnArray::Offsets_t & src_array_offsets,
const ColumnString::Offsets & src_string_offsets,
const ColumnArray::Offsets & src_array_offsets,
const char * delimiter, const size_t delimiter_size,
ColumnString::Chars_t & dst_chars,
ColumnString::Offsets_t & dst_string_offsets)
ColumnString::Offsets & dst_string_offsets)
{
size_t size = src_array_offsets.size();
@ -450,10 +450,10 @@ private:
/// There will be as many strings as there were arrays.
dst_string_offsets.resize(src_array_offsets.size());
ColumnArray::Offset_t current_src_array_offset = 0;
ColumnString::Offset_t current_src_string_offset = 0;
ColumnArray::Offset current_src_array_offset = 0;
ColumnString::Offset current_src_string_offset = 0;
ColumnString::Offset_t current_dst_string_offset = 0;
ColumnString::Offset current_dst_string_offset = 0;
/// Loop through the array of strings.
for (size_t i = 0; i < size; ++i)

View File

@ -155,7 +155,7 @@ struct PositionImpl
/// Find one substring in many strings.
static void vector_constant(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
const std::string & needle,
PaddedPODArray<UInt64> & res)
{
@ -209,13 +209,13 @@ struct PositionImpl
/// Search each time for a different single substring inside each time different string.
static void vector_vector(const ColumnString::Chars_t & haystack_data,
const ColumnString::Offsets_t & haystack_offsets,
const ColumnString::Offsets & haystack_offsets,
const ColumnString::Chars_t & needle_data,
const ColumnString::Offsets_t & needle_offsets,
const ColumnString::Offsets & needle_offsets,
PaddedPODArray<UInt64> & res)
{
ColumnString::Offset_t prev_haystack_offset = 0;
ColumnString::Offset_t prev_needle_offset = 0;
ColumnString::Offset prev_haystack_offset = 0;
ColumnString::Offset prev_needle_offset = 0;
size_t size = haystack_offsets.size();
@ -257,12 +257,12 @@ struct PositionImpl
/// Find many substrings in one line.
static void constant_vector(const String & haystack,
const ColumnString::Chars_t & needle_data,
const ColumnString::Offsets_t & needle_offsets,
const ColumnString::Offsets & needle_offsets,
PaddedPODArray<UInt64> & res)
{
// NOTE You could use haystack indexing. But this is a rare case.
ColumnString::Offset_t prev_needle_offset = 0;
ColumnString::Offset prev_needle_offset = 0;
size_t size = needle_offsets.size();
@ -347,7 +347,7 @@ struct MatchImpl
using ResultType = UInt8;
static void vector_constant(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
const std::string & pattern,
PaddedPODArray<UInt8> & res)
{
@ -512,10 +512,10 @@ struct MatchImpl
struct ExtractImpl
{
static void vector(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
const std::string & pattern,
ColumnString::Chars_t & res_data,
ColumnString::Offsets_t & res_offsets)
ColumnString::Offsets & res_offsets)
{
res_data.reserve(data.size() / 5);
res_offsets.resize(offsets.size());
@ -616,7 +616,7 @@ struct ReplaceRegexpImpl
static void processString(const re2_st::StringPiece & input,
ColumnString::Chars_t & res_data,
ColumnString::Offset_t & res_offset,
ColumnString::Offset & res_offset,
re2_st::RE2 & searcher,
int num_captures,
const Instructions & instructions)
@ -680,13 +680,13 @@ struct ReplaceRegexpImpl
static void vector(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
const std::string & needle,
const std::string & replacement,
ColumnString::Chars_t & res_data,
ColumnString::Offsets_t & res_offsets)
ColumnString::Offsets & res_offsets)
{
ColumnString::Offset_t res_offset = 0;
ColumnString::Offset res_offset = 0;
res_data.reserve(data.size());
size_t size = offsets.size();
res_offsets.resize(size);
@ -712,9 +712,9 @@ struct ReplaceRegexpImpl
const std::string & needle,
const std::string & replacement,
ColumnString::Chars_t & res_data,
ColumnString::Offsets_t & res_offsets)
ColumnString::Offsets & res_offsets)
{
ColumnString::Offset_t res_offset = 0;
ColumnString::Offset res_offset = 0;
size_t size = data.size() / n;
res_data.reserve(data.size());
res_offsets.resize(size);
@ -753,17 +753,17 @@ template <bool replace_one = false>
struct ReplaceStringImpl
{
static void vector(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
const std::string & needle,
const std::string & replacement,
ColumnString::Chars_t & res_data,
ColumnString::Offsets_t & res_offsets)
ColumnString::Offsets & res_offsets)
{
const UInt8 * begin = &data[0];
const UInt8 * pos = begin;
const UInt8 * end = pos + data.size();
ColumnString::Offset_t res_offset = 0;
ColumnString::Offset res_offset = 0;
res_data.reserve(data.size());
size_t size = offsets.size();
res_offsets.resize(size);
@ -832,13 +832,13 @@ struct ReplaceStringImpl
const std::string & needle,
const std::string & replacement,
ColumnString::Chars_t & res_data,
ColumnString::Offsets_t & res_offsets)
ColumnString::Offsets & res_offsets)
{
const UInt8 * begin = &data[0];
const UInt8 * pos = begin;
const UInt8 * end = pos + data.size();
ColumnString::Offset_t res_offset = 0;
ColumnString::Offset res_offset = 0;
size_t count = data.size() / n;
res_data.reserve(data.size());
res_offsets.resize(count);

View File

@ -93,7 +93,7 @@ public:
auto col_res = ColumnVector<ResultType>::create();
block.getByPosition(result).column = col_res;
typename ColumnVector<ResultType>::Container_t & vec_res = col_res->getData();
typename ColumnVector<ResultType>::Container & vec_res = col_res->getData();
vec_res.resize(column_haystack->size());
const ColumnString * col_haystack_vector = checkAndGetColumn<ColumnString>(&*column_haystack);
@ -169,7 +169,7 @@ public:
auto col_res = ColumnString::create();
ColumnString::Chars_t & vec_res = col_res->getChars();
ColumnString::Offsets_t & offsets_res = col_res->getOffsets();
ColumnString::Offsets & offsets_res = col_res->getOffsets();
Impl::vector(col->getChars(), col->getOffsets(), col_needle->getValue<String>(), vec_res, offsets_res);
block.getByPosition(result).column = std::move(col_res);

View File

@ -559,12 +559,12 @@ private:
template <typename T>
void executeImplNumToStringWithConstDefault(const PaddedPODArray<T> & src,
ColumnString::Chars_t & dst_data, ColumnString::Offsets_t & dst_offsets, StringRef dst_default)
ColumnString::Chars_t & dst_data, ColumnString::Offsets & dst_offsets, StringRef dst_default)
{
const auto & table = *table_num_to_string;
size_t size = src.size();
dst_offsets.resize(size);
ColumnString::Offset_t current_dst_offset = 0;
ColumnString::Offset current_dst_offset = 0;
for (size_t i = 0; i < size; ++i)
{
auto it = table.find(src[i]);
@ -578,14 +578,14 @@ private:
template <typename T>
void executeImplNumToStringWithNonConstDefault(const PaddedPODArray<T> & src,
ColumnString::Chars_t & dst_data, ColumnString::Offsets_t & dst_offsets,
const ColumnString::Chars_t & dst_default_data, const ColumnString::Offsets_t & dst_default_offsets)
ColumnString::Chars_t & dst_data, ColumnString::Offsets & dst_offsets,
const ColumnString::Chars_t & dst_default_data, const ColumnString::Offsets & dst_default_offsets)
{
const auto & table = *table_num_to_string;
size_t size = src.size();
dst_offsets.resize(size);
ColumnString::Offset_t current_dst_offset = 0;
ColumnString::Offset_t current_dst_default_offset = 0;
ColumnString::Offset current_dst_offset = 0;
ColumnString::Offset current_dst_default_offset = 0;
for (size_t i = 0; i < size; ++i)
{
auto it = table.find(src[i]);
@ -609,13 +609,13 @@ private:
template <typename U>
void executeImplStringToNumWithConstDefault(
const ColumnString::Chars_t & src_data, const ColumnString::Offsets_t & src_offsets,
const ColumnString::Chars_t & src_data, const ColumnString::Offsets & src_offsets,
PaddedPODArray<U> & dst, U dst_default)
{
const auto & table = *table_string_to_num;
size_t size = src_offsets.size();
dst.resize(size);
ColumnString::Offset_t current_src_offset = 0;
ColumnString::Offset current_src_offset = 0;
for (size_t i = 0; i < size; ++i)
{
StringRef ref{&src_data[current_src_offset], src_offsets[i] - current_src_offset};
@ -630,13 +630,13 @@ private:
template <typename U, typename V>
void executeImplStringToNumWithNonConstDefault(
const ColumnString::Chars_t & src_data, const ColumnString::Offsets_t & src_offsets,
const ColumnString::Chars_t & src_data, const ColumnString::Offsets & src_offsets,
PaddedPODArray<U> & dst, const PaddedPODArray<V> & dst_default)
{
const auto & table = *table_string_to_num;
size_t size = src_offsets.size();
dst.resize(size);
ColumnString::Offset_t current_src_offset = 0;
ColumnString::Offset current_src_offset = 0;
for (size_t i = 0; i < size; ++i)
{
StringRef ref{&src_data[current_src_offset], src_offsets[i] - current_src_offset};
@ -651,14 +651,14 @@ private:
template <bool with_default>
void executeImplStringToStringWithOrWithoutConstDefault(
const ColumnString::Chars_t & src_data, const ColumnString::Offsets_t & src_offsets,
ColumnString::Chars_t & dst_data, ColumnString::Offsets_t & dst_offsets, StringRef dst_default)
const ColumnString::Chars_t & src_data, const ColumnString::Offsets & src_offsets,
ColumnString::Chars_t & dst_data, ColumnString::Offsets & dst_offsets, StringRef dst_default)
{
const auto & table = *table_string_to_string;
size_t size = src_offsets.size();
dst_offsets.resize(size);
ColumnString::Offset_t current_src_offset = 0;
ColumnString::Offset_t current_dst_offset = 0;
ColumnString::Offset current_src_offset = 0;
ColumnString::Offset current_dst_offset = 0;
for (size_t i = 0; i < size; ++i)
{
StringRef src_ref{&src_data[current_src_offset], src_offsets[i] - current_src_offset};
@ -675,30 +675,30 @@ private:
}
void executeImplStringToString(
const ColumnString::Chars_t & src_data, const ColumnString::Offsets_t & src_offsets,
ColumnString::Chars_t & dst_data, ColumnString::Offsets_t & dst_offsets)
const ColumnString::Chars_t & src_data, const ColumnString::Offsets & src_offsets,
ColumnString::Chars_t & dst_data, ColumnString::Offsets & dst_offsets)
{
executeImplStringToStringWithOrWithoutConstDefault<false>(src_data, src_offsets, dst_data, dst_offsets, {});
}
void executeImplStringToStringWithConstDefault(
const ColumnString::Chars_t & src_data, const ColumnString::Offsets_t & src_offsets,
ColumnString::Chars_t & dst_data, ColumnString::Offsets_t & dst_offsets, StringRef dst_default)
const ColumnString::Chars_t & src_data, const ColumnString::Offsets & src_offsets,
ColumnString::Chars_t & dst_data, ColumnString::Offsets & dst_offsets, StringRef dst_default)
{
executeImplStringToStringWithOrWithoutConstDefault<true>(src_data, src_offsets, dst_data, dst_offsets, dst_default);
}
void executeImplStringToStringWithNonConstDefault(
const ColumnString::Chars_t & src_data, const ColumnString::Offsets_t & src_offsets,
ColumnString::Chars_t & dst_data, ColumnString::Offsets_t & dst_offsets,
const ColumnString::Chars_t & dst_default_data, const ColumnString::Offsets_t & dst_default_offsets)
const ColumnString::Chars_t & src_data, const ColumnString::Offsets & src_offsets,
ColumnString::Chars_t & dst_data, ColumnString::Offsets & dst_offsets,
const ColumnString::Chars_t & dst_default_data, const ColumnString::Offsets & dst_default_offsets)
{
const auto & table = *table_string_to_string;
size_t size = src_offsets.size();
dst_offsets.resize(size);
ColumnString::Offset_t current_src_offset = 0;
ColumnString::Offset_t current_dst_offset = 0;
ColumnString::Offset_t current_dst_default_offset = 0;
ColumnString::Offset current_src_offset = 0;
ColumnString::Offset current_dst_offset = 0;
ColumnString::Offset current_dst_default_offset = 0;
for (size_t i = 0; i < size; ++i)
{
StringRef src_ref{&src_data[current_src_offset], src_offsets[i] - current_src_offset};

View File

@ -84,8 +84,8 @@ void ExtractProtocol::execute(Pos data, size_t size, Pos & res_data, size_t & re
}
void DecodeURLComponentImpl::vector(const ColumnString::Chars_t & data, const ColumnString::Offsets_t & offsets,
ColumnString::Chars_t & res_data, ColumnString::Offsets_t & res_offsets)
void DecodeURLComponentImpl::vector(const ColumnString::Chars_t & data, const ColumnString::Offsets & offsets,
ColumnString::Chars_t & res_data, ColumnString::Offsets & res_offsets)
{
res_data.resize(data.size());
size_t size = offsets.size();

View File

@ -412,9 +412,9 @@ struct ExtractWWW
struct ExtractURLParameterImpl
{
static void vector(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
std::string pattern,
ColumnString::Chars_t & res_data, ColumnString::Offsets_t & res_offsets)
ColumnString::Chars_t & res_data, ColumnString::Offsets & res_offsets)
{
res_data.reserve(data.size() / 5);
res_offsets.resize(offsets.size());
@ -485,9 +485,9 @@ struct ExtractURLParameterImpl
struct CutURLParameterImpl
{
static void vector(const ColumnString::Chars_t & data,
const ColumnString::Offsets_t & offsets,
const ColumnString::Offsets & offsets,
std::string pattern,
ColumnString::Chars_t & res_data, ColumnString::Offsets_t & res_offsets)
ColumnString::Chars_t & res_data, ColumnString::Offsets & res_offsets)
{
res_data.reserve(data.size());
res_offsets.resize(offsets.size());
@ -905,8 +905,8 @@ public:
template <typename Extractor>
struct ExtractSubstringImpl
{
static void vector(const ColumnString::Chars_t & data, const ColumnString::Offsets_t & offsets,
ColumnString::Chars_t & res_data, ColumnString::Offsets_t & res_offsets)
static void vector(const ColumnString::Chars_t & data, const ColumnString::Offsets & offsets,
ColumnString::Chars_t & res_data, ColumnString::Offsets & res_offsets)
{
size_t size = offsets.size();
res_offsets.resize(size);
@ -954,8 +954,8 @@ struct ExtractSubstringImpl
template <typename Extractor>
struct CutSubstringImpl
{
static void vector(const ColumnString::Chars_t & data, const ColumnString::Offsets_t & offsets,
ColumnString::Chars_t & res_data, ColumnString::Offsets_t & res_offsets)
static void vector(const ColumnString::Chars_t & data, const ColumnString::Offsets & offsets,
ColumnString::Chars_t & res_data, ColumnString::Offsets & res_offsets)
{
res_data.reserve(data.size());
size_t size = offsets.size();
@ -1007,8 +1007,8 @@ struct CutSubstringImpl
/// Percent decode of url data.
struct DecodeURLComponentImpl
{
static void vector(const ColumnString::Chars_t & data, const ColumnString::Offsets_t & offsets,
ColumnString::Chars_t & res_data, ColumnString::Offsets_t & res_offsets);
static void vector(const ColumnString::Chars_t & data, const ColumnString::Offsets & offsets,
ColumnString::Chars_t & res_data, ColumnString::Offsets & res_offsets);
static void constant(const std::string & data,
std::string & res_data);

View File

@ -167,7 +167,7 @@ struct ExtractParamImpl
using ResultType = typename ParamExtractor::ResultType;
/// It is assumed that `res` is the correct size and initialized with zeros.
static void vector_constant(const ColumnString::Chars_t & data, const ColumnString::Offsets_t & offsets,
static void vector_constant(const ColumnString::Chars_t & data, const ColumnString::Offsets & offsets,
std::string needle,
PaddedPODArray<ResultType> & res)
{
@ -236,9 +236,9 @@ struct ExtractParamImpl
template <typename ParamExtractor>
struct ExtractParamToStringImpl
{
static void vector(const ColumnString::Chars_t & data, const ColumnString::Offsets_t & offsets,
static void vector(const ColumnString::Chars_t & data, const ColumnString::Offsets & offsets,
std::string needle,
ColumnString::Chars_t & res_data, ColumnString::Offsets_t & res_offsets)
ColumnString::Chars_t & res_data, ColumnString::Offsets & res_offsets)
{
/// Constant 5 is taken from a function that performs a similar task FunctionsStringSearch.h::ExtractImpl
res_data.reserve(data.size() / 5);

View File

@ -57,7 +57,7 @@ struct IArraySource
virtual ~IArraySource() {}
virtual size_t getSizeForReserve() const = 0;
virtual const typename ColumnArray::Offsets_t & getOffsets() const = 0;
virtual const typename ColumnArray::Offsets & getOffsets() const = 0;
virtual size_t getColumnSize() const = 0;
virtual bool isConst() const { return false; }
virtual bool isNullable() const { return false; }
@ -74,11 +74,11 @@ struct NumericArraySource : public IArraySource
using Slice = NumericArraySlice<T>;
using Column = ColumnArray;
const typename ColumnVector<T>::Container_t & elements;
const typename ColumnArray::Offsets_t & offsets;
const typename ColumnVector<T>::Container & elements;
const typename ColumnArray::Offsets & offsets;
size_t row_num = 0;
ColumnArray::Offset_t prev_offset = 0;
ColumnArray::Offset prev_offset = 0;
explicit NumericArraySource(const ColumnArray & arr)
: elements(typeid_cast<const ColumnVector<T> &>(arr.getData()).getData()), offsets(arr.getOffsets())
@ -101,7 +101,7 @@ struct NumericArraySource : public IArraySource
return row_num;
}
const typename ColumnArray::Offsets_t & getOffsets() const override
const typename ColumnArray::Offsets & getOffsets() const override
{
return offsets;
}
@ -225,10 +225,10 @@ struct StringSource
using Column = ColumnString;
const typename ColumnString::Chars_t & elements;
const typename ColumnString::Offsets_t & offsets;
const typename ColumnString::Offsets & offsets;
size_t row_num = 0;
ColumnString::Offset_t prev_offset = 0;
ColumnString::Offset prev_offset = 0;
explicit StringSource(const ColumnString & col)
: elements(col.getChars()), offsets(col.getOffsets())
@ -382,11 +382,11 @@ struct FixedStringSource
template <typename T>
struct NumericArraySink : public IArraySink
{
typename ColumnVector<T>::Container_t & elements;
typename ColumnArray::Offsets_t & offsets;
typename ColumnVector<T>::Container & elements;
typename ColumnArray::Offsets & offsets;
size_t row_num = 0;
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
NumericArraySink(ColumnArray & arr, size_t column_size)
: elements(typeid_cast<ColumnVector<T> &>(arr.getData()).getData()), offsets(arr.getOffsets())
@ -420,10 +420,10 @@ struct NumericArraySink : public IArraySink
struct StringSink
{
typename ColumnString::Chars_t & elements;
typename ColumnString::Offsets_t & offsets;
typename ColumnString::Offsets & offsets;
size_t row_num = 0;
ColumnString::Offset_t current_offset = 0;
ColumnString::Offset current_offset = 0;
StringSink(ColumnString & col, size_t column_size)
: elements(col.getChars()), offsets(col.getOffsets())
@ -463,7 +463,7 @@ struct FixedStringSink
size_t row_num = 0;
size_t total_rows;
ColumnString::Offset_t current_offset = 0;
ColumnString::Offset current_offset = 0;
FixedStringSink(ColumnFixedString & col, size_t column_size)
: elements(col.getChars()), string_size(col.getN()), total_rows(column_size)
@ -548,10 +548,10 @@ struct GenericArraySource : public IArraySource
using Column = ColumnArray;
const IColumn & elements;
const typename ColumnArray::Offsets_t & offsets;
const typename ColumnArray::Offsets & offsets;
size_t row_num = 0;
ColumnArray::Offset_t prev_offset = 0;
ColumnArray::Offset prev_offset = 0;
explicit GenericArraySource(const ColumnArray & arr)
: elements(arr.getData()), offsets(arr.getOffsets())
@ -574,7 +574,7 @@ struct GenericArraySource : public IArraySource
return row_num;
}
const typename ColumnArray::Offsets_t & getOffsets() const override
const typename ColumnArray::Offsets & getOffsets() const override
{
return offsets;
}
@ -635,10 +635,10 @@ struct GenericArraySource : public IArraySource
struct GenericArraySink : public IArraySink
{
IColumn & elements;
ColumnArray::Offsets_t & offsets;
ColumnArray::Offsets & offsets;
size_t row_num = 0;
ColumnArray::Offset_t current_offset = 0;
ColumnArray::Offset current_offset = 0;
GenericArraySink(ColumnArray & arr, size_t column_size)
: elements(arr.getData()), offsets(arr.getOffsets())
@ -687,7 +687,7 @@ struct NullableArraySource : public ArraySource
using ArraySource::row_num;
using ArraySource::offsets;
const ColumnUInt8::Container_t & null_map;
const ColumnUInt8::Container & null_map;
NullableArraySource(const ColumnArray & arr, const ColumnUInt8 & null_map)
: ArraySource(arr), null_map(null_map.getData())
@ -750,7 +750,7 @@ struct NullableArraySource : public ArraySource
template <typename ArraySink>
struct NullableArraySink : public ArraySink
{
ColumnUInt8::Container_t & null_map;
ColumnUInt8::Container & null_map;
NullableArraySink(ColumnArray & arr, ColumnUInt8 & null_map, size_t column_size)
: ArraySink(arr, column_size), null_map(null_map.getData())
@ -1051,7 +1051,7 @@ void NO_INLINE sliceDynamicOffsetUnbounded(Source && src, Sink && sink, IColumn
{
const bool is_null = offset_column.onlyNull();
auto * nullable = typeid_cast<ColumnNullable *>(&offset_column);
ColumnUInt8::Container_t * null_map = nullable ? &nullable->getNullMapColumn().getData() : nullptr;
ColumnUInt8::Container * null_map = nullable ? &nullable->getNullMapColumn().getData() : nullptr;
IColumn * nested_column = nullable ? nullable->getNestedColumn() : &offset_column;
while (!src.isEnd())
@ -1082,12 +1082,12 @@ void NO_INLINE sliceDynamicOffsetBounded(Source && src, Sink && sink, IColumn &
{
const bool is_offset_null = offset_column.onlyNull();
auto * offset_nullable = typeid_cast<ColumnNullable *>(&offset_column);
ColumnUInt8::Container_t * offset_null_map = offset_nullable ? &offset_nullable->getNullMapColumn().getData() : nullptr;
ColumnUInt8::Container * offset_null_map = offset_nullable ? &offset_nullable->getNullMapColumn().getData() : nullptr;
IColumn * offset_nested_column = offset_nullable ? offset_nullable->getNestedColumn() : &offset_column;
const bool is_length_null = length_column.onlyNull();
auto * length_nullable = typeid_cast<ColumnNullable *>(&length_column);
ColumnUInt8::Container_t * length_null_map = length_nullable ? &length_nullable->getNullMapColumn().getData() : nullptr;
ColumnUInt8::Container * length_null_map = length_nullable ? &length_nullable->getNullMapColumn().getData() : nullptr;
IColumn * length_nested_column = length_nullable ? length_nullable->getNestedColumn() : &length_column;
while (!src.isEnd())

View File

@ -177,7 +177,7 @@ struct AggregationMethodString
struct State
{
const ColumnString::Offsets_t * offsets;
const ColumnString::Offsets * offsets;
const ColumnString::Chars_t * chars;
void init(ColumnRawPtrs & key_columns)
@ -1042,8 +1042,8 @@ public:
void execute(const BlockInputStreamPtr & stream, AggregatedDataVariants & result);
using AggregateColumns = std::vector<ColumnRawPtrs>;
using AggregateColumnsData = std::vector<ColumnAggregateFunction::Container_t *>;
using AggregateColumnsConstData = std::vector<const ColumnAggregateFunction::Container_t *>;
using AggregateColumnsData = std::vector<ColumnAggregateFunction::Container *>;
using AggregateColumnsConstData = std::vector<const ColumnAggregateFunction::Container *>;
using AggregateFunctionsPlainPtrs = std::vector<IAggregateFunction *>;
/// Process one block. Return false if the processing should be aborted (with group_by_overflow_mode = 'break').

View File

@ -553,7 +553,7 @@ namespace
struct Adder<ASTTableJoin::Kind::Left, ASTTableJoin::Strictness::Any, Map>
{
static void addFound(const typename Map::const_iterator & it, size_t num_columns_to_add, MutableColumns & added_columns,
size_t /*i*/, IColumn::Filter * /*filter*/, IColumn::Offset_t & /*current_offset*/, IColumn::Offsets_t * /*offsets*/,
size_t /*i*/, IColumn::Filter * /*filter*/, IColumn::Offset & /*current_offset*/, IColumn::Offsets * /*offsets*/,
size_t num_columns_to_skip)
{
for (size_t j = 0; j < num_columns_to_add; ++j)
@ -561,7 +561,7 @@ namespace
}
static void addNotFound(size_t num_columns_to_add, MutableColumns & added_columns,
size_t /*i*/, IColumn::Filter * /*filter*/, IColumn::Offset_t & /*current_offset*/, IColumn::Offsets_t * /*offsets*/)
size_t /*i*/, IColumn::Filter * /*filter*/, IColumn::Offset & /*current_offset*/, IColumn::Offsets * /*offsets*/)
{
for (size_t j = 0; j < num_columns_to_add; ++j)
added_columns[j]->insertDefault();
@ -572,7 +572,7 @@ namespace
struct Adder<ASTTableJoin::Kind::Inner, ASTTableJoin::Strictness::Any, Map>
{
static void addFound(const typename Map::const_iterator & it, size_t num_columns_to_add, MutableColumns & added_columns,
size_t i, IColumn::Filter * filter, IColumn::Offset_t & /*current_offset*/, IColumn::Offsets_t * /*offsets*/,
size_t i, IColumn::Filter * filter, IColumn::Offset & /*current_offset*/, IColumn::Offsets * /*offsets*/,
size_t num_columns_to_skip)
{
(*filter)[i] = 1;
@ -582,7 +582,7 @@ namespace
}
static void addNotFound(size_t /*num_columns_to_add*/, MutableColumns & /*added_columns*/,
size_t i, IColumn::Filter * filter, IColumn::Offset_t & /*current_offset*/, IColumn::Offsets_t * /*offsets*/)
size_t i, IColumn::Filter * filter, IColumn::Offset & /*current_offset*/, IColumn::Offsets * /*offsets*/)
{
(*filter)[i] = 0;
}
@ -592,7 +592,7 @@ namespace
struct Adder<KIND, ASTTableJoin::Strictness::All, Map>
{
static void addFound(const typename Map::const_iterator & it, size_t num_columns_to_add, MutableColumns & added_columns,
size_t i, IColumn::Filter * /*filter*/, IColumn::Offset_t & current_offset, IColumn::Offsets_t * offsets,
size_t i, IColumn::Filter * /*filter*/, IColumn::Offset & current_offset, IColumn::Offsets * offsets,
size_t num_columns_to_skip)
{
size_t rows_joined = 0;
@ -609,7 +609,7 @@ namespace
}
static void addNotFound(size_t num_columns_to_add, MutableColumns & added_columns,
size_t i, IColumn::Filter * /*filter*/, IColumn::Offset_t & current_offset, IColumn::Offsets_t * offsets)
size_t i, IColumn::Filter * /*filter*/, IColumn::Offset & current_offset, IColumn::Offsets * offsets)
{
if (KIND == ASTTableJoin::Kind::Inner)
{
@ -631,7 +631,7 @@ namespace
const Map & map, size_t rows, const ColumnRawPtrs & key_columns, size_t keys_size, const Sizes & key_sizes,
size_t num_columns_to_add, size_t num_columns_to_skip, MutableColumns & added_columns, ConstNullMapPtr null_map,
std::unique_ptr<IColumn::Filter> & filter,
IColumn::Offset_t & current_offset, std::unique_ptr<IColumn::Offsets_t> & offsets_to_replicate)
IColumn::Offset & current_offset, std::unique_ptr<IColumn::Offsets> & offsets_to_replicate)
{
KeyGetter key_getter(key_columns);
@ -665,7 +665,7 @@ namespace
const Map & map, size_t rows, const ColumnRawPtrs & key_columns, size_t keys_size, const Sizes & key_sizes,
size_t num_columns_to_add, size_t num_columns_to_skip, MutableColumns & added_columns, ConstNullMapPtr null_map,
std::unique_ptr<IColumn::Filter> & filter,
IColumn::Offset_t & current_offset, std::unique_ptr<IColumn::Offsets_t> & offsets_to_replicate)
IColumn::Offset & current_offset, std::unique_ptr<IColumn::Offsets> & offsets_to_replicate)
{
if (null_map)
joinBlockImplTypeCase<KIND, STRICTNESS, KeyGetter, Map, true>(
@ -749,11 +749,11 @@ void Join::joinBlockImpl(Block & block, const Maps & maps) const
filter = std::make_unique<IColumn::Filter>(rows);
/// Used with ALL ... JOIN
IColumn::Offset_t current_offset = 0;
std::unique_ptr<IColumn::Offsets_t> offsets_to_replicate;
IColumn::Offset current_offset = 0;
std::unique_ptr<IColumn::Offsets> offsets_to_replicate;
if (strictness == ASTTableJoin::Strictness::All)
offsets_to_replicate = std::make_unique<IColumn::Offsets_t>(rows);
offsets_to_replicate = std::make_unique<IColumn::Offsets>(rows);
/** For LEFT/INNER JOIN, the saved blocks do not contain keys.
* For FULL/RIGHT JOIN, the saved blocks contain keys;

View File

@ -55,7 +55,7 @@ struct JoinKeyGetterString
{
using Key = StringRef;
const ColumnString::Offsets_t * offsets;
const ColumnString::Offsets * offsets;
const ColumnString::Chars_t * chars;
JoinKeyGetterString(const ColumnRawPtrs & key_columns)

View File

@ -297,7 +297,7 @@ ColumnPtr Set::execute(const Block & block, bool negative) const
throw Exception("Logical error: no columns passed to Set::execute method.", ErrorCodes::LOGICAL_ERROR);
auto res = ColumnUInt8::create();
ColumnUInt8::Container_t & vec_res = res->getData();
ColumnUInt8::Container & vec_res = res->getData();
vec_res.resize(block.safeGetByPosition(0).column->size());
std::shared_lock lock(rwlock);
@ -392,7 +392,7 @@ template <typename Method>
void NO_INLINE Set::executeImpl(
Method & method,
const ColumnRawPtrs & key_columns,
ColumnUInt8::Container_t & vec_res,
ColumnUInt8::Container & vec_res,
bool negative,
size_t rows,
ConstNullMapPtr null_map) const
@ -408,7 +408,7 @@ template <typename Method, bool has_null_map>
void NO_INLINE Set::executeImplCase(
Method & method,
const ColumnRawPtrs & key_columns,
ColumnUInt8::Container_t & vec_res,
ColumnUInt8::Container & vec_res,
bool negative,
size_t rows,
ConstNullMapPtr null_map) const
@ -437,8 +437,8 @@ template <typename Method>
void NO_INLINE Set::executeArrayImpl(
Method & method,
const ColumnRawPtrs & key_columns,
const ColumnArray::Offsets_t & offsets,
ColumnUInt8::Container_t & vec_res,
const ColumnArray::Offsets & offsets,
ColumnUInt8::Container & vec_res,
bool negative,
size_t rows) const
{
@ -468,7 +468,7 @@ void NO_INLINE Set::executeArrayImpl(
void Set::executeOrdinary(
const ColumnRawPtrs & key_columns,
ColumnUInt8::Container_t & vec_res,
ColumnUInt8::Container & vec_res,
bool negative,
ConstNullMapPtr null_map) const
{
@ -487,10 +487,10 @@ void Set::executeOrdinary(
}
}
void Set::executeArray(const ColumnArray * key_column, ColumnUInt8::Container_t & vec_res, bool negative) const
void Set::executeArray(const ColumnArray * key_column, ColumnUInt8::Container & vec_res, bool negative) const
{
size_t rows = key_column->size();
const ColumnArray::Offsets_t & offsets = key_column->getOffsets();
const ColumnArray::Offsets & offsets = key_column->getOffsets();
const IColumn & nested_column = key_column->getData();
switch (data.type)

View File

@ -88,12 +88,12 @@ private:
OverflowMode overflow_mode;
/// If there is an array on the left side of IN. We check that at least one element of the array presents in the set.
void executeArray(const ColumnArray * key_column, ColumnUInt8::Container_t & vec_res, bool negative) const;
void executeArray(const ColumnArray * key_column, ColumnUInt8::Container & vec_res, bool negative) const;
/// If in the left part columns contains the same types as the elements of the set.
void executeOrdinary(
const ColumnRawPtrs & key_columns,
ColumnUInt8::Container_t & vec_res,
ColumnUInt8::Container & vec_res,
bool negative,
const PaddedPODArray<UInt8> * null_map) const;
@ -134,7 +134,7 @@ private:
void executeImpl(
Method & method,
const ColumnRawPtrs & key_columns,
ColumnUInt8::Container_t & vec_res,
ColumnUInt8::Container & vec_res,
bool negative,
size_t rows,
ConstNullMapPtr null_map) const;
@ -143,7 +143,7 @@ private:
void executeImplCase(
Method & method,
const ColumnRawPtrs & key_columns,
ColumnUInt8::Container_t & vec_res,
ColumnUInt8::Container & vec_res,
bool negative,
size_t rows,
ConstNullMapPtr null_map) const;
@ -152,8 +152,8 @@ private:
void executeArrayImpl(
Method & method,
const ColumnRawPtrs & key_columns,
const ColumnArray::Offsets_t & offsets,
ColumnUInt8::Container_t & vec_res,
const ColumnArray::Offsets & offsets,
ColumnUInt8::Container & vec_res,
bool negative,
size_t rows) const;
};

View File

@ -67,7 +67,7 @@ struct SetMethodString
struct State
{
const ColumnString::Offsets_t * offsets;
const ColumnString::Offsets * offsets;
const ColumnString::Chars_t * chars;
void init(const ColumnRawPtrs & key_columns)

View File

@ -109,7 +109,7 @@ size_t MergeTreeReader::readRows(size_t from_mark, bool continue_reading, size_t
{
if (!append)
{
offset_columns[name] = ColumnArray::ColumnOffsets_t::create();
offset_columns[name] = ColumnArray::ColumnOffsets::create();
column = ColumnArray::create(type_arr->getNestedType()->createColumn(), offset_columns[name]);
}
}

View File

@ -220,7 +220,7 @@ Block LogBlockInputStream::readImpl()
String name = DataTypeNested::extractNestedTableName(name);
if (offset_columns.count(name) == 0)
offset_columns[name] = ColumnArray::ColumnOffsets_t::create();
offset_columns[name] = ColumnArray::ColumnOffsets::create();
else
read_offsets = false; /// on previous iterations the offsets were already read by `readData`

View File

@ -205,7 +205,7 @@ Block TinyLogBlockInputStream::readImpl()
String nested_name = DataTypeNested::extractNestedTableName(name);
if (offset_columns.count(nested_name) == 0)
offset_columns[nested_name] = ColumnArray::ColumnOffsets_t::create();
offset_columns[nested_name] = ColumnArray::ColumnOffsets::create();
else
read_offsets = false; /// on previous iterations, the offsets were already calculated by `readData`

View File

@ -67,7 +67,7 @@ BlockInputStreams StorageSystemColumns::read(
/// Add `table` column.
ColumnPtr table_column = ColumnString::create();
IColumn::Offsets_t offsets(rows);
IColumn::Offsets offsets(rows);
for (size_t i = 0; i < rows; ++i)
{
const std::string database_name = (*database_column)[i].get<std::string>();

View File

@ -28,7 +28,7 @@ protected:
column_with_type_and_name.name = "number";
column_with_type_and_name.type = std::make_shared<DataTypeUInt64>();
auto column = ColumnUInt64::create(block_size);
ColumnUInt64::Container_t & vec = column->getData();
ColumnUInt64::Container & vec = column->getData();
column_with_type_and_name.column = column;
size_t curr = next; /// The local variable for some reason works faster (>20%) than member of class.

View File

@ -96,7 +96,7 @@ BlockInputStreams StorageSystemParts::read(
database_column = block_to_filter.getByName("database").column;
size_t rows = database_column->size();
IColumn::Offsets_t offsets(rows);
IColumn::Offsets offsets(rows);
ColumnPtr table_column = ColumnString::create();
ColumnPtr engine_column = ColumnString::create();
ColumnPtr active_column = ColumnUInt8::create();

View File

@ -37,7 +37,7 @@ try
column1.name = "a";
column1.type = table->getDataTypeByName("a");
column1.column = column1.type->createColumn();
ColumnUInt64::Container_t & vec1 = typeid_cast<ColumnUInt64&>(*column1.column).getData();
ColumnUInt64::Container & vec1 = typeid_cast<ColumnUInt64&>(*column1.column).getData();
vec1.resize(rows);
for (size_t i = 0; i < rows; ++i)
@ -49,7 +49,7 @@ try
column2.name = "b";
column2.type = table->getDataTypeByName("b");
column2.column = column2.type->createColumn();
ColumnUInt8::Container_t & vec2 = typeid_cast<ColumnUInt8&>(*column2.column).getData();
ColumnUInt8::Container & vec2 = typeid_cast<ColumnUInt8&>(*column2.column).getData();
vec2.resize(rows);
for (size_t i = 0; i < rows; ++i)