Getting Double Quotes on all strings when I load a string csv file

andrewchentaboolaandrewchentaboola Vertica Customer
edited August 2019 in General Discussion

In my CSV file there are no double quotes, but once I load into Vertica, it starts showing "string" double quotes around my string for every value which is not what I want. I just want the normal string value.

COPY analysts.alerts_generated FROM LOCAL 'localfilepathblabla/alert_event.csv' ABORT ON ERROR DELIMITER ',' NULL AS 'null' SKIP 1 DIRECT STREAM NAME 'LOCAL_COPY_events_generated'

Answers

  • Bryan_HBryan_H Vertica Employee Administrator

    Hi, could you provide more detail? What version of Vertica are you running, and what client are you using? Here is my simple attempt to replicate the issue, which seems OK:
    /tmp/sample.csv:
    A,B,C,D,E,F
    1,2,three,four,five,6
    9,8,seven,six,five,4
    11,21,eleven,twelve,ten,10

    dbadmin=> create table public.alerts_generated (a int, b float, c varchar, d long varchar, e varbinary, f int);
    CREATE TABLE
    dbadmin=> COPY public.alerts_generated FROM LOCAL '/tmp/sample.csv' ABORT ON ERROR DELIMITER ',' NULL AS 'null' SKIP 1 DIRECT STREAM NAME 'LOCAL_COPY_events_generated';
     Rows Loaded
    -------------
               3
    (1 row)
    dbadmin=> select * from public.alerts_generated ;
     a  | b  |   c    |   d    |  e   | f
    ----+----+--------+--------+------+----
      1 |  2 | three  | four   | five |  6
      9 |  8 | seven  | six    | five |  4
     11 | 21 | eleven | twelve | ten  | 10
    (3 rows)
    
  • What tool are you using to select from? Is this in vsql, or something else? Your COPY command won't add quotes to your string. Maybe something else?

  • andrewchentaboolaandrewchentaboola Vertica Customer

    DBVisualizer Pro 10.0.21
    Should be something Vertica 9.0+ (9.2 )?

  • Bryan_HBryan_H Vertica Employee Administrator

    For me, DbVis 10.0.21 doesn't show quotes in the grid, or when I copy a selection from the grid. However, you may need to disable quoting when you export using the wizard. About halfway down the dialog, check for the "quote text value" setting:

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file