drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krystal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-3178) csv reader should allow newlines inside quotes
Date Tue, 01 Nov 2016 23:06:58 GMT

    [ https://issues.apache.org/jira/browse/DRILL-3178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15626977#comment-15626977
] 

Krystal commented on DRILL-3178:
--------------------------------

commit id: 83513daf0903e0d94fcaad7b1ae4e8ad6272b494

Using data from comment #2, verified that data gets returned as expected.

select * from `drill-3178/drill3178.csv`;
+------------------+
|     columns      |
+------------------+
| ["1","line1"]    |
| ["2","line2\n"]  |
| ["3","line3"]    |
+------------------+
3 rows selected (0.158 seconds)

 select columns[0], columns[1] from `drill-3178/drill3178.csv`;
+---------+---------+
| EXPR$0  | EXPR$1  |
+---------+---------+
| 1       | line1   |
| 2       | line2
  |
| 3       | line3   |
+---------+---------+

select columns[0],columns[1] from `drill-3178/drill3178.csv` where columns[0] > 1 order
by columns[1] desc;
+---------+---------+
| EXPR$0  | EXPR$1  |
+---------+---------+
| 3       | line3   |
| 2       | line2
  |
+---------+---------+
2 rows selected (0.373 seconds)


> csv reader should allow newlines inside quotes 
> -----------------------------------------------
>
>                 Key: DRILL-3178
>                 URL: https://issues.apache.org/jira/browse/DRILL-3178
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Storage - Text & CSV
>    Affects Versions: 1.0.0
>         Environment: Ubuntu Trusty 14.04.2 LTS
>            Reporter: Neal McBurnett
>            Assignee: F M├ęthot
>             Fix For: 1.9.0
>
>         Attachments: drill-3178.patch
>
>
> When reading a csv file which contains newlines within quoted strings, e.g. via
>     select * from dfs.`/tmp/q.csv`;
> Drill 1.0 says:
>     Error: SYSTEM ERROR: com.univocity.parsers.common.TextParsingException:  Error processing
input: Cannot use newline character within quoted string
> But many tools produce csv files with newlines in quoted strings.  Drill should be able
to handle them.
> Workaround: the csvquote program (https://github.com/dbro/csvquote) can encode embedded
commas and newlines, and even decode them later if desired.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message