Skip to content
Last updated

Teradata Import Integration

The integration for Teradata enables the import of data from your Teradata Server into Treasure Data.

Prerequisites

  • Basic knowledge of Treasure Data
  • Basic knowledge of Teradata SQL
  • A Teradata instance running

Create a New Authentication

  1. Go to Integrations Hub > Catalog.
  2. Search and select Teradata.

  1. A dialog will open.                                                                                                                                         

  2. Provide your configuration.

    ParametersDescription
    HostThe host information of the teradata database, eg. an IP address.
    PortThe connection port on the instance,Teradata default is 1025.
    UsernameUsername to connect to the teradata database.
    PasswordPassword to connect to the teradata database.
    OPTIONS
    JDBC Connection optionsAny special JDBC connections required by Teradata database. Please don't add these jdbc options because it will be ignore: - DBS_PORT (use port config) - DATABASE (use database config) - USER (use user config) - PASSWORD (use password config) - LOGMECH (currently support TD2 only)
    connection timeoutTimeout (in seconds) for socket connection (default is 300).
    Network timeoutTimeout (in seconds) for network socket operations (default is 1800). 0 means no timeout.
  3. Type a name for your connection and select Done .

Validate your Query

If you want to load data from a SQL Query, confirm that your query is valid SELECT statement. Multiple statement is not supported.

Create a New Transfer

After creating the connection, you are automatically taken to the Authentications tab. Look for the connection you created and select Source.

Import Types

Select source type of import, either loading a whole table/view (table/view loading) or loading a SQL result (query loading).

Table/View Loading

If you want to load a whole table/view, select "Table/View", then provide the "Table/View name" that you want to load.

Query Loading

If you want to load a SQL result, select "Query statement", then input an SQL query into the "SQL statement".

Before creating transfer, confirm that your query is valid SELECT query and single statement. If you fetch data from Query and Incremental then the query statement must exclude ORDER BY clause

Incremental Loading

Incremental loading can load only new records after last execution by using increasing, unique column(s), such as an auto-increment ID column or timestamp column.

To enable it, check Incremental Loading, then specify column name to increment into "Incremental Column Name."

Only INTEGER or BIGINT type and TIMESTAMP type are supported as an incremental column.

Input Start After in case you would like to start incremental loading from this value. If incremental column have Timestamp Type then input much be Timestamp string in format yyyy-MM-dd'T'HH:mm:ss.SSSSSS and the value will be treat as UTC timezone.

How This Works

This connector records "last record" which is the latest record ordered by the incremental column. In the next execution, it loads records by running a query built by the following rule using the last record:

With table loading, all fields are selected with the WHERE clause.

SELECT   * FROM   `${dataset}.${table}` WHERE   ${incremental_column} > ${value_of_last_record}

With query loading, the raw query is wrapped with the WHERE clause.

SELECT   * FROM   (${query}) embulk_incremental_ WHERE   ${incremental_column} > ${value_of_last_record}

Data Settings

  1. Select Next. The Data Settings page opens.
  2. Optionally, edit the data settings or skip this page of the dialog.

ParametersDescription
Rows per batchExtremely large datasets can lead to memory issues and, subsequently, failed jobs. Use this flag to break down the import job into batches by the number of rows to reduce the chances of memory issues and failed jobs. Set 0 for unlimited. Otherwise the value must be greater than 0

Data Preview

After configuring the data source, select Next then Next and click Generate Previewto see a sample result from the source.

Transfer to

After you select Next from the preview, you are asked to select the database and table in Treasure Data where you want to transfer the data into. If you want to create a new database, select Create new database and give your database a name. Do the same with Create new table.

Select whether to append records to an existing table or replace your existing table.

If you want to set a different partition key seed than the default key, you can select one from the "Partition key seed".

Schedule

On the SCHEDULE section, you can specify the import job as a one-time transfer, or you can schedule an automated recurring transfer.

