| 733 | } |
| 734 | |
| 735 | static 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 | |
| 749 | template<typename EXECUTOR = UnaryFunctionExecutor, typename DST_TYPE> |
| 750 | static std::unique_ptr<ScalarFunction> bindCastToDateFunction(const std::string& functionName, |
no test coverage detected