yiguolei commented on code in PR #60530:
URL: https://github.com/apache/doris/pull/60530#discussion_r2773068507
##########
be/src/olap/rowset/segment_v2/column_reader.cpp:
##########
@@ -2106,139 +2065,40 @@ Status DefaultValueColumnIterator::init(const
ColumnIteratorOptions& opts) {
// "NULL" is a special default value which means the default value is null.
if (_has_default_value) {
if (_default_value == "NULL") {
- _is_default_value_null = true;
+ _default_value_field =
vectorized::Field::create_field<TYPE_NULL>(vectorized::Null {});
} else {
- _type_size = _type_info->size();
- _mem_value.resize(_type_size);
- Status s = Status::OK();
- // If char length is 10, but default value is 'a' , it's length is
1
- // not fill 0 to the ending, because segment iterator will shrink
the tail 0 char
- if (_type_info->type() == FieldType::OLAP_FIELD_TYPE_VARCHAR ||
- _type_info->type() == FieldType::OLAP_FIELD_TYPE_HLL ||
- _type_info->type() == FieldType::OLAP_FIELD_TYPE_BITMAP ||
- _type_info->type() == FieldType::OLAP_FIELD_TYPE_STRING ||
- _type_info->type() == FieldType::OLAP_FIELD_TYPE_CHAR) {
- ((Slice*)_mem_value.data())->size = _default_value.length();
- ((Slice*)_mem_value.data())->data = _default_value.data();
- } else if (_type_info->type() == FieldType::OLAP_FIELD_TYPE_ARRAY)
{
+ if (_type_info->type() == FieldType::OLAP_FIELD_TYPE_ARRAY) {
if (_default_value != "[]") {
return Status::NotSupported("Array default {} is
unsupported", _default_value);
} else {
- ((Slice*)_mem_value.data())->size =
_default_value.length();
- ((Slice*)_mem_value.data())->data = _default_value.data();
+ _default_value_field =
+
vectorized::Field::create_field<TYPE_ARRAY>(vectorized::Array {});
+ return Status::OK();
}
} else if (_type_info->type() ==
FieldType::OLAP_FIELD_TYPE_STRUCT) {
Review Comment:
compaction diable
table col1, col2
insert 1 1
alter table add column col3 char(10) default 'a'
insert 1,1,'b'
select * from table where col3 == 'a'
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]