MCPcopy Create free account
hub / github.com/apache/madlib / lapply_error_checking

Function lapply_error_checking

methods/svec/src/pg_gp/SparseData.c:1772–1789  ·  view source on GitHub ↗

This function checks for error conditions in lapply() function calls. */

Source from the content-addressed store, hash-verified

1770/* This function checks for error conditions in lapply() function calls.
1771 */
1772static bool lapply_error_checking(Oid foid, List * func) {
1773 /* foid != InvalidOid; otherwise LookupFuncName would raise error.
1774 Here we check that the return type of foid is float8. */
1775 HeapTuple ftup = SearchSysCache(PROCOID,
1776 ObjectIdGetDatum(foid), 0, 0, 0);
1777 Form_pg_proc pform = (Form_pg_proc) GETSTRUCT(ftup);
1778
1779 if (pform->prorettype != FLOAT8OID)
1780 ereport(ERROR,
1781 (errcode(ERRCODE_DATATYPE_MISMATCH),
1782 errmsg("return type of %s is not double",
1783 NameListToString(func))));
1784
1785 // check volatility
1786
1787 ReleaseSysCache(ftup);
1788 return true;
1789}
1790

Callers 1

lapplyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected