Returns information to only copy a section of a list child vector.
138293 {
138294 ConsecutiveChildListInfo info;
138295 UnifiedVectorFormat unified_list_data;
138296 list.ToUnifiedFormat(offset + count, unified_list_data);
138297 auto list_data = UnifiedVectorFormat::GetData<list_entry_t>(unified_list_data);
138298
138299
138300 idx_t first_length = 0;
138301 for (
idx_t i = offset; i < offset + count; i++) {
138302 auto idx = unified_list_data.sel->get_index(i);
138303 if (!unified_list_data.validity.RowIsValid(idx)) {
138304 continue;
138305 }
138306 info.child_list_info.offset = list_data[idx].offset;
138307 first_length = list_data[idx].length;
138308 break;
138309 }
138310
138311
138312
138313 if (list.GetVectorType() == VectorType::CONSTANT_VECTOR) {
138314 info.child_list_info.length = first_length;
138315 return info;
138316 }
138317
138318
138319
138320
138321 bool is_consecutive = true;
138322 for (
idx_t i = offset; i < offset + count; i++) {
138323 auto idx = unified_list_data.sel->get_index(i);
138324 if (!unified_list_data.validity.RowIsValid(idx)) {
138325 continue;
138326 }
138327 if (list_data[idx].offset != info.child_list_info.offset || list_data[idx].length != first_length) {
138328 info.is_constant = false;
138329 }
138330 if (list_data[idx].offset != info.child_list_info.offset + info.child_list_info.length) {
138331 is_consecutive = false;
138332 }
138333 info.child_list_info.length += list_data[idx].length;
138334 }
138335
138336 if (info.is_constant) {
138337 info.child_list_info.length = first_length;
138338 }
138339 if (!info.is_constant && !is_consecutive) {
138340 info.needs_slicing = true;
138341 }
138342
138343 return info;
138344}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237