platiumky / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

HP Vertica: non of INTERVAL values are supported #337

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

    Connect to Vertica db and query for example: "SELECT INTERVAL '1 DAY'"

What is the expected output? What do you see instead?

    I dont know, I think one of ['DateFromTicks', 'TimeFromTicks', 'TimestampFromTicks'] types. And I get exception: 
    pyodbc.Error: ('ODBC data type 1xx not supported. Cannot read column XXXX', 'HY000')

What version of the product are you using? On what operating system?

    OS: Ubuntu 12.10
    Python: Python 2.7.3
    pyodbc: 3.x

>>> import pyodbc
>>> pyodbc.version
'3.0.6'
>>> con = pyodbc.connect(dsn='Vertica')
>>> con.execute("SELECT INTERVAL '1 DAY'")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pyodbc.Error: ('ODBC data type 110 is not supported.  Cannot read column 
?column?.', 'HY000')

Original issue reported on code.google.com by setarc...@gmail.com on 15 Sep 2013 at 1:52

GoogleCodeExporter commented 8 years ago
I have this too. Would someone comment on whether this will be looked at? Thank 
you.

Original comment by matthewc...@gmail.com on 21 Jan 2014 at 5:16

GoogleCodeExporter commented 8 years ago
I see the same issue

Original comment by vishal.k...@gmail.com on 24 Mar 2014 at 7:03

GoogleCodeExporter commented 8 years ago
I have this same issue with NetezzaSQL database. Data type 110 is not supported.

Original comment by a.navarr...@gmail.com on 26 Aug 2014 at 8:42

GoogleCodeExporter commented 8 years ago
I think that INTERVAl data type is not on road map so far.
As workaround - covert interval to int(seconds).

Original comment by dan...@twingo.co.il on 26 Aug 2014 at 8:53

GoogleCodeExporter commented 8 years ago
Use vertica-pyodbc.
much better connector.

Original comment by be...@twingo.co.il on 14 Dec 2014 at 2:13

GoogleCodeExporter commented 8 years ago
@benny
>> much better connector.

1) do you mean vertica-python <https://github.com/uber/vertica-python>?  :)
2) much slower (much more). 
3) based on PostgreSQL wire protocol and what if Vertica will change a 
protocol? ;)
4) unofficial. For academic project connector is good enough, but not for 
enterprise. Use it on your own risk.
4) protocol supports for (3, 0) only and doesn't supports for (3, 5)

file main: __init__.py

    # The protocol version (3.0.0) implemented in this library.
    PROTOCOL_VERSION = 3 << 16

PS
Also implementation done without learning a PG Wire Protocol it self, but:

    This package is a Python port of the excellent Vertica Ruby gem
;)

Original comment by D.Leybov...@gmail.com on 13 Apr 2015 at 4:03