Skip to main content

Error loading TSV file into Vertica Flex("String of 2 octets is too long for type Varchar(1)" )

  • May 22, 2015
  • 3 replies
  • 23 views

maizer
  • Participating Frequently

Hello all,

 

I'm trying to load some TSV data into Vertica. It has maybe 2000 columns, and the column names are up to 300 characters(3rd party marketing data).

 

When I try to load into Vertica Flex though, I get the following error:

 

 

Error: [Vertica][VJDBC](4800) ERROR: String of 2 octets is too long for type Varchar(1)
SQLState: 22001
ErrorCode: 4800

 

 

The commands I put in to create the table and load data:

 

CREATE FLEX TABLE ad.ptv_job_title()

 

copy ad.ptv_job_title from local '/Users/al/Documents/jobtitle.txt' parser fdelimitedparser (delimiter
='\t', header=true)

 

I've been blocked on this for days, any help would be awesome.

3 replies

DerrickR
Forum|alt.badge.img
  • Participating Frequently
  • May 22, 2015

I think the problem is with this:

 

fdelimitedparser (delimiter='\t', header=true)

 

You want the delimiter to be a tab character, but I think you are specifying "backslash tee" instead.

 

Try:

 

fdelimitedparser (delimiter=E'\t', header=true)

 

- Derrick


maizer
  • Author
  • Participating Frequently
  • May 22, 2015

Thank you again, this works perfectly!


Seetha
  • New Participant
  • April 8, 2016

Above solution works for single octet characters.  How to parse a double-octet characters such as "thorn" (þ) using COPY statement?