Skip to content

refactor: support disabling CSV quote parsing by NONE_QUOTE#847

Merged
delei merged 1 commit intoapache:mainfrom
huangzengtian:feature/#846-support-none-quote
Feb 7, 2026
Merged

refactor: support disabling CSV quote parsing by NONE_QUOTE#847
delei merged 1 commit intoapache:mainfrom
huangzengtian:feature/#846-support-none-quote

Conversation

@huangzengtian
Copy link
Contributor

  • 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
Copy link
Member

@delei delei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@delei delei changed the title [enhancement] Support disabling CSV quote parsing by NONE_QUOTE #846feat: refactor: support disabling CSV quote parsing by NONE_QUOTE Feb 7, 2026
@delei delei merged commit 649ffff into apache:main Feb 7, 2026
9 checks passed
@delei delei added the PR: first-time contributor first-time contributor label Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: first-time contributor first-time contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants