Skip to content

Conversation

@mcarmonagonzalez
Copy link
Contributor

@mcarmonagonzalez mcarmonagonzalez commented Sep 12, 2025

Description

Similar to #16754 and #18952, this change maintains a "bug" from the original OpenCSV reader in the native CSV reader. In the original CSVParser logic , quote/escape characters were not considered equivalent if either of the characters was the null character \0. This is because setting both of them to the null character would disable both quoting and escaping and is a valid configuration.

Even though having both quoting and escaping disabled could lead to data not round tripping, support for reading from tables with the same null quote/escape character should be maintained in the native CSV reader implementation.

Additional context and related issues

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(X) Release notes are required, with the following suggested text:

## Hive
* Fix incompatibility issue with Hive OpenCSV to allow reading from tables with quoting and escaping disabled   ({issue}`26619`)

@cla-bot cla-bot bot added the cla-signed label Sep 12, 2025
@mcarmonagonzalez mcarmonagonzalez marked this pull request as draft September 12, 2025 04:03
@mcarmonagonzalez mcarmonagonzalez marked this pull request as ready for review September 12, 2025 15:50
@mcarmonagonzalez mcarmonagonzalez force-pushed the csv-quote-escape-fix branch 2 times, most recently from 077d1c7 to 511b59f Compare September 12, 2025 19:41
Hive OpenCSV allows for setting both the escape and quote character to
the null character to indicate escaping/quoting is disabled. The native
CSV reader is supposed to be a compatible reimplementation of the Hive
OpenCSV reader so this behavior must also be supported.
@wendigo wendigo merged commit 6974d81 into trinodb:master Sep 13, 2025
117 of 120 checks passed
@github-actions github-actions bot added this to the 477 milestone Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants