{"record":{"id":"51073c52c7481ae2","repo":"apache/hadoop","slug":"invalid-define-for-definename","errorCode":null,"errorMessage":"Invalid define for {defineName}","messagePattern":"Invalid define for (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/join/CompositeInputFormat.java","lineNumber":114,"sourceCode":"      Parser.WNode.addIdentifier(\"tbl\", WrappedRecordReader.class);\n    } catch (NoSuchMethodException e) {\n      throw new RuntimeException(\"FATAL: Failed to init defaults\", e);\n    }\n  }\n\n  /**\n   * Inform the parser of user-defined types.\n   */\n  private void addUserIdentifiers(Configuration conf) throws IOException {\n    Pattern x = Pattern.compile(\"^mapreduce\\\\.join\\\\.define\\\\.(\\\\w+)$\");\n    for (Map.Entry<String,String> kv : conf) {\n      Matcher m = x.matcher(kv.getKey());\n      if (m.matches()) {\n        try {\n          Parser.CNode.addIdentifier(m.group(1),\n              conf.getClass(m.group(0), null, ComposableRecordReader.class));\n        } catch (NoSuchMethodException e) {\n          throw new IOException(\"Invalid define for \" + m.group(1), e);\n        }\n      }\n    }\n  }\n\n  /**\n   * Build a CompositeInputSplit from the child InputFormats by assigning the\n   * ith split from each child to the ith composite split.\n   */\n  @SuppressWarnings(\"unchecked\")\n  public List<InputSplit> getSplits(JobContext job) \n      throws IOException, InterruptedException {\n    setFormat(job.getConfiguration());\n    job.getConfiguration().setLong(\"mapreduce.input.fileinputformat.split.minsize\", Long.MAX_VALUE);\n    return root.getSplits(job);\n  }\n\n  /**","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/join/CompositeInputFormat.java#L96-L132","documentation":"Error \"Invalid define for {defineName}\" thrown in apache/hadoop.","triggerScenarios":"Thrown by CompositeInputFormat.setFormat()/addDefaults() when a join expression identifier is defined twice with conflicting types (e.g. the same name used once as a stream and once as a record reader class). Give each stream in the join expression a unique identifier.","commonSituations":"Typo in a stream name in the join expression; referencing a table alias that was never defined in the expression.","solutions":["Verify that every identifier used in the join expression was declared before use in the composite input format string.","Fix the mapred.join.expr / join expression passed to CompositeInputFormat so each {defineName} token refers to a previously defined stream or map."],"exampleFix":"CompositeInputFormat.setFormat(job, \"outer(KeyValueTextInputFormat.class,\\\"in/a\\\",inner(SequenceFileInputFormat.class,\\\"in/b\\\"))\");","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}