td_run> operator runs a query saved on Treasure Data.
_export:
td:
database: www_access
+step1:
td_run>: 12345
+step2:
td_run>: myquery2
session_time: 2016-01-01T01:01:01+00:00When you don't know how to set secrets, please refer to Managing Workflow Secret
- td.apikey: API_KEY The Treasure Data API key to use when running Treasure Data queries.
td_run>: SAVED_QUERY_ID or SAVED_QUERY_NAME
Runs saved query. If number was specified, it's considered as an ID of saved query. Otherwise it's considered as a name of a saved query.
Examples:
td_run>: 12345Examples:
td_run>: my_querydownload_file: NAME
Saves query result as a local CSV file.
Examples:
download_file: output.csvstore_last_results: BOOLEAN
Stores the first 1 row of the query results to
${td.last_results}variable (default: false). td.last_results is a map of column name and a value. To access to a single value, you can use${td.last\_results.my\_count}syntax.Examples:
store_last_results: truepreview: BOOLEAN
Tries to show some query results to confirm the results of a query.
Examples:
preview: trueendpoint: ADDRESS
API endpoint (default: api.treasuredata.com).
use_ssl: BOOLEAN
Enable SSL (https) to access to the endpoint (default: true).
td.last_job_id or td.last_job.id
The job id this task executed.
Examples:
52036074td.last_results
The first 1 row of the query results as a map. This is available only when
store_last_results: trueis set.Examples:
{"path":"/index.html","count":1}td.last_job.num_records
The number of records of this job output.
Examples:
10