-
Type:
Bug
-
Status: Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.15.0
-
Fix Version/s: 1.17.0
-
Component/s: Functions - Drill
-
Labels:None
When change the escape char, it's kept in the output instead of be deleted like with '"'
Example :
the file sample.csv :
name|age|subject|info Bob|21|"lovely quotes"|none Bill|23|"character @"|@" pipe"|none
SELECT * FROM table(tmp`sample.csv`(`escape`=>'@', type => 'text', fieldDelimiter => '|',quote=>'"', extractHeader => true));
The result is
| name | age | subject | info |
+---------+------+-----------------------+-------+
| Bob | 21 | lovely quotes | none |
| Bill | 23 | character @"|@" pipe | none |
As we expect : < character "|" pipe > (without the escape char (@)
Note that we have the good behavior when using quote ('"') as escaping character
name|age|subject|info Bob|21|"lovely quotes"|none Bill|23|"character ""|"" pipe"|none
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));
The result is OK with
| name | age | subject | info |
+---------+------+-----------------------+-------+
| Bob | 21 | lovely quotes | none |
| Bill | 23 | character "|" pipe | none |
- Is contained by
-
DRILL-6986 Table function improvements / issues (UMBRELLA JIRA)
-
- Open
-