MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / hasImplicitCastStruct

Function hasImplicitCastStruct

src/function/vector_cast_functions.cpp:205–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205static bool hasImplicitCastStruct(const LogicalType& srcType, const LogicalType& dstType) {
206 const auto& srcFields = StructType::getFields(srcType);
207 const auto& dstFields = StructType::getFields(dstType);
208 if (srcFields.size() != dstFields.size()) {
209 return false;
210 }
211 for (auto i = 0u; i < srcFields.size(); i++) {
212 if (srcFields[i].getName() != dstFields[i].getName()) {
213 return false;
214 }
215 if (!CastFunction::hasImplicitCast(srcFields[i].getType(), dstFields[i].getType())) {
216 return false;
217 }
218 }
219 return true;
220}
221
222static bool hasImplicitCastUnion(const LogicalType& srcType, const LogicalType& dstType) {
223 if (srcType.getLogicalTypeID() == LogicalTypeID::UNION) {

Callers 1

hasImplicitCastMethod · 0.85

Calls 3

sizeMethod · 0.45
getNameMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected