Toad World® Forums

Can't import UTF-8 text files into Vertica


#1

I’m getting an error when trying to import files with 2-byte characters.
Only rows containing non-ASCII characters are not imported.

create table test (
  txt varchar(100)
);

test_import.csv:
txt
“Ż”

error log:

9:18:54 AM Thread (40) Importing 1 out of 1 files
9:18:54 AM Thread (40) Reading from file test_import.csv
9:18:54 AM Thread (40) Row 1 failed to insert, error: ODBC Database Error
09:19:04 Thread (40) Inserting data into table public.TEST generated an error. ODBC Database Error
ODBC Database Error
[Vertica][ODBC] (10170) String data right truncation on data from data source: String data is too big for the driver's data buffer.
09:19:04 Thread (40) Import canceled and inserted rows were rolled back.

#2

Have you fiddled with re-sizing the driver’s buffer? What does our Support team say about this one?


#3

I tried a few things but nothing helps. It won’t even import a single 2-byte character.


#4

Testing other (ODBC) drivers for Vertica, then? Otherwise, I would take this one to our Support team.


#5

What is the datatype of the column that is causing this error?
“String data is too big for the driver’s data buffer.”
This is coming from the ODBC driver itself. Most databases don’t support simple import of large columns such as blobs, etc. You have to import using special database functions. What you have described seems to fit into this scenario. Try importing but exclude any column that is not varchar(nn) or number type.