{"record":{"id":"ca6c7c69c47a2ebe","repo":"apache/hadoop","slug":"invalid-pattern-regex","errorCode":null,"errorMessage":"Invalid pattern: {regex}","messagePattern":"Invalid pattern: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input/SequenceFileInputFilter.java","lineNumber":122,"sourceCode":"    public Configuration getConf() {\n      return conf;\n    }\n  }\n    \n  /** Records filter by matching key to regex\n   */\n  public static class RegexFilter extends FilterBase {\n    private Pattern p;\n    /** Define the filtering regex and stores it in conf\n     * @param conf where the regex is set\n     * @param regex regex used as a filter\n     */\n    public static void setPattern(Configuration conf, String regex)\n        throws PatternSyntaxException {\n      try {\n        Pattern.compile(regex);\n      } catch (PatternSyntaxException e) {\n        throw new IllegalArgumentException(\"Invalid pattern: \"+regex);\n      }\n      conf.set(FILTER_REGEX, regex);\n    }\n        \n    public RegexFilter() { }\n        \n    /** configure the Filter by checking the configuration\n     */\n    public void setConf(Configuration conf) {\n      String regex = conf.get(FILTER_REGEX);\n      if (regex == null)\n        throw new RuntimeException(FILTER_REGEX + \"not set\");\n      this.p = Pattern.compile(regex);\n      this.conf = conf;\n    }\n\n\n    /** Filtering method","sourceCodeStart":104,"sourceCodeEnd":140,"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/input/SequenceFileInputFilter.java#L104-L140","documentation":"Error \"Invalid pattern: {regex}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input/SequenceFileInputFilter.java:122 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set mapreduce.input.sequencefileinputfilter.regex to a valid Java regular expression."],"exampleFix":null,"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"}