{"record":{"id":"dca9308f7cd252f2","repo":"apache/hadoop","slug":"parse-error","errorCode":null,"errorMessage":"Parse error","messagePattern":"Parse error","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/mapred/join/Parser.java","lineNumber":300,"sourceCode":"      Iterator<Token> i = ll.iterator();\n      while (i.hasNext()) {\n        Token t = i.next();\n        if (TType.COMMA.equals(t.getType())) {\n          try {\n          \tinf = (InputFormat)ReflectionUtils.newInstance(\n          \t\t\tjob.getClassByName(sb.toString()),\n                job);\n          } catch (ClassNotFoundException e) {\n            throw (IOException)new IOException().initCause(e);\n          } catch (IllegalArgumentException e) {\n            throw (IOException)new IOException().initCause(e);\n          }\n          break;\n        }\n        sb.append(t.getStr());\n      }\n      if (!i.hasNext()) {\n        throw new IOException(\"Parse error\");\n      }\n      Token t = i.next();\n      if (!TType.QUOT.equals(t.getType())) {\n        throw new IOException(\"Expected quoted string\");\n      }\n      indir = t.getStr();\n      // no check for ll.isEmpty() to permit extension\n    }\n\n    private JobConf getConf(JobConf job) {\n      JobConf conf = new JobConf(job);\n      FileInputFormat.setInputPaths(conf, indir);\n      conf.setClassLoader(job.getClassLoader());\n      return conf;\n    }\n\n    public InputSplit[] getSplits(JobConf job, int numSplits)\n        throws IOException {","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/join/Parser.java#L282-L318","documentation":"WNode.parse reads tokens up to the first comma as the InputFormat class name, then requires at least one more token (the path). If the iterator is exhausted right after the comma, i.e. the tbl(...) argument list ends without a path, it throws IOException(\"Parse error\"). An argument list with no comma at all also drains the iterator and lands here.","triggerScenarios":"tbl(org.apache.hadoop.Foo,) — comma with nothing after it; tbl() with neither class nor path; expressions truncated so the final tbl loses its path argument.","commonSituations":"String-concatenated expressions that drop the path argument; truncation of long expressions in config XML or shell variables; deleting a path while refactoring.","solutions":["Always give tbl exactly two arguments: fully-qualified InputFormat class, comma, double-quoted path","Generate the expression with CompositeInputFormat.compose(), which always emits both arguments","Dry-run setFormat(job) client-side to catch the malformed clause early"],"exampleFix":"// before: trailing comma, no path\njob.set(\"mapred.join.expr\", \"inner(tbl(F,),tbl(F,/b))\");\n\n// after\njob.set(\"mapred.join.expr\",\n    CompositeInputFormat.compose(\"inner\", SequenceFileInputFormat.class, \"/a\", \"/b\"));","handlingStrategy":"validation","validationCode":"String expr = CompositeInputFormat.compose(\"inner\",\n    SequenceFileInputFormat.class, \"/a\", \"/b\"); // always emits class + quoted path\nif (expr.contains(\",)\") || expr.contains(\"(,\")) {\n  throw new IllegalArgumentException(\"empty tbl formal in join expression\");\n}\njob.set(\"mapred.join.expr\", expr);","typeGuard":null,"tryCatchPattern":"try {\n  new CompositeInputFormat<Object>().setFormat(job);\n} catch (IOException e) {\n  throw new IllegalArgumentException(\"malformed tbl(...) clause in mapred.join.expr\", e);\n}","preventionTips":["Give tbl exactly two arguments: FQCN, comma, double-quoted path","Generate expressions with compose() so no clause can be truncated","Watch for truncation when expressions cross XML config or shell variable boundaries"],"tags":["hadoop","mapreduce","join","parser","expression"],"backgroundTag":"expression-parse-error","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}