morningman commented on a change in pull request #2979: Incomplete support
Array type (#2871)
URL: https://github.com/apache/incubator-doris/pull/2979#discussion_r386773407
##########
File path: be/src/runtime/raw_value.cpp
##########
@@ -300,7 +314,34 @@ void RawValue::write(const void* value, void* dst, const
TypeDescriptor& type, M
} else {
dest->ptr = src->ptr;
}
+ break;
+ }
+ case TYPE_ARRAY: {
+ DCHECK_EQ(type.children.size(), 1);
+
+ const CollectionValue* src = reinterpret_cast<const
CollectionValue*>(value);
+ CollectionValue* val = reinterpret_cast<CollectionValue*>(dst);
+ if (pool != NULL) {
+ auto children_type = type.children.at(0).type;
+ CollectionValue::init_collection(pool, src->size(), children_type,
val);
+ CollectionIterator src_iter = src->iterator(children_type);
+ CollectionIterator val_iter = val->iterator(children_type);
+
+ val->copy_null_signs(src);
+
+ while (src_iter.has_next() && val_iter.has_next()) {
+ if (!src_iter.is_null()) {
+ // write children
+ write(src_iter.value(), val_iter.value(), children_type,
pool);
+ }
Review comment:
Do we need to set the nullbits in `val_iter`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]