Skip to main content

Teradata setup

Some core functionality may be limited. If you're interested in contributing, check out the source code for the repository listed below.

Overview of dbt-teradata

  • Maintained by: Teradata
  • Authors: Doug Beatty and Adam Tworkiewicz
  • GitHub repo: Teradata/dbt-teradata
  • PyPI package: dbt-teradata
  • Slack channel: #db-teradata
  • Supported dbt Core version: v0.21.0 and newer
  • dbt Cloud support: Not Supported
  • Minimum data platform version: n/a

Installing dbt-teradata

pip is the easiest way to install the adapter:

pip install dbt-teradata

Installing dbt-teradata will also install dbt-core and any other dependencies.

Configuring dbt-teradata

For Teradata-specifc configuration please refer to Teradata Configuration

For further info, refer to the GitHub repository: Teradata/dbt-teradata

Connecting to Teradata

To connect to Teradata Vantage from dbt, you'll need to add a profile to your profiles.yml file. A Teradata profile conforms to the following syntax:

profiles.yml
<profile-name>:
target: <target-name>
outputs:
<target-name>:
type: teradata
user: <username>
password: <password>
schema: <database-name>
tmode: ANSI
threads: 1
#optional fields
<field-name: <field-value>

Description of Teradata Profile Fields

The following fields are required:

ParameterDefaultTypeDescription
userstringSpecifies the database username. Equivalent to the Teradata JDBC Driver USER connection parameter.
passwordstringSpecifies the database password. Equivalent to the Teradata JDBC Driver PASSWORD connection parameter.
schemastringSpecifies the initial database to use after logon, instead of the user's default database.
tmode"ANSI"stringSpecifies the transaction mode. Only ANSI mode is currently supported.

The plugin also supports the following optional connection parameters:

ParameterDefaultTypeDescription
accountstringSpecifies the database account. Equivalent to the Teradata JDBC Driver ACCOUNT connection parameter.
column_name"false"quoted booleanControls the behavior of cursor .description sequence name items. Equivalent to the Teradata JDBC Driver COLUMN_NAME connection parameter. False specifies that a cursor .description sequence name item provides the AS-clause name if available, or the column name if available, or the column title. True specifies that a cursor .description sequence name item provides the column name if available, but has no effect when StatementInfo parcel support is unavailable.
connect_failure_ttl"0"quoted integerSpecifies the time-to-live in seconds to remember the most recent connection failure for each IP address/port combination. The driver subsequently skips connection attempts to that IP address/port for the duration of the time-to-live. The default value of zero disables this feature. The recommended value is half the database restart time. Equivalent to the Teradata JDBC Driver CONNECT_FAILURE_TTL connection parameter.
cop"true"quoted booleanSpecifies whether COP Discovery is performed. Equivalent to the Teradata JDBC Driver COP connection parameter.
coplast"false"quoted booleanSpecifies how COP Discovery determines the last COP hostname. Equivalent to the Teradata JDBC Driver COPLAST connection parameter. When coplast is false or omitted, or COP Discovery is turned off, then no DNS lookup occurs for the coplast hostname. When coplast is true, and COP Discovery is turned on, then a DNS lookup occurs for a coplast hostname.
dbs_port"1025"quoted integerSpecifies the database port number. Equivalent to the Teradata JDBC Driver DBS_PORT connection parameter.
encryptdata"false"quoted booleanControls encryption of data exchanged between the driver and the database. Equivalent to the Teradata JDBC Driver ENCRYPTDATA connection parameter.
fake_result_sets"false"quoted booleanControls whether a fake result set containing statement metadata precedes each real result set.
field_quote"\""stringSpecifies a single character string used to quote fields in a CSV file.
field_sep","stringSpecifies a single character string used to separate fields in a CSV file. Equivalent to the Teradata JDBC Driver FIELD_SEP connection parameter.
hoststringSpecifies the database hostname.
https_port"443"quoted integerSpecifies the database port number for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver HTTPS_PORT connection parameter.
lob_support"true"quoted booleanControls LOB support. Equivalent to the Teradata JDBC Driver LOB_SUPPORT connection parameter.
log"0"quoted integerControls debug logging. Somewhat equivalent to the Teradata JDBC Driver LOG connection parameter. This parameter's behavior is subject to change in the future. This parameter's value is currently defined as an integer in which the 1-bit governs function and method tracing, the 2-bit governs debug logging, the 4-bit governs transmit and receive message hex dumps, and the 8-bit governs timing. Compose the value by adding together 1, 2, 4, and/or 8.
logdatastringSpecifies extra data for the chosen logon authentication method. Equivalent to the Teradata JDBC Driver LOGDATA connection parameter.
logmech"TD2"stringSpecifies the logon authentication method. Equivalent to the Teradata JDBC Driver LOGMECH connection parameter. Possible values are TD2 (the default), JWT, LDAP, KRB5 for Kerberos, or TDNEGO.
max_message_body"2097000"quoted integerSpecifies the maximum Response Message size in bytes. Equivalent to the Teradata JDBC Driver MAX_MESSAGE_BODY connection parameter.
partition"DBC/SQL"stringSpecifies the database partition. Equivalent to the Teradata JDBC Driver PARTITION connection parameter.
sip_support"true"quoted booleanControls whether StatementInfo parcel is used. Equivalent to the Teradata JDBC Driver SIP_SUPPORT connection parameter.
sslcastringSpecifies the file name of a PEM file that contains Certificate Authority (CA) certificates for use with sslmode values VERIFY-CA or VERIFY-FULL. Equivalent to the Teradata JDBC Driver SSLCA connection parameter.
sslcapathstringSpecifies a directory of PEM files that contain Certificate Authority (CA) certificates for use with sslmode values VERIFY-CA or VERIFY-FULL. Only files with an extension of .pem are used. Other files in the specified directory are not used. Equivalent to the Teradata JDBC Driver SSLCAPATH connection parameter.
sslcipherstringSpecifies the TLS cipher for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver SSLCIPHER connection parameter.
sslmode"PREFER"stringSpecifies the mode for connections to the database. Equivalent to the Teradata JDBC Driver SSLMODE connection parameter.
DISABLE disables HTTPS/TLS connections and uses only non-TLS connections.
ALLOW uses non-TLS connections unless the database requires HTTPS/TLS connections.
PREFER uses HTTPS/TLS connections unless the database does not offer HTTPS/TLS connections.
REQUIRE uses only HTTPS/TLS connections.
VERIFY-CA uses only HTTPS/TLS connections and verifies that the server certificate is valid and trusted.
VERIFY-FULL uses only HTTPS/TLS connections, verifies that the server certificate is valid and trusted, and verifies that the server certificate matches the database hostname.
sslprotocol"TLSv1.2"stringSpecifies the TLS protocol for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver SSLPROTOCOL connection parameter.
teradata_values"true"quoted booleanControls whether str or a more specific Python data type is used for certain result set column value types.

For the full description of the connection parameters see https://github.com/Teradata/python-driver#connection-parameters.

Supported Features

Materializations

  • view
  • table
  • ephemeral
  • incremental

Commands

All dbt commands are supported.

0