Support add hll column in Schemachange (#1033)
This commit is contained in:
@ -347,7 +347,8 @@ public:
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OLAP_FIELD_TYPE_VARCHAR: {
|
||||
case OLAP_FIELD_TYPE_VARCHAR:
|
||||
case OLAP_FIELD_TYPE_HLL: {
|
||||
_values =
|
||||
reinterpret_cast<void*>(mem_pool->allocate(size * sizeof(Slice)));
|
||||
int32_t length = _default_value.length();
|
||||
|
||||
@ -21,7 +21,9 @@ namespace doris {
|
||||
|
||||
WrapperField* WrapperField::create(const FieldInfo& info, uint32_t len) {
|
||||
bool is_string_type =
|
||||
(info.type == OLAP_FIELD_TYPE_CHAR || info.type == OLAP_FIELD_TYPE_VARCHAR);
|
||||
(info.type == OLAP_FIELD_TYPE_CHAR
|
||||
|| info.type == OLAP_FIELD_TYPE_VARCHAR
|
||||
|| info.type == OLAP_FIELD_TYPE_HLL);
|
||||
if (is_string_type && len > OLAP_STRING_MAX_LENGTH) {
|
||||
OLAP_LOG_WARNING("length of string parameter is too long[len=%lu, max_len=%lu].",
|
||||
len, OLAP_STRING_MAX_LENGTH);
|
||||
@ -36,7 +38,7 @@ WrapperField* WrapperField::create(const FieldInfo& info, uint32_t len) {
|
||||
size_t variable_len = 0;
|
||||
if (info.type == OLAP_FIELD_TYPE_CHAR) {
|
||||
variable_len = std::max(len, info.length);
|
||||
} else if (info.type == OLAP_FIELD_TYPE_VARCHAR) {
|
||||
} else if (info.type == OLAP_FIELD_TYPE_VARCHAR || info.type == OLAP_FIELD_TYPE_HLL) {
|
||||
variable_len = std::max(len,
|
||||
static_cast<uint32_t>(info.length - sizeof(StringLengthType)));
|
||||
} else {
|
||||
@ -52,7 +54,9 @@ WrapperField* WrapperField::create_by_type(const FieldType& type) {
|
||||
if (rep == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
bool is_string_type = (type == OLAP_FIELD_TYPE_CHAR || type == OLAP_FIELD_TYPE_VARCHAR);
|
||||
bool is_string_type = (type == OLAP_FIELD_TYPE_CHAR
|
||||
|| type == OLAP_FIELD_TYPE_VARCHAR
|
||||
|| type == OLAP_FIELD_TYPE_HLL);
|
||||
WrapperField* wrapper = new WrapperField(rep, 0, is_string_type);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user