MCPcopy Create free account
hub / github.com/duckdb/duckdb / MultipleCandidateException

Method MultipleCandidateException

src/function/function_binder.cpp:130–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128
129template <class T>
130optional_idx FunctionBinder::MultipleCandidateException(const string &catalog_name, const string &schema_name,
131 const string &name, FunctionSet<T> &functions,
132 vector<idx_t> &candidate_functions,
133 const vector<LogicalType> &arguments, ErrorData &error) {
134 D_ASSERT(functions.functions.size() > 1);
135 // there are multiple possible function definitions
136 // throw an exception explaining which overloads are there
137 string call_str = Function::CallToString(catalog_name, schema_name, name, arguments);
138 string candidate_str;
139 for (auto &conf : candidate_functions) {
140 T f = functions.GetFunctionByOffset(conf);
141 candidate_str += "\t" + f.ToString() + "\n";
142 }
143 error = ErrorData(
144 ExceptionType::BINDER,
145 StringUtil::Format("Could not choose a best candidate function for the function call \"%s\". In order to "
146 "select one, please add explicit type casts.\n\tCandidate functions:\n%s",
147 call_str, candidate_str));
148 return optional_idx();
149}
150
151template <class T>
152optional_idx FunctionBinder::BindFunctionFromArguments(const string &name, FunctionSet<T> &functions,

Callers

nothing calls this directly

Calls 5

GetFunctionByOffsetMethod · 0.80
ErrorDataClass · 0.50
optional_idxClass · 0.50
sizeMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected