Skip to content

[CSV-330] Keep full header width for consistency checks - #638

Open
AryanRG wants to merge 1 commit into
apache:masterfrom
AryanRG:CSV-330-consistent-record-width
Open

AryanRG wants to merge 1 commit into
apache:masterfrom
AryanRG:CSV-330-consistent-record-width

Conversation

@AryanRG

@AryanRG AryanRG commented Oct 17, 2026

Copy link
Copy Markdown

Summary

CSVRecord.isConsistent() used the header-name map size as the header width. Duplicate or empty header names can collapse in that map, making a record with all columns appear inconsistent. Keep the parsed header column count separately and use it for consistency checks.

Adds regression coverage for duplicate and empty names, plus a CSV-330 changes entry.

Jira: https://issues.apache.org/jira/browse/CSV-330

Validation

  • mvn — success on the final patch (JDK 27 on macOS).
  • Focused CSVRecordTest — 35 passing cases.

AI assistance used (Kiro) for code and test drafting and independent patch review.

Keep the number of parsed header columns separate from the name-to-index map. Duplicate and empty names can collapse in that map, but records with all header positions must still be considered consistent. Cover both cases and add the Jira-linked changes entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant