[enhancement](array-type) Split Array Offsets and String Offsets (#12341)

In old Doris version string offsets are 32bit, but it is not enough for Array type.
If we change string offsets from 32bit to 64bit, there will be problem if we upgrade BE one by one. Because at the same time 32bit Offsets and 64 bit Offsets String will exist at the same time.
As a result, we separate the Codes for Array Offsets.
Co-authored-by: cambyzju <zhuxiaoli01@baidu.com>
This commit is contained in:
camby
2022-09-06 11:18:27 +08:00
committed by GitHub
parent 53b79d5a8c
commit cf5d194fe1
20 changed files with 191 additions and 169 deletions

View File

@ -117,7 +117,8 @@ private:
}
template <typename ColumnType>
static bool _execute_number(const IColumn& src_column, const ColumnArray::Offsets& src_offsets,
static bool _execute_number(const IColumn& src_column,
const ColumnArray::Offsets64& src_offsets,
const UInt8* src_null_map, const std::string& sep_str,
const std::string& null_replace_str, DataTypePtr& nested_type,
ColumnString* dest_column_ptr) {
@ -129,10 +130,10 @@ private:
return false;
}
ColumnArray::Offset prev_src_offset = 0;
size_t prev_src_offset = 0;
for (auto curr_src_offset : src_offsets) {
std::string result_str;
for (ColumnArray::Offset j = prev_src_offset; j < curr_src_offset; ++j) {
for (size_t j = prev_src_offset; j < curr_src_offset; ++j) {
if (src_null_map && src_null_map[j]) {
if (null_replace_str.size() == 0) {
continue;
@ -160,7 +161,8 @@ private:
return true;
}
static bool _execute_string(const IColumn& src_column, const ColumnArray::Offsets& src_offsets,
static bool _execute_string(const IColumn& src_column,
const ColumnArray::Offsets64& src_offsets,
const UInt8* src_null_map, const std::string& sep_str,
const std::string& null_replace_str,
ColumnString* dest_column_ptr) {
@ -169,10 +171,10 @@ private:
return false;
}
ColumnArray::Offset prev_src_offset = 0;
size_t prev_src_offset = 0;
for (auto curr_src_offset : src_offsets) {
std::string result_str;
for (ColumnArray::Offset j = prev_src_offset; j < curr_src_offset; ++j) {
for (size_t j = prev_src_offset; j < curr_src_offset; ++j) {
if (src_null_map && src_null_map[j]) {
if (null_replace_str.size() == 0) {
continue;
@ -193,7 +195,8 @@ private:
return true;
}
static bool _execute_by_type(const IColumn& src_column, const ColumnArray::Offsets& src_offsets,
static bool _execute_by_type(const IColumn& src_column,
const ColumnArray::Offsets64& src_offsets,
const UInt8* src_null_map, const std::string& sep_str,
const std::string& null_replace_str, DataTypePtr& nested_type,
ColumnString* dest_column_ptr) {
@ -240,4 +243,4 @@ private:
}
};
} // namespace doris::vectorized
} // namespace doris::vectorized