You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "benj (JIRA)" <ji...@apache.org> on 2019/01/17 10:39:00 UTC

[jira] [Created] (DRILL-6984) from table escape parameter not deleted when defined with value other than '"'

benj created DRILL-6984:
---------------------------

             Summary: 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


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
(v7.6.3#76005)