This article explains how to send job results directly to your Box account.
You can use this same connector to import Box files into Treasure Data. See Import from Box.
- Basic knowledge of Arm 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
Go to Treasure Data Connections. Search and select Box.
Click on Click here to connect to a new account.
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 will show:
Click 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 will 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.
Click Continue to go to the Details view.
Enter name for connection then click 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
Click Export Results.
Type the connection name in the search box to filter and select your Box connection.
Fill out 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 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.
- Empty string
- \N NULL
- 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 successful completion of the query, the query result is automatically imported to 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.