You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Daniel Salomons (Jira)" <ji...@apache.org> on 2022/10/10 08:28:00 UTC
[jira] [Updated] (ARROW-17970) [Ruby] Parsing escaped inner quotations incorrectly.
[ https://issues.apache.org/jira/browse/ARROW-17970?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Salomons updated ARROW-17970:
------------------------------------
Description:
When using the CSVReader for a value with inner quotations escaped by backslashes the value is incorrectly parsed.
When I use
{code:java}
table = Arrow::MemoryMappedInputStream.open(file.path) do |input|
Arrow::CSVReader.new(input, options).read
end{code}
On a row such as
{code:java}
"Some value", "Another \"value\" quotations", "Last value"{code}
It outputs
{code:java}
Some value
Another value" quotations"
Last value{code}
When my expected output is
{code:java}
Some value
Another "value" quotations
Last value{code}
I've tried plenty of different options in different combinations, mainly the three below ones though.
{code:java}
options.quoted = true
options.double_quoted = false (tried with true)
options.escape_character = 92{code}
I assume this is a bug.
was:
When using the CSVReader for a value with inner quotations escaped by backslashes the value is incorrectly parsed.
When I use
{code:java}
table = Arrow::MemoryMappedInputStream.open(file.path) do |input|
Arrow::CSVReader.new(input, options).read
end{code}
On a row such as
{code:java}
"Some value", "Another \"value\" quotations", "Last value"{code}
It outputs
{code:java}
Some value
Another value" quotations"
Last value{code}
When my expected output is
{code:java}
Some value
Another "value" quotations
Last value{code}
I've tried plenty of different options in different combinations
{code:java}
options.quoted = true
options.double_quoted = false (tried with true)
options.escape_character = 92{code}
I assume this is a bug.
> [Ruby] Parsing escaped inner quotations incorrectly.
> ----------------------------------------------------
>
> Key: ARROW-17970
> URL: https://issues.apache.org/jira/browse/ARROW-17970
> Project: Apache Arrow
> Issue Type: Bug
> Components: Ruby
> Affects Versions: 9.0.0
> Environment: M1 macbook running ruby 3.0.3
> Reporter: Daniel Salomons
> Priority: Major
>
> When using the CSVReader for a value with inner quotations escaped by backslashes the value is incorrectly parsed.
> When I use
> {code:java}
> table = Arrow::MemoryMappedInputStream.open(file.path) do |input|
> Arrow::CSVReader.new(input, options).read
> end{code}
> On a row such as
> {code:java}
> "Some value", "Another \"value\" quotations", "Last value"{code}
> It outputs
> {code:java}
> Some value
> Another value" quotations"
> Last value{code}
> When my expected output is
> {code:java}
> Some value
> Another "value" quotations
> Last value{code}
> I've tried plenty of different options in different combinations, mainly the three below ones though.
> {code:java}
> options.quoted = true
> options.double_quoted = false (tried with true)
> options.escape_character = 92{code}
> I assume this is a bug.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)