This feature is in BETA version. For more information, contact your Customer Success Representative.
Delta sharing helps you organize and integrate customer data within your company and transform it into optimal data for marketing purposes. With this integration, you can import Delta sharing data into Treasure Data.
- Basic knowledge of Treasure Data
- Basic knowledge of Delta Sharing server
- You must have a user ID on the Delta Sharing server with sufficient permissions to access information on the server.
- You must have an API endpoint for the Delta Sharing metastores.
- You must have a bearer token to authenticate the API calls to the Delta Sharing server.
The static IP address of Treasure Data is the access point and source of the linkage for this Integration. To determine the static IP address, contact your Customer Success representative or technical support.
The integration can read data in Databricks by using Delta Sharing open sharing with recipients.
Here are key endpoints:
- To create a new recipient for sharing — https://docs.databricks.com/en/delta-sharing/create-recipient.html
- To grant the recipient access to a share — https://docs.databricks.com/en/delta-sharing/create-recipient.html
- To download the access information file, which contains the endpoint and token — https://docs.databricks.com/en/delta-sharing/create-recipient.html
- To extend the token lifetime — https://docs.databricks.com/en/delta-sharing/create-recipient.html
Your first step is to create a new authentication with a set of credentials.
- Select Integrations Hub.
- Select Catalog.
3. Search for Delta Sharing in the Catalog; hover your mouse over the icon and select Create Authentication.
4. Ensure that the Credentials tab is selected and then enter credential information for the integration.

| Parameter | Description |
|---|---|
| Endpoint | Your API endpoint to the delta-sharing server |
| Bearer Token | Your token to access the delta-sharing server API |
- Select Continue.
- Enter a name for your authentication and select Done.
- Open TD Console.
- Navigate to Integrations Hub > Authentications.
- Locate your new authentication and select New Source.
The Create Source page displays with the Source Table tab selected.
- Enter a source name in the Data Transfer Name field.
- Enter the name of the authentication to use for the data transfer.
- Select Next.

The Create Source page displays with the Source Table tab selected.
- Edit the parameters

| Parameter | Required | Description |
|---|---|---|
| Share | Yes | Share name |
| Schema | Yes | Schema name |
| Table | Yes | Table name |
| Default Timezone | Yes | The default timezone for the timestamp format |
- Select Next.
The Create Source page displays with the Data Settings tab selected.
- Edit the parameters.

