{"record":{"id":"ee2633dd60360bc7","repo":"apache/druid","slug":"size-of-rawcolumnslist-s-does-not-correspond-t","errorCode":null,"errorMessage":"Size of rawColumnsList([%s]) does not correspond to size of inputRows([%s])","messagePattern":"Size of rawColumnsList\\(\\[(.+?)\\]\\) does not correspond to size of inputRows\\(\\[(.+?)\\]\\)","errorType":"exception","errorClass":"org.apache.druid.java.util.common.parsers.ParseException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/data/input/InputRowListPlusRawValues.java","lineNumber":98,"sourceCode":"   * Make sure the size of given rawColumnsList and inputRows are the same if both of them are not null\n   */\n  public static InputRowListPlusRawValues ofList(@Nullable List<Map<String, Object>> rawColumnsList,\n                                                 @Nullable List<InputRow> inputRows)\n  {\n    return ofList(rawColumnsList, inputRows, null);\n  }\n\n  /**\n   * Create an instance of {@link InputRowListPlusRawValues}\n   *\n   * Make sure the size of given rawColumnsList and inputRows are the same if both of them are not null\n   */\n  public static InputRowListPlusRawValues ofList(@Nullable List<Map<String, Object>> rawColumnsList,\n                                                 @Nullable List<InputRow> inputRows,\n                                                 @Nullable ParseException parseException)\n  {\n    if (rawColumnsList != null && inputRows != null && rawColumnsList.size() != inputRows.size()) {\n      throw new ParseException(null, \"Size of rawColumnsList([%s]) does not correspond to size of inputRows([%s])\", rawColumnsList, inputRows);\n    }\n\n    return new InputRowListPlusRawValues(\n        inputRows,\n        rawColumnsList,\n        parseException\n    );\n  }\n\n  private InputRowListPlusRawValues(\n      @Nullable List<InputRow> inputRows,\n      @Nullable List<Map<String, Object>> rawValues,\n      @Nullable ParseException parseException\n  )\n  {\n    this.inputRows = inputRows;\n    this.rawValues = rawValues;\n    this.parseException = parseException;","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/data/input/InputRowListPlusRawValues.java#L80-L116","documentation":"InputRowListPlusRawValues.ofList pairs raw parsed column values with the InputRows produced for them. When both lists are non-null but their sizes differ, Druid throws a ParseException because the two lists are meant to be index-aligned; the pairing invariant would be broken. This is an internal consistency check in the parser/parsing-failure reporting path.","triggerScenarios":"Calling InputRowListPlusRawValues.ofList(rawColumnsList, inputRows, parseException) with rawColumnsList != null && inputRows != null && rawColumnsList.size() != inputRows.size(), e.g. a custom parser that collects raw maps but drops or adds rows during InputRow creation.","commonSituations":"Custom or plugin InputParser implementations that filter out invalid rows from inputRows but still return raw maps for them (or vice versa); version drift between intermediate parsing stages during ingestion fault diagnostics.","solutions":["Fix the parser so exactly one InputRow is produced per raw-column map (or drop the corresponding raw map when a row is skipped).","Pass null for rawColumnsList if raw values are unavailable and cannot be kept aligned with rows.","Pass null for inputRows if only raw values plus an exception are being reported.","Add an assertion/log in the parser when a row is discarded to catch misalignment early."],"exampleFix":"// before\nList<InputRow> rows = rawList.stream().map(this::tryParse).filter(Objects::nonNull).collect(Collectors.toList());\nreturn InputRowListPlusRawValues.ofList(rawList, rows, null);\n// after\nList<InputRow> rows = new ArrayList<>();\nfor (Map<String, Object> raw : rawList) { rows.add(tryParseOrPlaceholder(raw)); }\nreturn InputRowListPlusRawValues.ofList(rawList, rows, null);","handlingStrategy":"type-guard","validationCode":"assert rawColumnsList == null || inputRows == null || rawColumnsList.size() == inputRows.size();","typeGuard":"boolean safe = (rawColumnsList == null || inputRows == null || rawColumnsList.size() == inputRows.size());\nif (!safe) {\n  log.warn(\"rawColumnsList size %d != inputRows size %d; omitting raw values\", rawColumnsList.size(), inputRows.size());\n  rawColumnsList = null;\n}","tryCatchPattern":null,"preventionTips":["Keep raw-map collection and row creation in the same loop so sizes stay aligned","Add unit tests for parsers that drop invalid rows","Pass null instead of a misaligned list"],"tags":["ingestion","parser","invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}