You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Mariano Ruiz (JIRA)" <ji...@apache.org> on 2018/11/09 14:01:00 UTC

[jira] [Created] (DRILL-6840) Exporting to CSV using {{!set csvquotecharacter '"'}} not working in latest stable or snaptshot versions

Mariano Ruiz created DRILL-6840:
-----------------------------------

             Summary: Exporting to CSV using {{!set csvquotecharacter '"'}} not working in latest stable or snaptshot versions
                 Key: DRILL-6840
                 URL: https://issues.apache.org/jira/browse/DRILL-6840
             Project: Apache Drill
          Issue Type: Bug
          Components: Storage - Text &amp; CSV
    Affects Versions: 1.14.0, Future
         Environment: * Tested with latest version *Apache Drill* 1.14.0, and building the latest version from master (Github repo), commit ad61c6bc1dd24994e50fe7dfed043d5e57dba8f9 at _Nov 5, 2018_.
 * *Linux* x64, Ubuntu 16.04
 * *OpenJDK* Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.17.10.1-b11)
 * Apache *Maven* 3.5.0
            Reporter: Mariano Ruiz


Using latest stable version and latest SNAPSHOT version, when I export to a CSV file the result of a query, the text fields aren't enclosed with double quotes as specified.

Steps:
{code:java}
0: jdbc:drill:zk=local> USE dfs.tmp;
+-------+--------------------------------------+
|  ok   |               summary                |
+-------+--------------------------------------+
| true  | Default schema changed to [dfs.tmp]  |
+-------+--------------------------------------+
1 row selected (0.126 seconds)
0: jdbc:drill:zk=local> ALTER SESSION SET `store.format`='csv';
+-------+------------------------+
|  ok   |        summary         |
+-------+------------------------+
| true  | store.format updated.  |
+-------+------------------------+
1 row selected (0.117 seconds)
0: jdbc:drill:zk=local> !set csvquotecharacter '"'
0: jdbc:drill:zk=local> CREATE TABLE dfs.tmp.prods_without_brand AS SELECT * FROM dfs.`/tmp/prods.csv` WHERE brand = '';
+-----------+----------------------------+
| Fragment  | Number of records written  |
+-----------+----------------------------+
| 0_0       | 112                        |
+-----------+----------------------------+
1 row selected (0.198 seconds)
0: jdbc:drill:zk=local> 
{code}

The CSV output doesn't have any field enclosed with *{color:red}"{color}*, even those that have values with the *{color:red},{color}* character, so the CSV is broken.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)