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

Function bindCastBetweenNested

src/function/vector_cast_functions.cpp:735–747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

733}
734
735static std::unique_ptr<ScalarFunction> bindCastBetweenNested(const std::string& functionName,
736 const LogicalType& sourceType, const LogicalType& targetType) {
737 // todo: compile time checking of nested types
738 if (CastArrayHelper::checkCompatibleNestedTypes(sourceType.getLogicalTypeID(),
739 targetType.getLogicalTypeID())) {
740 return std::make_unique<ScalarFunction>(functionName,
741 std::vector<LogicalTypeID>{sourceType.getLogicalTypeID()},
742 targetType.getLogicalTypeID(), nestedTypesCastExecFunction);
743 }
744 throw ConversionException{std::format("Unsupported casting function from {} to {}.",
745 LogicalTypeUtils::toString(sourceType.getLogicalTypeID()),
746 LogicalTypeUtils::toString(targetType.getLogicalTypeID()))};
747}
748
749template<typename EXECUTOR = UnaryFunctionExecutor, typename DST_TYPE>
750static std::unique_ptr<ScalarFunction> bindCastToDateFunction(const std::string& functionName,

Callers 1

bindCastFunctionMethod · 0.85

Calls 2

getLogicalTypeIDMethod · 0.80
toStringFunction · 0.50

Tested by

no test coverage detected