{"record":{"id":"5c572deb74c52daa","repo":"apache/beam","slug":"no-implementation-of-scalar-function-functionfullname-found","errorCode":null,"errorMessage":"No implementation of scalar function ${functionFullName} found in ${jarPath}. 1. Create a class implementing UdfProvider and annotate it with @AutoService(UdfProvider.class). 2. Add function ${functionFullName} to the class's userDefinedScalarFunctions implementation.","messagePattern":"No implementation of scalar function (.+?) found in (.+?)\\. 1\\. Create a class implementing UdfProvider and annotate it with @AutoService\\(UdfProvider\\.class\\)\\. 2\\. Add function (.+?) to the class's userDefinedScalarFunctions implementation\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/JavaUdfLoader.java","lineNumber":75,"sourceCode":"public class JavaUdfLoader {\n  private static final Logger LOG = LoggerFactory.getLogger(JavaUdfLoader.class);\n\n  /**\n   * Maps the external jar location to the functions the jar defines. Static so it can persist\n   * across multiple SQL transforms.\n   */\n  private static final Map<String, FunctionDefinitions> functionCache = new HashMap<>();\n\n  /** Maps potentially remote jar paths to their local file copies. */\n  private static final Map<String, File> jarCache = new HashMap<>();\n\n  /** Load a user-defined scalar function from the specified jar. */\n  public ScalarFn loadScalarFunction(List<String> functionPath, String jarPath) {\n    String functionFullName = String.join(\".\", functionPath);\n    try {\n      FunctionDefinitions functionDefinitions = loadJar(jarPath);\n      if (!functionDefinitions.scalarFunctions().containsKey(functionPath)) {\n        throw new IllegalArgumentException(\n            String.format(\n                \"No implementation of scalar function %s found in %s.%n\"\n                    + \" 1. Create a class implementing %s and annotate it with @AutoService(%s.class).%n\"\n                    + \" 2. Add function %s to the class's userDefinedScalarFunctions implementation.\",\n                functionFullName,\n                jarPath,\n                UdfProvider.class.getSimpleName(),\n                UdfProvider.class.getSimpleName(),\n                functionFullName));\n      }\n      return functionDefinitions.scalarFunctions().get(functionPath);\n    } catch (IOException e) {\n      throw new RuntimeException(\n          String.format(\n              \"Failed to load user-defined scalar function %s from %s\", functionFullName, jarPath),\n          e);\n    }\n  }","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/JavaUdfLoader.java#L57-L93","documentation":"JavaUdfLoader.loadScalarFunction() throws IllegalArgumentException when the UdfProvider registered in the given jar does not export a scalar function with the requested fully-qualified path. The jar loaded successfully but FunctionDefinitions.scalarFunctions() has no entry for functionPath. The message includes remediation steps about implementing and registering UdfProvider.","triggerScenarios":"Calling loadScalarFunction(List<String> functionPath, String jarPath) (via the SQL shell/catalog loader) where jarPath's UdfProvider exists but userDefinedScalarFunctions() lacks the requested function name.","commonSituations":"Typo in the function name or package path; the UDF exists in a class but is not returned from userDefinedScalarFunctions(); missing @AutoService(UdfProvider.class) annotation so no provider is registered; stale jar without the new function.","solutions":["Verify the function name/path exactly matches a key in userDefinedScalarFunctions().","Annotate the implementing class with @AutoService(UdfProvider.class) (or add the META-INF/services entry) and rebuild the jar.","Rebuild and redeploy the jar after adding the function; confirm the new jar path is used.","List the jar's registered functions to see the available names."],"exampleFix":"// before\npublic class MyUdfs { public static Integer twice(Integer x) {...} }\n// after\n@AutoService(UdfProvider.class)\npublic class MyUdfs implements UdfProvider {\n  @Override\n  public Map<String, ScalarFn> userDefinedScalarFunctions() {\n    return ImmutableMap.of(\"twice\", ScalarFn.create(...));\n  }\n}","handlingStrategy":"try-catch","validationCode":"// confirm jar exists before loading UDF\nif (!new File(jarPath).isFile()) {\n  throw new IllegalArgumentException(\"UDF jar not found: \" + jarPath);\n}","typeGuard":null,"tryCatchPattern":"try {\n  ScalarFn fn = udfLoader.loadScalarFunction(fnPath, jarPath);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"No implementation of scalar function\")) {\n    LOG.error(\"UDF {} not registered in {}; check UdfProvider registration\", fnPath, jarPath);\n  }\n  throw e;\n}","preventionTips":["Annotate UdfProvider classes with @AutoService(UdfProvider.class)","Keep function registry keys and SQL call sites generated from one constant","Rebuild and redeploy jars after adding functions","Smoke-test jar loading in a unit test (testLoadScalarFunction pattern)"],"tags":["udf","classpath","beam"],"backgroundTag":"resource-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-15T02:17:10.978Z"}