{"record":{"id":"a316fa2b872e5d5d","repo":"apache/hadoop","slug":"expected-a316fa","errorCode":null,"errorMessage":"Expected ','","messagePattern":"Expected ','","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/Parser.java","lineNumber":502,"sourceCode":"      }\n      for (int i = 0; i < capacity; ++i) {\n        ret.add(kids.get(i).createRecordReader(spl.get(i), taskContext));\n      }\n      return (ComposableRecordReader)ret;\n    }\n\n    /**\n     * Parse a list of comma-separated nodes.\n     */\n    public void parse(List<Token> args, Configuration conf) \n        throws IOException {\n      ListIterator<Token> i = args.listIterator();\n      while (i.hasNext()) {\n        Token t = i.next();\n        t.getNode().setID(i.previousIndex() >> 1);\n        kids.add(t.getNode());\n        if (i.hasNext() && !TType.COMMA.equals(i.next().getType())) {\n          throw new IOException(\"Expected ','\");\n        }\n      }\n    }\n\n    public String toString() {\n      StringBuilder sb = new StringBuilder();\n      sb.append(ident + \"(\");\n      for (Node n : kids) {\n        sb.append(n.toString() + \",\");\n      }\n      sb.setCharAt(sb.length() - 1, ')');\n      return sb.toString();\n    }\n  }\n\n  private static Token reduce(Stack<Token> st, Configuration conf) \n      throws IOException {\n    LinkedList<Token> args = new LinkedList<Token>();","sourceCodeStart":484,"sourceCodeEnd":520,"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/Parser.java#L484-L520","documentation":"Parser.CNode.parse (Parser.java:502) parses the comma-separated child list of a composite join operator like inner(...). After reading each child node it expects the next token to be a COMMA. Anything else (another node, a path, an unbalanced token) throws 'Expected \\',\\''.","triggerScenarios":"Children of inner/outer/override not separated by commas: 'inner(tbl(fmt,\"/a\") tbl(fmt,\"/b\"))'; a trailing token after the last child: 'inner(a,b,)'; stray identifiers inside the operator call. The loop at Parser.java:496-504 consumes node, then i.next() must be COMMA whenever i.hasNext().","commonSituations":"Hand-writing mapreduce.join.expr and using spaces instead of commas; editing an expression and dropping a comma; building the string with a join/loop that omits separators on some boundary; whitespace/formatting changes that introduce extra tokens.","solutions":["Separate every child node inside inner(...)/outer(...)/override(...) with a single comma: inner(tbl(...),tbl(...))","Remove trailing commas and stray tokens after the final child","Generate the expression with CompositeInputFormat.compose(op, infClass, paths...) which emits correct separators","Dry-run Parser.parse(expr, conf) in a unit test to catch syntax errors before submission"],"exampleFix":"// before\nconf.set(\"mapreduce.join.expr\",\n  \"outer(tbl(fmt, \\\"/a\\\") tbl(fmt, \\\"/b\\\"))\");\n\n// after\nconf.set(\"mapreduce.join.expr\",\n  \"outer(tbl(fmt, \\\"/a\\\"), tbl(fmt, \\\"/b\\\"))\");","handlingStrategy":"validation","validationCode":"static String buildJoinExpr(String op, List<String> children) {\n  for (String c : children) if (c == null || c.trim().isEmpty()) throw new IllegalArgumentException(\"null/empty join child\");\n  return op + \"(\" + String.join(\",\", children) + \")\"; // always emits commas\n}","typeGuard":null,"tryCatchPattern":"try { Parser.parse(expr, conf); } catch (IOException e) { throw new IllegalArgumentException(\"Join expression syntax error (check commas between children): \" + expr, e); }","preventionTips":["Separate every child inside operator calls with exactly one comma","No trailing comma after the last child","Generate with CompositeInputFormat.compose() and lint hand-written strings"],"tags":["hadoop","mapreduce","join","parser","syntax"],"backgroundTag":"expression-parse-error","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}