{"record":{"id":"7f41baa964b3362d","repo":"apache/hadoop","slug":"expected-quoted-string-7f41ba","errorCode":null,"errorMessage":"Expected quoted string","messagePattern":"Expected quoted string","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":319,"sourceCode":"        if (TType.COMMA.equals(t.getType())) {\n          try {\n          \tinf = (InputFormat<?, ?>)ReflectionUtils.newInstance(\n          \t\t\tconf.getClassByName(sb.toString()), conf);\n          } catch (ClassNotFoundException e) {\n            throw new IOException(e);\n          } catch (IllegalArgumentException e) {\n            throw new IOException(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 Configuration getConf(Configuration jconf) throws IOException {\n      Job job = Job.getInstance(jconf);\n      FileInputFormat.setInputPaths(job, indir);\n      return job.getConfiguration();\n    }\n    \n    public List<InputSplit> getSplits(JobContext context)\n        throws IOException, InterruptedException {\n      return inf.getSplits(\n                 new JobContextImpl(getConf(context.getConfiguration()), \n                                    context.getJobID()));\n    }\n","sourceCodeStart":301,"sourceCodeEnd":337,"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#L301-L337","documentation":"Thrown by the MapReduce join expression parser (Parser.WNode.parse). After the comma that ends the InputFormat class name, the parser demands a double-quoted path token (TType.QUOT). This error means the next token exists but is not a double-quoted string — typically an unquoted path or a class name given where the path belongs.","triggerScenarios":"The token following the COMMA in a tbl(...) node fails TType.QUOT.equals(t.getType()) at Parser.java:318. Examples: tbl(TextInputFormat, /data/a) — path not in double quotes; single quotes 'path' (the Lexer only designates '\"' via tok.quoteChar('\"')); tbl(fmt, tbl(...)) — nested node where a string was expected.","commonSituations":"Hand-writing mapreduce.join.expr and forgetting Java-style double quotes; using single quotes because the expression is embedded in another string; paths containing characters that break StreamTokenizer quoting; template code that interpolates a Path object without adding quotes.","solutions":["Wrap every tbl() path argument in literal double quotes: tbl(<InputFormat class>, \"<path>\")","Escape embedded quotes correctly when the expression sits inside a Java string (\\\") or XML config (&quot; or &amp;#34; as needed)","Use CompositeInputFormat.compose(...) which generates correctly quoted tbl(...) fragments","Unit-test the expression with Parser.parse(expr, conf) before job submission"],"exampleFix":"// before\nString expr = \"inner(tbl(TextInputFormat, /data/a), tbl(TextInputFormat, /data/b))\";\n\n// after\nString expr = \"inner(tbl(org.apache.hadoop.mapreduce.lib.input.TextInputFormat, \\\"/data/a\\\"),\"\n            + \"tbl(org.apache.hadoop.mapreduce.lib.input.TextInputFormat, \\\"/data/b\\\"))\";","handlingStrategy":"validation","validationCode":"static void requireQuotedPaths(String expr) {\n  // any tbl( whose second argument is not a double-quoted string\n  java.util.regex.Matcher m = java.util.regex.Pattern.compile(\n    \"tbl\\\\([^,]+,\\\\s*([^\\\\\\\"])[^,]*\\\\)\").matcher(expr);\n  if (m.find()) throw new IllegalArgumentException(\n    \"tbl() path argument must be double-quoted: near '\" + m.group(1) + \"'\");\n}","typeGuard":null,"tryCatchPattern":"try { Parser.parse(expr, conf); } catch (IOException e) { throw new IllegalArgumentException(\"Bad join expression (check quoting): \" + expr, e); }","preventionTips":["Always double-quote tbl() paths; single quotes are not recognized by the lexer","Escape \\\" correctly when the expression is embedded in Java/XML","Use compose() helpers which emit valid quoted fragments"],"tags":["hadoop","mapreduce","join","parser","quoting"],"backgroundTag":"expression-parse-error","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}