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

Function canCopyValueForNested

src/c_api/value.cpp:39–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39static bool canCopyValueForNested(const Value& value, const LogicalType& targetType) {
40 if (value.getDataType() == targetType) {
41 return true;
42 }
43 if (value.isNull() && value.getDataType().getLogicalTypeID() == LogicalTypeID::ANY) {
44 return true;
45 }
46 if (isEmptyNestedWithAny(value)) {
47 return true;
48 }
49 if (targetType.getLogicalTypeID() == LogicalTypeID::STRING ||
50 targetType.getLogicalTypeID() == LogicalTypeID::DOUBLE ||
51 targetType.getLogicalTypeID() == LogicalTypeID::FLOAT) {
52 return true;
53 }
54 return value.getDataType().getLogicalTypeID() == targetType.getLogicalTypeID() &&
55 value.getDataType().containsAny();
56}
57
58static std::string incompatibleParameterTypeMessage(const LogicalType& left,
59 const LogicalType& right) {

Callers 2

lbug_value_create_listFunction · 0.85
lbug_value_create_mapFunction · 0.85

Calls 5

isEmptyNestedWithAnyFunction · 0.85
getDataTypeMethod · 0.80
getLogicalTypeIDMethod · 0.80
isNullMethod · 0.45
containsAnyMethod · 0.45

Tested by

no test coverage detected