{"record":{"id":"bddc0c45c8e74509","repo":"apache/beam","slug":"config","errorCode":null,"errorMessage":"${config}","messagePattern":"\\$\\{config\\}","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/transforms/providers/JavaRowUdf.java","lineNumber":193,"sourceCode":"          Function.class,\n          new TypeDescriptors.TypeVariableExtractor<Function<InputT, OutputT>, OutputT>() {});\n    }\n  }\n\n  @SuppressWarnings({\n    \"nullness\" // TODO(https://github.com/apache/beam/issues/20497)\n  })\n  private static FunctionAndType createFunction(Configuration config, Schema inputSchema)\n      throws ReflectiveOperationException, StringCompiler.CompileException, MalformedURLException {\n    config.validate();\n    if (!Strings.isNullOrEmpty(config.getExpression())) {\n      return createFunctionFromExpression(config.getExpression(), inputSchema);\n    } else if (!Strings.isNullOrEmpty(config.getCallable())) {\n      return createFuctionFromCallable(config.getCallable());\n    } else if (!Strings.isNullOrEmpty(config.getName())) {\n      return createFunctionFromName(config.getName(), config.getPath());\n    } else {\n      throw new UnsupportedOperationException(config.toString());\n    }\n  }\n\n  private static FunctionAndType createFunctionFromExpression(String expression, Schema inputSchema)\n      throws StringCompiler.CompileException, ReflectiveOperationException {\n    if (inputSchema.hasField(expression)) {\n      final int ix = inputSchema.indexOf(expression);\n      return new FunctionAndType(\n          inputSchema.getField(expression).getType(), (Row row) -> row.getValue(ix));\n    } else {\n      Map<String, Type> fieldTypes = new HashMap<>();\n      for (Schema.Field field : inputSchema.getFields()) {\n        if (expression.indexOf(field.getName()) != -1) {\n          fieldTypes.put(field.getName(), typeFromFieldType(field.getType()));\n        }\n      }\n      Type type = StringCompiler.guessExpressionType(expression, fieldTypes);\n      StringBuilder source = new StringBuilder();","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/transforms/providers/JavaRowUdf.java#L175-L211","documentation":"JavaRowUdf selects how to build the UDF function: from an inline expression, a callable class, or a named function on a path. If none of expression, callable, or name is set in the config, createFunction has no creation strategy and throws UnsupportedOperationException with the config's toString as the message.","triggerScenarios":"createFunction called (via functionAndType) with a JavaRowUdf config where getExpression(), getCallable(), and getName() are all null or empty strings.","commonSituations":"Incomplete YAML/JSON config for the UDF transform; typo'd config keys so values land in the wrong fields; config built programmatically without setting any of the three options.","solutions":["Set one of 'expression', 'callable', or 'name' in the UDF configuration","Fix typos in config keys so the intended option is populated","Validate the config object before passing it to the transform"],"exampleFix":"// before\nudf:\n  language: sql\n# after\nudf:\n  language: sql\n  expression: \"count * 2\"","handlingStrategy":"validation","validationCode":"if (Strings.isNullOrEmpty(config.getExpression())\n    && Strings.isNullOrEmpty(config.getCallable())\n    && Strings.isNullOrEmpty(config.getName()))\n  throw new IllegalArgumentException(\"UDF config requires expression, callable, or name\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate UDF YAML/JSON config keys at pipeline-construction time","Use a schema-validated config loader to catch missing fields"],"tags":["java","apache-beam","udf","configuration"],"backgroundTag":"missing-required-config-field","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}