Skip to main content

"Unrecognized ICU conversion error." using pyodbc

  • October 14, 2014
  • 1 reply
  • 11 views

Ryan_Clough
Hey all,

We're using Vertica 6.1.3, and I have have a script that executes SQL statements in python using pyodbc. It has been working for a while, until a recent query on a table that contains a lot of various strings, it seems theres some sort of unicode issue, that causes the query to error out with "HY000] [Vertica][Support] (50310) Unrecognized ICU conversion error. (50310) (SQLGetData)"

The python implementation is pretty trivial, it takes in a sql string and calls cursor.execute, prints results.

The query looks like this (I've paired it down to a minimal case that seems to error out):
SELECT id, some_string  from s.strings;
The interesting thing is that for small limits (0-1000), the query returns fine, and if I JUST ask for the ids, it returns fine. It seems that for some particular string(s) that the error happens.

The connection string is pretty simple (anonymized values):
'DRIVER=Vertica;' +  'SERVER=server.hostname;' +  'PORT=5433;'  'DATABASE=database;' +  'UID=user;' +  'PWD=pw'  
And our odbcinst (using unixodbc on centos 6):
[Vertica]Description = "Vertica ODBC Driver"
Driver = /opt/vertica/lib64/libverticaodbc.so
vertica.ini:
[Driver]ODBCInstLib=/usr/lib64/libodbcinst.so
ErrorMessagesPath=/opt/vertica/lib64
LogLevel=4
LogPath=/tmp
Locale=en_US
I've also tried setting the charset to UTF-8 in the connection string and this didn't resolve the issue. I also tried a pyodbc patch listed here: https://code.google.com/p/pyodbc/issues/detail?id=78&can=1&q=UTF-16 but to no avail either.

1 reply

Ryan_Clough
  • Author
  • New Participant
  • October 14, 2014
UPDATE!

Solved it. when I installed the patched version of pyodbc, I didnt install it under the correct environment. I double checked, and manually replaced my pyodbc egg with a patched version I generated, and it now works. If anyone has similar issues, use the patch from https://code.google.com/p/pyodbc/issues/detail?id=78&can=1&q=UTF-16