214043 {
214044 auto &cast_data = parameters.cast_data->Cast<ListBoundCastData>();
214045
214046
214047 if (source.GetVectorType() == VectorType::CONSTANT_VECTOR) {
214048 result.SetVectorType(source.GetVectorType());
214049 const bool is_null = ConstantVector::IsNull(source);
214050 ConstantVector::SetNull(result, is_null);
214051
214052 if (!is_null) {
214053 auto ldata = ConstantVector::GetData<list_entry_t>(source);
214054 auto tdata = ConstantVector::GetData<list_entry_t>(result);
214055 *tdata = *ldata;
214056 }
214057 } else {
214058 source.Flatten(count);
214059 result.SetVectorType(VectorType::FLAT_VECTOR);
214060 FlatVector::SetValidity(result, FlatVector::Validity(source));
214061
214062 auto ldata = FlatVector::GetData<list_entry_t>(source);
214063 auto tdata = FlatVector::GetData<list_entry_t>(result);
214064 for (
idx_t i = 0; i < count; i++) {
214065 tdata[i] = ldata[i];
214066 }
214067 }
214070
214073
214074 CastParameters child_parameters(parameters, cast_data.child_cast_info.cast_data, parameters.local_state);
214075 bool all_succeeded = cast_data.child_cast_info.function(source_cc, append_vector, source_size, child_parameters);
214078 return all_succeeded;
214079}
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 SetListSize(Vector &vec, idx_t size)
Sets the total size of the underlying child-vector of a list.
Definition duckdb.cpp:138248
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