234173 {
234174#ifdef D_ASSERT_IS_ENABLED
234175 auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
234176 const auto &info = func_expr.bind_info->Cast<RegexpExtractAllStructBindData>();
234177
234178 D_ASSERT(info.constant_pattern);
234179#endif
234180
234181
234182 auto &strings = args.data[0];
234183
234184 D_ASSERT(result.GetType().id() == LogicalTypeId::LIST);
234186 D_ASSERT(struct_vector.GetType().id() == LogicalTypeId::STRUCT);
234187 auto &child_entries = StructVector::GetEntries(struct_vector);
234188 const idx_t group_count = child_entries.size();
234189
234190
234191 for (auto &child : child_entries) {
234192 child->SetAuxiliary(strings.GetAuxiliary());
234193 child->SetVectorType(VectorType::FLAT_VECTOR);
234194 }
234195
234196 UnifiedVectorFormat strings_data;
234197 strings.ToUnifiedFormat(args.size(), strings_data);
234199 idx_t tuple_count = args.AllConstant() ? 1 : args.size();
234200
234201 auto &lstate = ExecuteFunctionState::GetFunctionState(state)->Cast<RegexLocalState>();
234202
234203 auto &list_validity = FlatVector::Validity(result);
234204 auto list_entries = FlatVector::GetData<list_entry_t>(result);
234205
234206 vector<duckdb_re2::StringPiece> group_spans(group_count + 1);
234207
234208 for (
idx_t row = 0; row < tuple_count; row++) {
234209 auto sindex = strings_data.sel->get_index(row);
234210 if (!strings_data.validity.RowIsValid(sindex)) {
234212 list_entries[row].length = 0;
234213 list_validity.SetInvalid(row);
234214 continue;
234215 }
234216 auto &string_val = UnifiedVectorFormat::GetData<string_t>(strings_data)[sindex];
234217 ExtractStructAllSingleTuple(string_val, lstate.constant_pattern, group_spans, child_entries, result, row);
234218 }
234219 if (args.AllConstant()) {
234220 result.SetVectorType(VectorType::CONSTANT_VECTOR);
234221 }
234222}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
static DUCKDB_API const Vector & GetEntry(const Vector &vector)
Gets a reference to the underlying child-vector of a list.
Definition duckdb.cpp:138203
static DUCKDB_API void Reserve(Vector &vec, idx_t required_capacity)
Sets the total capacity of the underlying child-vector of a list.
Definition duckdb.cpp:138211
static DUCKDB_API idx_t GetListSize(const Vector &vector)
Gets the total size of the underlying child-vector of a list.
Definition duckdb.cpp:138221