Export Treasure Data job results directly to your Box account.
Continue to the following topics:
Basic knowledge of Treasure Data
Box cloud storage account
Use the TD Console to Create Your Connection
You can use the Treasure Data Console to configure your connection.
Setting Up a Connection with Box Account
Open the TD Console.
Navigate to the Integrations Hub > Catalog.
- Click the search icon on the far-right of the Catalog screen, and enter Box.
- Hover over the Box connector and select Create Authentication.
Enter your OAuth token or select Click here to authorize the connection with Box.
You are redirected to Box to login if you haven't logged in yet, or to the consent page to grant access to Treasure Data from your Box account.
For the domain https://console.treasuredata.com, it shows:
Select Grant access to Box and you are redirected back to the Treasure Data Connection screen.
Choose the Box connector again, go to the OAuth connection field. You see an OAuth connection with your account name in the dropdown list.
Choose the account you want to use and proceed to create the connection.
Select Continue to go to the Details view.
Enter a name for the connection then select Done to finish.
OAuth (and the only authentication) is only supported in treasuredata.com and its subdomains.
Configure Output Results to the Data Connection
In this step, you create or reuse a query. In the query, you configure the data connection.
Go to the Treasure Data Console query editor page.
Access the query that you plan to use to export data.
Compile the query, if you need to.
Specify the Result Export Target
Select Export Results.
Type the connection name in the search box to filter and select your Box connection.
Edit all the information.
Specify the parameters:
Export To (Required) Available options:
Existing File. When selected, you must specify the File ID.
New File. When selected, you must specify the File Name and Folder ID.
File Name The exported file name without extension. For example,
Folder ID The Box Folder where exported file is to be stored.
File ID Existing Box File ID.
Format Specify the result file format: CSV or TSV
Compression Indicate whether the result is to be compressed or not. Available options: None, gz, and bzip2
Header line If selected, the exported data will have the column name as the header line.
Null String Use this value to represent NULL values. Available options:
Default. If selected, an empty string '' is used to represent the Null value for file format CSV, and \N is used for the TSV format.
End-of-line character The character at the end of lines. Available options are CRLF, LF, and CR
Quote Policy Available options:
ALL. If selected, all values are enclosed by double quotes ("").
MINIMAL. If selected, any value that contains an embedded quote (") is presented with a consecutive pair of quotes (""). The MINIMAL quote policy is applied to CSV
NONE. If selected, no escape for embedded quote is applied. By default, NONE is applied to TSV file format
Max Retries When an error occurs due to a Box server error or network error, the number of retries attempted before aborting the upload.
Retry Timeout The upper limit time for a retry, measured in seconds.
Execute the Query
Save the query with a name and run, or just run the query.
After the query has run successfully, the query result is automatically imported into the specified Container destination.
Frequently Asked Questions
Why did I get \ (backslash) characters in the final result?
When the data (value) contains a quote (") in a CSV file or a Tab in a TSV file and when the Quote Policy is set to NONE, then the character might incorrectly escape the data and cause the problem. To resolve this, try to set the Quote Policy to MINIMAL or ALL.