| 31 | }; |
| 32 | |
| 33 | static std::unique_ptr<FunctionBindData> bindFunc(const ScalarBindFuncInput& input) { |
| 34 | |
| 35 | std::vector<LogicalType> types; |
| 36 | types.push_back(input.arguments[0]->getDataType().copy()); |
| 37 | types.push_back(input.arguments[1]->getDataType().copy()); |
| 38 | |
| 39 | using resolver = ListTypeResolver<ListOp::Prepend>; |
| 40 | ListFunctionUtils::resolveTypes(input, types, resolver::anyEmpty, resolver::anyEmpty, |
| 41 | resolver::anyEmpty, resolver::finalResolver, resolver::bothNull, resolver::leftNull, |
| 42 | resolver::rightNull, resolver::finalResolver); |
| 43 | |
| 44 | if (types[0].getLogicalTypeID() != LogicalTypeID::ANY && |
| 45 | types[1] != ListType::getChildType(types[0])) { |
| 46 | throw BinderException(ExceptionMessage::listFunctionIncompatibleChildrenType( |
| 47 | ListAppendFunction::name, types[0].toString(), types[1].toString())); |
| 48 | } |
| 49 | |
| 50 | auto scalarFunction = input.definition->ptrCast<ScalarFunction>(); |
| 51 | TypeUtils::visit(types[1].getPhysicalType(), [&scalarFunction]<typename T>(T) { |
| 52 | scalarFunction->execFunc = ScalarFunction::BinaryExecListStructFunction<list_entry_t, T, |
| 53 | list_entry_t, ListPrepend>; |
| 54 | }); |
| 55 | |
| 56 | return std::make_unique<FunctionBindData>(std::move(types), types[0].copy()); |
| 57 | } |
| 58 | |
| 59 | function_set ListPrependFunction::getFunctionSet() { |
| 60 | function_set result; |
nothing calls this directly
no test coverage detected