Teradata SQL Driver for Python error

Connectivity
Connectivity covers the mechanisms for connecting to the Teradata Database, including driver connectivity via JDBC or ODBC.
Enthusiast

Teradata SQL Driver for Python error

Hi guys, I am currently using Python 3.6.7 on Windows and have installed the teradatasql module.

I am getting an error when executing the following:

import teradatasql

con = teradatasql.connect(None, host='aaa.bbb.ccc', user='user1', password='password1'

 

teradatasql.OperationalError: [Version 16.20.0.39] [Session 0] [Teradata SQL Driver] Failed to connect to aaa.bbb.ccc:1025 at github.td.teradata.com/gosql/gosqldriver.git/teradatasql.(*teradataConnection).makeDriverError TeradataConnection.go:1026 at github.td.teradata.com/gosql/gosqldriver.git/teradatasql.newTeradataConnection TeradataConnection.go:133 at github.td.teradata.com/gosql/gosqldriver.git/teradatasql.(*teradataDriver).Open TeradataDriver.go:32 at database/sql.dsnConnector.Connect sql.go:600 at database/sql.(*DB).conn sql.go:1103 at database/sql.(*DB).Conn sql.go:1619 at main.goCreateConnection goside.go:93 at main._cgoexpwrap_9da3c3415413_goCreateConnection _cgo_gotypes.go:91 at runtime.call64 asm_amd64.s:574 at runtime.cgocallbackg1 cgocall.go:316 at runtime.cgocallbackg cgocall.go:194 at runtime.cgocallback_gofunc asm_amd64.s:826 at runtime.goexit asm_amd64.s:2361 Caused by dial tcp: lookup aaa.bbb.ccc: no such host

 

Just as further information, the older python module available here: https://developer.teradata.com/tools/reference/teradata-python-module seems to work fine with ODBC connection. I also have Teradata Tools and Utilities installed on my Windows machine and can connect to the database server without issue either using ODBC driver or using Teradata.NET driver. Does anyone know why I'm getting 'no such host' error when using the teradatasql module?

5 REPLIES
Teradata Employee

Re: Teradata SQL Driver for Python error

Can you resolve (ping) that exact hostname aaa.bbb.ccc or only aaaCOP1.bbb.ccc?

COP discovery / LCC is implemented for ODBC, .NET, CLIv2 but not for teradatasql (yet).

 

In other words, you must connect to a specific node or use some external mechanism to distribute "generic" connections among different specific nodes (e.g. load balancer, DNS round-robin).

Enthusiast

Re: Teradata SQL Driver for Python error

Thanks Fred,

When I ping aaa.bbb.ccc: ping aaa.bbb.ccc

Unable to resolve target system name aaa.bbb.ccc

 

When I ping aaaCOP1.bbb.ccc:

Pinging <nodename> [ip address] with 32 bytes of data:

Reply from : bytes=32 time=14ms TTL=57 Reply from : bytes=32 time=6ms TTL=57

Reply from : bytes=32 time=5ms TTL=57

Reply from : bytes=32 time=7ms TTL=57

 

 

 

Ping statistics for :

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 5ms, Maximum = 14ms, Average = 8ms

 

So the <nodename> above is what i need to specify in the host='' parameter. Is that correct?

 

Also do you know roughly when the COP discovery/LCC will be implemented into teradatasql? 

Highlighted
Teradata Employee

Re: Teradata SQL Driver for Python error

Yes. The "host=" value must resolve "as-is" to a valid IP address.

So the actual nodename or the aaaCOP1.bbb.ccc or the numeric ip address should all work.

 

Someone else may be able to comment on which features are likely to be added to teradatasql and how soon. I don't know.

 

Teradata Employee

Re: Teradata SQL Driver for Python error

>>> roughly when the COP discovery/LCC will be implemented into teradatasql?

 

We are currently working on COP Discovery for the Teradata SQL Driver for Python. Our plan is for the feature to be available in Q1 2019.

Enthusiast

Re: Teradata SQL Driver for Python error


@tomnolan wrote:

>>> roughly when the COP discovery/LCC will be implemented into teradatasql?

 

We are currently working on COP Discovery for the Teradata SQL Driver for Python. Our plan is for the feature to be available in Q1 2019.


Excellent! Very keen to see this supported.

 

Cheers.