| Parameter | Required | Description |
|---|---|---|
| Retry Limit | No | The retry count for |
| Initial Retry Interval In Millis | No | Initial retry interval in milliseconds |
| Max Retry Wait In Millis | No | Max retry wait in milliseconds |
| HTTP Connect Timeout In Millis | No | The HTTP timeout in milliseconds |
| HTTP Read Timeout In Millis | No | The HTTP read timeout in milliseconds |
| HTTP Write Timeout In Millis | No | The HTTP write timeout in milliseconds |
- Select Next.
The Create Source page displays with the Data Preview tab selected.
You can see a preview of your data before running the import by selecting Generate Preview. Data preview is optional and you can safely skip to the next page of the dialog if you choose to.
- Select Next. The Data Preview page opens.
- If you want to preview your data, select Generate Preview.
- Verify the data.
For data placement, select the target database and table where you want your data placed and indicate how often the import should run.
Select Next. Under Storage, you will create a new or select an existing database and create a new or select an existing table for where you want to place the imported data.
Select a Database > Select an existing or Create New Database.
Optionally, type a database name.
Select a Table> Select an existing or Create New Table.
Optionally, type a table name.
Choose the method for importing the data.
- Append (default)-Data import results are appended to the table. If the table does not exist, it will be created.
- Always Replace-Replaces the entire content of an existing table with the result output of the query. If the table does not exist, a new table is created.
- Replace on New Data-Only replace the entire content of an existing table with the result output when there is new data.
Select the Timestamp-based Partition Key column. If you want to set a different partition key seed than the default key, you can specify the long or timestamp column as the partitioning time. As a default time column, it uses upload_time with the add_time filter.
Select the Timezone for your data storage.
Under Schedule, you can choose when and how often you want to run this query.
- Select Off.
- Select Scheduling Timezone.
- Select Create & Run Now.
- Select On.
- Select the Schedule. The UI provides these four options: @hourly, @daily and @monthly or custom cron.
- You can also select Delay Transfer and add a delay of execution time.
- Select Scheduling Timezone.
- Select Create & Run Now.
After your transfer has run, you can see the results of your transfer in Data Workbench > Databases.
You can import data from the Delta Sharing server by using the td_load>: operator of workflow. If you have already created a source, you can run it; if you don't want to create a source, you can import it using a .yml file.
- Identify your source.
- To obtain a unique ID, open the Source list and then filter by the Delta Sharing.
- Open the menu and select Copy Unique ID.
4. Define a workflow task using the td_load>: operator.
+load:
td_load>: unique_id_of_your_source
database: ${td.dest_db}
table: ${td.dest_table}- Run the workflow.
Parameters Reference
| Name | Description | Value | Default Value | Required |
|---|---|---|---|---|
| endpoint | Delta Sharing server endpoint | true | ||
| token | Bearer token to authenticate API interaction | true | ||
| share | The share name to connect | true | ||
| schema | The schema name to connect | true | ||
| table | The table name to connect | true | ||
| default_timezone | The default timezone for timestamp format | UTC | true | |
| retry_limit | The maximum retry times | 6 | false | |
| retry_initial_wait_msecs | The retry initial wait in milliseconds | 30000 | false | |
| max_retry_wait_msecs | The maximum retry wait in milliseconds | 120000 | false | |
| connection_timeout_msecs | The HTTP connection timeout in milliseconds | 1800000 | false | |
| write_timeout_msecs | The HTTP read connection timeout in milliseconds | 1800000 | false | |
| read_timeout_msecs | The HTTP write connection timeout in milliseconds | 1800000 | false |
Visit Treasure Boxes for sample workflow code.
Before setting up the integration, install the most current TD Toolbelt.
in:
type: delta_sharing
endpoint: http://endpoint.com
token: ***
schema: schema
table: table
share: share
retry_limit: 7
retry_initial_wait_msecs: 30000
max_retry_wait_msecs: 120000
connection_timeout_msecs: 1800000
write_timeout_msecs: 1800000
read_timeout_msecs: 1800000
out:
mode: appendParameters Reference
| Name | Description | Value | Default Value | Required |
|---|---|---|---|---|
| endpoint | Delta sharing endpoint | true | ||
| token | Bearer token to use to autenticate API interaction | true | ||
| share | The share name to connect | true | ||
| schema | The schema name to connect | true | ||
| table | The table name to connect | true | ||
| default_timezone | The default timezone for timestamp format Support both short and full zone ID | UTC | true | |
| retry_limit | The maximum retry times | 6 | false | |
| retry_initial_wait_msecs | The retry initial wait in milliseconds | 30000 | false | |
| max_retry_wait_msecs | The maximum retry wait in milliseconds | 120000 | false | |
| connection_timeout_msecs | The HTTP connection timeout in milliseconds | 1800000 | false | |
| write_timeout_msecs | The HTTP read connection timeout in milliseconds | 1800000 | false | |
| read_timeout_msecs | The HTTP write connection timeout in milliseconds | 1800000 | false |
The Delta Sharing integration imports all files that match the specified prefix.
Example
path_prefix: path/to/sample_ –> path/to/sample_201501.csv.gz, path/to/sample_201502.csv.gz, …, path/to/sample_201505.csv.gz
Use connector:guess. This command automatically reads the source files and uses logic to guess the file format and its fields and columns.
$ td connector:guess seed.yml -o load.ymlYou can open the load.yml to review the file format definitions including file formats, encodings, column names, and types.
Example
in:
type: delta_sharing
endpoint: http://endpoint.com
token: ***
schema: schema
table: table
share: share
retry_limit: 7
retry_initial_wait_msecs: 30000
max_retry_wait_msecs: 120000
connection_timeout_msecs: 1800000
write_timeout_msecs: 1800000
read_timeout_msecs: 1800000
out:
mode: appendTo preview the data, use the td connector:preview command.
$ td connector:preview load.yml
+-------+---------+----------+---------------------+
| id | company | customer | created_at |
+-------+---------+----------+---------------------+
| 11200 | AA Inc. | David | 2015-03-31 06:12:37 |
| 20313 | BB Imc. |Tom | 2015-04-01 01:00:07 |
| 32132 | CC Inc. | Fernando | 2015-04-01 10:33:41 |
| 40133 | DD Inc. | Cesar | 2015-04-02 05:12:32 |
| 93133 | EE Inc. | Jake | 2015-04-02 14:11:13 |
+-------+---------+----------+---------------------+The guess command requires more than 3 rows and 2 columns in the source data file because the command accesses the column definition using sample rows from the source data.
If the system detects your column name or column type unexpectedly, modify the load.yml file and preview again.
It might take a couple of hours ro run the job depending on the size of the data. Be sure to specify the Treasure Data database and table where the data should be stored.
Treasure Data also recommends specifying the --time-column option because Treasure Data’s storage is partitioned by time (see data partitioning). If this option is not provided, the data integration chooses the firstlong or timestamp column as the partitioning time. The type of the column specified by --time-column must be either of type long or type timestamp.
If your data doesn’t have a time column, you can add a time column by using the add_time filter option. For more details see add_time filter plugin.
$ td connector:issue load.yml --database td_sample_db --table td_sample_table \
--time-column created_atThe connector:issue command assumes that you have already created a database (*td_sample_db)*and a table (td_sample_table). If the database or the table does not exist in TD, this command fails. Create the database and table manually or use the --auto-create-table option with the td connector:issue command to auto-create the database and table.
$ td connector:issue load.yml --database td_sample_db --table td_sample_table
--time-column created_at --auto-create-tableThe data integration does not sort records on the server side. To use time-based partitioning effectively, sort records in files beforehand.
If you have a field called time, you don’t have to specify the --time-column option.
$ td connector:issue load.yml --database td_sample_db --table td_sample_tableYou can specify file import mode in the out: section of the load.yml file. The out: section controls how data is imported into a Treasure Data table. For example, you may choose to append data or replace data in an existing table in Treasure Data.
| Mode | Description | Examples |
|---|---|---|
| Append | Records are appended to the target table. | in: ... out: mode: append |
| AlwaysReplace | Replaces data in the target table.Any manual schema changes made to the target table remain intact. | in: ... out: mode: replace |
| Replace on new data | Replaces data in the target table only when there is new data to import. | in: ... out: mode: replace_on_new_data |
You can schedule periodic data integration execution.
Treasure Data configures the scheduler carefully to ensure high availability.
A new schedule can be created using the td connector:create command.
$ td connector:create daily_import "10 0 * * *" \
td_sample_db td_sample_table load.ymlTreasure Data also recommends that you specify the --time-column option, because Treasure Data’s storage is partitioned by time (see also data partitioning).
$ td connector:create daily_import "10 0 * * *" \
td_sample_db td_sample_table load.yml \
--time-column created_atThe cron parameter also accepts three special options: @hourly, @daily, and @monthly.
By default, the schedule is set up in the UTC timezone. You can set the schedule in a timezone using -t or --timezone option. The --timezone option supports only extended timezone formats like 'Asia/Tokyo', 'America/Los_Angeles', etc. Timezone abbreviations like PST, CST are not supported and might lead to unexpected schedules.