Skip to content

[enhancement] Support disabling CSV quote parsing by NONE_QUOTE #846feat:#847

Open
huangzengtian wants to merge 1 commit intoapache:mainfrom
huangzengtian:feature/#846-support-none-quote
Open

[enhancement] Support disabling CSV quote parsing by NONE_QUOTE #846feat:#847
huangzengtian wants to merge 1 commit intoapache:mainfrom
huangzengtian:feature/#846-support-none-quote

Conversation

@huangzengtian
Copy link

  • Add NONE_QUOTE constant in CsvConstant.
  • Add Javadoc to CsvReaderBuilder#quote(Character quote) for NONE_QUOTE usage

Purpose of the pull request

Closed: #846

What's changed?

Rationale
Currently, the quote configuration in CsvReaderBuilder does not support an explicit "disabled" state. Setting it to null is ambiguous (could mean "use default" or "disable"). This PR introduces a special constant to explicitly disable quote parsing, which is essential for processing raw TSV/CSV data (like Amazon reports) where quotes are part of the literal content and should not be escaped or wrapped.

Design Decisions
Introduced CsvConstant.NONE_QUOTE ('\0'): Followed the industrial practice of Apache Commons CSV (where withQuote(null) disables quoting).

Enhanced Javadoc: Added clear instructions in CsvReaderBuilder#quote to guide users on how to use NONE_QUOTE.

Checklist

  • [✓] I have read the Contributor Guide.
  • [✓] I have written the necessary doc or comment.
  • [✓] I have added the necessary unit tests and all cases have passed.

- Add NONE_QUOTE constant in CsvConstant.
- Add Javadoc to CsvReaderBuilder#quote(Character quote) for NONE_QUOTE usage
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.

[Bug] 读取CSV带引号的值报错

1 participant