Driver for Teradata¶
Driver Version v0.1.1 Tested With Teradata 20
This driver provides access to Teradata .
Note
This project is not affiliated with Teradata.
Installation & Quickstart¶
Important
This driver is available from Columnar’s private driver registry. Before installing it, create an account at cloud.columnar.tech and click to activate a 14-day free trial. Then authenticate to the registry:
dbc auth login
The driver can be installed with dbc :
dbc install teradata
To use the driver:
Install the Teradata Tools and Utilities .
Set
LD_LIBRARY_PATH,DYLD_LIBRARY_PATH,PATH, or otherwise make sure the Teradata client libraries are discoverable by your application, if needed.Provide the connection string as the
uriparameter.
Connecting¶
To use the driver, provide a URI as the uri option. The driver supports URI format and Teradata’s own connection strings, but URIs are recommended.
from adbc_driver_manager import dbapi
dbapi.connect(
driver="teradata",
db_kwargs={
"uri": "teradata://dbc:dbc@127.0.0.1:1025"
}
)
Note: The example above is for Python using the adbc-driver-manager package but the process will be similar for other driver managers. See adbc-quickstarts .
Connection String Format¶
teradata://user:password@host[:port]
Components:
scheme:teradata://(required)user/password: For standard database authentication.host: (required) The hostname or IP address of the Teradata database server.port: (optional) Defaults to 1025.
Note
Reserved characters in URI elements must be URI-encoded. For example, @ becomes %40.
Examples:
teradata://dbc:dbc@127.0.0.1teradata://dbc:dbc@dbhost.local:1025
Feature & Type Support¶
| Feature | Support | |
|---|---|---|
| Bulk Ingestion | Create | ✅ |
| Append | ✅ | |
| Create/Append | ✅ | |
| Replace | ✅ | |
| Temporary Table | ❌ | |
| Specify target catalog | ✅ | |
| Specify target schema | ❌ | |
| Non-nullable fields are marked NOT NULL | ❌ | |
| Catalog (GetObjects) | depth=catalogs | ✅ |
| depth=db_schemas | ✅ | |
| depth=tables | ✅ | |
| depth=columns (all) | ✅ | |
| Get Parameter Schema | ❌ | |
| Get Table Schema | ❌ | |
| Prepared Statements | ✅ | |
| Transactions | ❌ | |
Types¶
Teradata to Arrow¶
Teradata Type |
Arrow Type |
|---|---|
BIGINT |
int64 |
BLOB |
large_binary |
BYTEINT |
int8 |
CHARACTER(n) CHARACTER SET UNICODE |
string ⚠️ [1] |
CLOB CHARACTER SET LATIN |
large_string |
CLOB CHARACTER SET UNICODE |
large_string |
DATE |
date32[day] |
DOUBLE PRECISION |
double |
INT |
int32 |
INTERVAL DAY(n) |
month_day_nano_interval |
INTERVAL DAY(n) TO HOUR |
month_day_nano_interval |
INTERVAL DAY(n) TO MINUTE |
month_day_nano_interval |
INTERVAL DAY(n) TO SECOND(n) |
month_day_nano_interval |
INTERVAL HOUR(n) |
month_day_nano_interval |
INTERVAL HOUR(n) TO MINUTE |
month_day_nano_interval |
INTERVAL HOUR(n) TO SECOND(n) |
month_day_nano_interval |
INTERVAL MINUTE(n) |
❌ [2] |
INTERVAL MINUTE(n) TO SECOND(n) |
month_day_nano_interval |
INTERVAL MONTH(n) |
❌ [2] |
INTERVAL SECOND(n, n) |
month_day_nano_interval |
INTERVAL YEAR(n) |
month_day_nano_interval |
INTERVAL YEAR(n) TO MONTH |
month_day_nano_interval |
NUMBER |
decimal256 |
NUMERIC |
decimal128 |
SMALLINT |
int16 |
TIME(0) |
time32[s] |
TIME(1) |
time32[ms] |
TIME(2) |
time32[ms] |
TIME(3) |
time32[ms] |
TIME(4) |
time64[us] |
TIME(5) |
time64[us] |
TIME(6) |
time64[us] |
TIMESTAMP |
timestamp[s] |
TIMESTAMP WITH TIME ZONE |
timestamp[s] (with time zone) |
TIMESTAMP(0) |
timestamp[s] |
TIMESTAMP(0) WITH TIME ZONE |
timestamp[s] (with time zone) |
TIMESTAMP(1) |
timestamp[ms] |
TIMESTAMP(1) WITH TIME ZONE |
timestamp[ms] (with time zone) |
TIMESTAMP(2) |
timestamp[ms] |
TIMESTAMP(2) WITH TIME ZONE |
timestamp[ms] (with time zone) |
TIMESTAMP(3) |
timestamp[ms] |
TIMESTAMP(3) WITH TIME ZONE |
timestamp[ms] (with time zone) |
TIMESTAMP(4) |
timestamp[us] |
TIMESTAMP(4) WITH TIME ZONE |
timestamp[us] (with time zone) |
TIMESTAMP(5) |
timestamp[us] |
TIMESTAMP(5) WITH TIME ZONE |
timestamp[us] (with time zone) |
TIMESTAMP(6) |
timestamp[us] |
TIMESTAMP(6) WITH TIME ZONE |
timestamp[us] (with time zone) |
VARBYTE |
binary |
VARCHAR(n) CHARACTER SET LATIN |
string |
VARCHAR(n) CHARACTER SET UNICODE |
string |
Arrow to Teradata¶
| Arrrow Type | Teradata Type | |
|---|---|---|
| Bind | Ingest | |
| binary |
VARBYTE [3] |
VARBINARY |
| binary_view |
VARBYTE [3] |
VARBINARY |
| bool |
BYTEINT [4] |
BOOLEAN |
| date32[day] |
DATE |
|
| decimal128 |
NUMERIC |
|
| double |
DOUBLE PRECISION |
|
| fixed_size_binary |
VARBYTE |
VARBINARY |
| float |
REAL |
|
| halffloat |
REAL |
(not tested) |
| int16 |
SMALLINT |
|
| int32 |
INT |
|
| int64 |
BIGINT |
|
| large_binary |
VARBYTE [3] |
VARBINARY |
| large_string |
VARCHAR |
|
| string |
VARCHAR |
|
| string_view |
VARCHAR |
|
| time32[ms] |
TIME |
|
| time32[s] |
TIME |
|
| time64[ns] |
TIME |
|
| time64[us] |
TIME |
|
| timestamp[ms] |
TIMESTAMP(3) |
|
| timestamp[ms] (with time zone) |
TIMESTAMP(3) WITH TIME ZONE |
|
| timestamp[ns] |
TIMESTAMP(9) [5] |
TIMESTAMP(9) |
| timestamp[ns] (with time zone) |
TIMESTAMP(9) WITH TIME ZONE [5] |
TIMESTAMP(9) WITH TIME ZONE |
| timestamp[s] |
TIMESTAMP(0) |
|
| timestamp[s] (with time zone) |
TIMESTAMP(0) WITH TIME ZONE |
|
| timestamp[us] |
TIMESTAMP(6) |
|
| timestamp[us] (with time zone) |
TIMESTAMP(6) WITH TIME ZONE |
|