After your transfer runs, you can see the results of your transfer in the Databases tab.

Appendix

Data Conversion

Teradata's data types are automatically converted to a corresponding Treasure Data type, as indicated in the following table. If you include unsupported types in the schema of the table/view or query result, you receive errors.

Teradata Data TypeTD Data Type
BYTEINTLong
SMALLINTLong
INTEGERLong
BIGINTLong
FLOATDouble
DECIMALString
CHARString
VARCHARString
BYTEUnsupport
VARBYTEUnsupport
DATEString
TIMEString
TIMESTAMPTimestamp
CLOBString
BLOBUnsupport
Structured UDTString
INTERVALString
JSONString
XMLString
PERIODString
GEOString

Quotas and Limits

Any quotas and limits of Teradata Server.

Use Teradata Connector via CLI

If you prefer, you can use the connector via TD Toolbelt.

Set up TD Toolbelt on the CLI.

Create Configuration File

Create configuration YAML file that is referred to as "config.yml" here.

Example: Import from table with incremental, incremental column in biginteger data type and last_record set

in:  
   type: teradata  
   host: xxx  
   options: {"xxx": "xxx"}  
   connect_timeout:300  
   socket_timeout:1800  
   user: xxx  
   port: 1025  
   password: xxxx  
   database: xxxxx  
   source_type: table_view  
   table: xxxx  
   fetch_rows: 10000  
   incremental: true  
   incremental_column: big_int_column  
   last_record: 100

Example: Import from Query with incremental, incremental column in timestamp data type and last_record set

in:  
   type: teradata  
   host: xxx  
   options: {"xxx": "xxx"}  
   connect_timeout:300  
   socket_timeout:1800  
   user: xxx  
   port: 1025  
   password: xxxx  
   database: xxxxx  
   source_type: query  
   query: |    
      SELECT * FROM tbl;  fetch_rows: 10000  incremental: true  incremental_column: created_at  last_record: '2025-08-26T12:10:42.010000'

Parameters

NameDescriptionTypeValueDefault ValueRequired
typeconnector typestringteradataN/AYes
hostTeradata server hoststringN/AN/AYes
portTeradata server portnumberN/A1025
optionsTeradata JDBC optionstring (in hash object format)N/AN/ANo
connect_timeoutTeradata logon timeoutnumberN/A300No
socket_timeoutNetwork socket operations timeoutnumberN/A1800No
databaseTeradata databasestringN/AN/AYes
source_typeSource importstringSupport values: - table_view - querytableYes
tableTable NamestringN/AN/AYes if source_type is table_view
querySQL statementstringN/AN/AYes if source_type is query
incrementalWhether to enable incremental loadingbooleantrue/falsefalseNo
incremental_columnColumn name for incremental loading Only support for INTEGER, BIGINT ot TIMESTAMP data typestringN/AN/AYes if incremental is true
last_recordStart incremental import from this value. If column incremental have data type timestamp then this value must follow format yyyy-MM-dd'T'HH:mm:ss.SSSSSS and will be treat as UTC timezonestringN/AN/ANo

(Optional) Preview

Run td td connector:preview command to validate your configuration file

td connector:preview config.yml

Create New Connector Session

Run td connector:create.

By the following example, a daily import session with Teradata connector is created.

td connector:create daily_teradata_import \
"10 0 * * *" td_sample_db td_sample_table config.yml

Data Partition Key

Connector sessions need at least one timestamp column in result data to be used as data partition key and the first timestamp column is chosen as the key by default. Use "--time-column" option if you want to explicitly specify a column.

$ td connector:create --time-column created_at \
daily_teradata_import ...

If your result data doesn't have any timestamp column, add the "time" column by adding the filter configuration as follows.

in:   
   type: teradata   
   ... 
filters: 
   - type: add_time   
     from_value:     
       mode: upload_time  
     to_column:     
       name: time 
out:   
   typetd