You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Arina Ielchiieva (Jira)" <ji...@apache.org> on 2019/10/11 12:07:00 UTC
[jira] [Resolved] (DRILL-6984) from table escape parameter not
deleted when defined with value other than '"'
[ https://issues.apache.org/jira/browse/DRILL-6984?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Arina Ielchiieva resolved DRILL-6984.
-------------------------------------
Resolution: Fixed
Issue was fixed with v3 text reader introduction and several subsequent fixes.
> from table escape parameter not deleted when defined with value other than '"'
> -------------------------------------------------------------------------------
>
> Key: DRILL-6984
> URL: https://issues.apache.org/jira/browse/DRILL-6984
> Project: Apache Drill
> Issue Type: Bug
> Components: Functions - Drill
> Affects Versions: 1.15.0
> Reporter: benj
> Priority: Minor
> Fix For: 1.17.0
>
>
> When change the escape char, it's kept in the output instead of be deleted like with '"'
> Example :
> the file sample.csv :
> {code:java}
> name|age|subject|info
> Bob|21|"lovely quotes"|none
> Bill|23|"character @"|@" pipe"|none
> {code}
> {code:java}
> SELECT * FROM table(tmp`sample.csv`(`escape`=>'@', type => 'text', fieldDelimiter => '|',quote=>'"', extractHeader => true));
> {code}
> The result is
> {code:java}
> | name | age | subject | info |
> +---------+------+-----------------------+-------+
> | Bob | 21 | lovely quotes | none |
> | Bill | 23 | character @"|@" pipe | none |
> {code}
> As we expect : < character "|" pipe > (without the escape char (@)
>
> Note that we have the good behavior when using quote ('"') as escaping character
> {code:java}
> name|age|subject|info
> Bob|21|"lovely quotes"|none
> Bill|23|"character ""|"" pipe"|none
> {code}
> {code:java}
> SELECT * FROM table(tmp`sample.csv`(`escape`=>'"', type => 'text', fieldDelimiter => '|',quote=>'"', extractHeader => true));
> OR
> SELECT * FROM table(tmp`sample.csv`(type => 'text', fieldDelimiter => '|',quote=>'"', extractHeader => true));
> {code}
> The result is OK with
> {code:java}
> | name | age | subject | info |
> +---------+------+-----------------------+-------+
> | Bob | 21 | lovely quotes | none |
> | Bill | 23 | character "|" pipe | none |
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)