From cbbf4e10ff50c689caa0520adba1515a06782f6b Mon Sep 17 00:00:00 2001 From: carlvinhust2012 Date: Tue, 23 Aug 2022 21:54:00 +0800 Subject: [PATCH] [fix](array-type) fix be occasional coredump when use stream load (#11997) Co-authored-by: hucheng01 --- be/src/runtime/collection_value.cpp | 1 + be/src/runtime/row_batch.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/be/src/runtime/collection_value.cpp b/be/src/runtime/collection_value.cpp index fb9de9635c..345fc5c329 100644 --- a/be/src/runtime/collection_value.cpp +++ b/be/src/runtime/collection_value.cpp @@ -184,6 +184,7 @@ struct ArrayIteratorFunctionsForString : public GenericArrayIteratorFunctionsptr = (convert_ptrs ? convert_to(offset) : copied_string); } static void deserialize(void* item, const char* tuple_data, const TypeDescriptor& type_desc) { + DCHECK((item != nullptr) && (tuple_data != nullptr)) << "item or tuple_data is nullptr"; auto* string_value = static_cast(item); if (string_value->len) { int64_t offset = convert_to(string_value->ptr); diff --git a/be/src/runtime/row_batch.cpp b/be/src/runtime/row_batch.cpp index 9c8ac6d3aa..79cfe1a946 100644 --- a/be/src/runtime/row_batch.cpp +++ b/be/src/runtime/row_batch.cpp @@ -172,6 +172,9 @@ RowBatch::RowBatch(const RowDescriptor& row_desc, const PRowBatch& input_batch) // copy collection slots for (auto slot_collection : desc->collection_slots()) { DCHECK(slot_collection->type().is_collection_type()); + if (tuple->is_null(slot_collection->null_indicator_offset())) { + continue; + } CollectionValue* array_val = tuple->get_collection_slot(slot_collection->tuple_offset());