Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6840

Exporting to CSV using !set csvquotecharacter '"' not working in latest stable or snapshot versions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Bug
    • 1.14.0
    • None
    • Storage - Text & CSV

    Description

      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:

      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> 
      

      The CSV output doesn't have any field enclosed with ", even those that have values with the , character, so the CSV is broken.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mrsarm Mariano Ruiz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: