{"record":{"id":"5d77bf5b69437fcb","repo":"apache/druid","slug":"unable-to-parse-row-s-5d77bf","errorCode":null,"errorMessage":"Unable to parse row [%s]","messagePattern":"Unable to parse row \\[(.+?)\\]","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/data/input/impl/RegexReader.java","lineNumber":104,"sourceCode":"      final RegexMatcher matcher = compiledPattern.matcher(line);\n\n      if (!matcher.matches()) {\n        throw new ParseException(line, \"Incorrect Regex: %s . No match found.\", pattern);\n      }\n\n      final List<String> values = new ArrayList<>();\n      for (int i = 1; i <= matcher.groupCount(); i++) {\n        values.add(matcher.group(i));\n      }\n\n      if (columns == null) {\n        columns = ParserUtils.generateFieldNames(matcher.groupCount());\n      }\n\n      return Utils.zipMapPartial(columns, Iterables.transform(values, transformationFunction));\n    }\n    catch (Exception e) {\n      throw new ParseException(line, e, \"Unable to parse row [%s]\", line);\n    }\n  }\n\n  @Override\n  public int getNumHeaderLinesToSkip()\n  {\n    return 0;\n  }\n\n  @Override\n  public boolean needsToProcessHeaderLine()\n  {\n    return false;\n  }\n\n  @Override\n  public void processHeaderLine(String line)\n  {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/data/input/impl/RegexReader.java#L86-L122","documentation":"RegexReader.parseLine wraps any unexpected exception during column/value processing of a matched line into this ParseException, carrying the raw line. It fires after the regex matched but something went wrong mapping captured groups to columns (e.g. transformation function failure).","triggerScenarios":"A transformationFunction applied to captured groups throws, or column list construction (generateFieldNames or header-derived columns) fails while zipping values with columns via Utils.zipMapPartial.","commonSituations":"Custom transformations that assume non-null or numeric values, header line mismatch causing wrong column counts, exceptions inside lambda transformations on malformed group content.","solutions":["Review the cause exception inside the ParseException for the failing step","Make the transformation function null-safe or wrap it defensively","Verify column list length and header configuration match groupCount","Fix the offending line content identified by the row text in the message"],"exampleFix":"// before\ntransformationFunction = v -> Long.parseLong(v)  // NPE on null group\n// after\ntransformationFunction = v -> v == null ? 0L : Long.parseLong(v)","handlingStrategy":"try-catch","validationCode":"try { transformationFunction.apply(sampleValue); } catch (Exception e) { /* transformation unsafe */ }","typeGuard":"boolean transformSafe(String v) { try { fn.apply(v); return true; } catch (Exception e) { return false; } }","tryCatchPattern":"try { reader.read(); } catch (ParseException e) { log.warn(\"Row processing failed: {} cause: {}\", e.getMessage(), e.getCause()); }","preventionTips":["Make transformation functions null-safe","Verify header-derived column counts match regex groupCount","Log the cause exception inside ParseException for the real error"],"tags":["regex","parse","ingestion"],"backgroundTag":"json-parse-error","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}