# Tables to Tables script file

The configuration file is in JSON format. It contains the following sections:

* Global parameters: General information about the data operation.
* Workflow task parameters: Information about the different tasks of the workflow.

## :video\_camera: Tables to Tables script video

Here is an example of a TTT configuration file:

```
{
	"configuration_type": "table-to-table",
	"configuration_id": "000099_iowa_liquor_agg_store",
	"short_description": "Create_aggregation",
	"doc_md": "000099_iowa_liquor_agg_store.md",
	"account": "000099",
	"environment": "DEV",
	"activated": true,
	"archived": false,
	"direct_execution": true,
	"start_date": "2019, 1, 1",
	"catchup": false,
	"schedule_interval": "0 8 * * *",
	"max_active_runs": 1,
	"task_concurrency": 3,
	"default_gcp_project_id": "fd-io-jarvis-demo-dlk",
	"default_bq_dataset": "dlk_demo_iowa_liquor_bda_cluster",
	"default_write_disposition": "WRITE_TRUNCATE",
	"task_dependencies": [
		"create_table >> run_query"
	],
	"workflow": [
        {
            "id": "create_table",
            "short_description": "Create an empty table with the proper name and descriptions.",
            "doc_md": "iowa_liquor_agg_store.md",
            "write_disposition": "WRITE_TRUNCATE",
            "task_type": "create_gbq_table",
            "force_delete": true,
            "bq_table": "iowa_liquor_agg_store_2019",
            "bq_dataset": "dlk_demo_iowa_liquor_bda_cluster",
            "ddl_file": "iowa_liquor_agg_store_DDL.json"
        },
        {
            "id": "run_query",
            "short_description": "Run the query and store the results in a table.",
			"doc_md": "iowa_liquor_agg_store.md",
            "write_disposition": "WRITE_APPEND",
            "task_type": "sql",
            "sql_file": "iowa_liquor_agg_store.sql",
            "table_name": "iowa_liquor_agg_store_2019",
            "bq_dataset": "dlk_demo_iowa_liquor_bda_cluster"
        }
	]
}

```

## :globe\_with\_meridians: Global parameters

General information about the data operation.

| Parameter                                                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong>configuration\_type</strong></p><p>type: string</p><p>mandatory</p>          | <p>Type of data operation.</p><p>For a TTT data operation, the value is always "table-to-table".</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p><strong>configuration\_id</strong></p><p>type: string</p><p>mandatory</p>            | <p>ID of the data operation.</p><p>You can pick any name you want, but is has to be <strong>unique</strong> for this data operation type.</p><p>Note that in case of conflict, the newly deployed data operation will overwrite the previous one. To guarantee its uniqueness, the best practice is to name your data operation by concatenating:</p><ul><li>your account ID,</li><li>the word "load",</li><li>and the target dataset or table.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <p><strong>short\_description</strong></p><p>type: string</p><p>optional</p>            | Short description of the context of the data operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| <p><strong>doc\_md</strong></p><p>type: string</p><p>optional</p>                       | Path to a file containing a detailed description of the data operation. The file must be in Markdown format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <p><strong>environment</strong></p><p>type: string</p><p>mandatory</p>                  | <p>Deployment context.</p><p>Values: PROD, PREPROD, STAGING, DEV.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| <p><strong>account</strong></p><p>type: string</p><p>mandatory</p>                      | Your account ID is a 6-digit number assigned to you by your Tailer Platform administrator.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>activated</strong></p><p>type: boolean</p><p>optional</p>                    | <p>Flag used to enable/disable the execution of the data operation.</p><p><em>Default value: true</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>archived</strong></p><p>type: boolean</p><p>optional</p>                     | <p>Flag used to enable/disable the visibility of the data operation's configuration and runs in Jarvis Studio.</p><p><em>Default value: false</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p><strong>start\_date</strong></p><p>type: string</p><p>mandatory</p>                  | <p>Start date of the data operation.</p><p>The format must be:</p><p>"YYYY, MM, DD"</p><p>Where:</p><ul><li>YYYY >= 1970</li><li>MM = \[1, 12]</li><li>DD = \[1, 31]</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <p><strong>schedule\_interval</strong></p><p>type: string</p><p>mandatory</p>           | <p>A Tables to Tables data operation can be launched in two different ways:</p><ul><li>If <strong>schedule\_interval</strong> is set to "None", the data operation will need to be started with a <a href="../../data-pipeline-operations/orchestrate-processings-with-workflow">Workflow</a>, when a given condition is met. (This solution is recommended.)</li><li>If you want the data operation to start at regular intervals, you can define this in the <strong>schedule\_interval</strong> parameter with a Cron expression.</li></ul><p><strong>Example</strong></p><p>For the data operation to start everyday at 7:00, you need to set it as follows:</p><p><code>"schedule\_interval": "0 7 \* \* \*",</code></p><p>You can find online tools to help you edit your Cron expression (for example,<a href="https://crontab.guru"> crontab.guru</a>).</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| <p><strong>max\_active\_runs</strong></p><p>type: integer</p><p>optional</p>            | <p>This parameter limits the number of concurrent runs for this data operation. As most data operations are run once daily, there is usually no need to set a value higher than 1 here.</p><p><em>Default value: 1</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><strong>task\_concurrency</strong></p><p>type: integer</p><p>optional</p>            | <p>This parameter limits the number of tasks that might run concurrently.</p><p>As a great volume of data might be handled by each task, it is important to make sure to avoid consuming too many resources for one data operation.</p><p>Make sure also that the value you set here is high enough for concurrent tasks set in the <strong>task\_dependencies</strong> parameter to run properly.</p><p><em>Default value: 5</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p><strong>catchup</strong></p><p>type: boolean</p><p>optional</p>                      | <p>This parameter allows you to specify if you want to execute the data operation runs that were supposed to happen between <strong>start\_date</strong> and the actual deployment date.</p><p><strong>Example</strong></p><p>If you start receiving data from September 1st, but you only finish writing your code on September 7th, you might want to run your data operation from a date in the past: September 1st.</p><p>The <strong>catchup</strong> parameter can have two values:</p><ul><li>If it is set to "true" AND a <strong>scheduling\_interval</strong> is set AND <strong>start\_date</strong> is set in the past, Composer/Airflow will execute every run of the data operation scheduled from the start date until the current date.</li><li>If it is set to "false", the data operation will only be executed starting from the current date.</li></ul><p><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> If the data operation is scheduled to happen frequently and/or the missed execution period is long, <strong>the amount of runs might be important.</strong> Make sure you have enough resources to handle all the executions when deploying a data operation with <strong>catchup</strong> set to "true".</p><p><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> If you plan to store a version of your configuration file for further modifications (in a Git repository for example), it's recommended to store it with a catchup set to "false" to avoid to accidentally create a lot of runs when you will deploy and execute your next version in the future.</p><p><em>Default value: false</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| <p><strong>task\_dependencies</strong></p><p>type: array of strings</p><p>mandatory</p> | <p>The <strong>task\_dependencies</strong> parameter allows you to create dependencies between the different tasks specified in the <strong>workflow</strong> parameter (see below). It will define in which order the workflow tasks will run, some of them running concurrently, others sequentially.</p><p>Usually workflow tasks will be run in the following order:</p><ol><li><strong>create\_gbq\_table</strong></li><li><strong>sql</strong></li><li><strong>copy\_gbq\_table</strong></li></ol><p><strong>Syntax</strong></p><ul><li>The double chevron <code>>></code> means that the first task needs to be completed before the next one can start.</li><li>The comma <code>,</code> means that the tasks will run concurrently.</li><li>The square brackets <code>\[</code> and <code>]</code> allow you to define a set of tasks that will run together.</li></ul><p>For detailed information about the syntax, refer to the <a href="https://airflow.apache.org/concepts.html#bitshift-composition">Airflow documentation</a>.</p><p><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> <strong>Criticality and tasks chaining:</strong> If a warning or a transparent task has a child linked critical task, the job is rejected to prevent inconsistent dependencies or criticalities. See "criticality" parameter below for more details.</p><p><span data-gb-custom-inline data-tag="emoji" data-code="2139">ℹ️</span> You can create <strong>conditional tasks</strong> that can break a dependency chain depending on predefined conditions without raising an error with the task parameter "criticality" set to "break". See "criticality" parameter below or <a href="https://community.tailer.ai/post/1818873840">this article</a> for more information.</p><p><strong>Example 1</strong></p><p>We have the following tasks that we want to run sequentially: taskA (create\_gbq\_table), taskB (sql) and taskC (copy\_gbq\_table).<br>The <strong>task\_dependencies</strong> parameter will be as follows: <code>"task\_dependencies": \[" taskA >> taskB >> taskC "],</code></p><p><strong>Example 2</strong></p><p>We have the following tasks that we want to run concurrently: taskA, taskB and taskC.</p><p>The <strong>task\_dependencies</strong> parameter will be as follows: <code>"task\_dependencies": \[" taskA, taskB, taskC "],</code><br></p><p><strong>Example 3</strong></p><p>We have the following 9 tasks we want to order: taskA, taskD, taskG (create\_gbq\_table), taskB, taskE, taskH (sql), taskC, taskF, taskI (copy\_gbq\_table).<br>The <strong>task\_dependencies</strong> parameter will be as follows:<code>"task\_dependencies": \[" \[taskA, taskD, taskG] >> \[taskB, taskE, taskH] >> \[taskC, taskF, taskI] "],</code></p><p><strong>Example 4</strong></p><p>In the example above, we want taskH to run before taskE so we can use its result for taskE.</p><p>The <strong>task\_dependencies</strong> parameter will be as follows:</p><p><code>"task\_dependencies": \[" \[taskA, taskD, taskG] >> taskH >> \[taskB, taskE] >> \[taskC, taskF, taskI] "],</code></p> |
| <p><strong>workflow</strong></p><p>type: array of maps</p><p>mandatory</p>              | <p>List of tasks the data operations will execute.</p><p>Check the section below for detailed information on their parameters.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><strong>default\_gcp\_project\_id</strong></p><p>type: string</p><p>mandatory</p>    | <p>Default GCP Project ID.</p><p>This parameter can be set for each workflow task sub-object, and will be overridden by that value if it is different.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>default\_bq\_dataset</strong></p><p>type: string</p><p>mandatory</p>         | <p>Default BigQuery dataset ID.</p><p>This parameter can be set for each workflow task sub-object, and will be overridden by that value if it is different.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| <p><strong>default\_write\_disposition</strong></p><p>type: string</p><p>mandatory</p>  | <p>Action that occurs if the destination table already exists (see <a href="https://googleapis.github.io/google-cloud-python/latest/bigquery/generated/google.cloud.bigquery.job.WriteDisposition.html#google.cloud.bigquery.job.WriteDisposition">Google BigQuery documentation</a>).</p><p>Possible values:</p><ul><li>"WRITE\_TRUNCATE" (default): The run will write table data from the beginning. If the table already contained lines, they will all be deleted and replaced by the new lines. This option is used most of the time for daily runs to avoid duplicates.</li><li>"WRITE\_APPEND": The run will append new lines to the table. When using this option, make sure not to run the data operation several times.</li><li>"WRITE\_EMPTY": This option only allows adding data to an empty table. If the table already contains data, it returns an error. It is hardly ever used as data operations are usually run periodically, so they will always contain data after the first run.</li></ul><p>This parameter can be set for each workflow task sub-object, and will be overridden by that value if it is different.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <p><strong>direct\_execution</strong></p><p>type: boolean</p><p>optional</p>            | <p>Tailer's execution engine has been rewritten to switch from Airflow/Composer to a Kubernetes severless architecture, improving its speed, stability, security and scalability.</p><p>To use the new execution mode, the <strong>direct\_execution</strong> parameter must be set to "true".</p><p><em>Default value: true</em> <em>(from January 5, 2021)</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

## :loop: Workflow task parameters

A Tables to Tables workflow can include for types of tasks:

* **create\_gbq\_table**: This type of task allows you to create the skeleton of a table based on a DDL file. You could compare it to the baking pan of your table.
* **sql**: This type of task allows you to fill that baking pan using a SQL query or a SQL script from a file.
* **copy\_gbq\_table**: This type of task allows you to duplicate a table named X into another table named Y.
* **expectation:** This type of task allows you to perform data quality tests. See [expectations](https://docs.tailer.ai/data-pipeline-operations/expectations) for more details.

For each workflow sub-object, parameters will differ depending on the task type.

{% hint style="info" %}
Refer to [this page](https://docs.tailer.ai/data-pipeline-operations/transform-data-with-tables-to-tables/table-to-table-sql-and-ddl-files) to know how to create the DDL and SQL files corresponding to these tasks.
{% endhint %}

### **SQL task parameters**

| Parameter                                                                                                                          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>task\_type</strong></p><p>type: string</p><p>mandatory</p>                                                              | <p>The value has to be set to "sql" for this task type.</p><p>As "sql" is the default type, this parameter can be omitted for this task type.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><strong>id</strong></p><p>type: string</p><p>mandatory</p>                                                                      | ID of the task. It must be unique within the data operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| <p><strong>short\_description</strong></p><p>type: string</p><p>optional</p>                                                       | Short description of what the task does.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p><strong>doc\_md</strong></p><p>type: string</p><p>optional</p>                                                                  | Path to a file containing a detailed description of the task. The file must be in Markdown format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <p><strong>sql\_file</strong></p><p>type: string</p><p>mandatory</p>                                                               | Path to the file containing the actual SQL query or the SQL script (can be assertions or [expectations](https://docs.tailer.ai/data-pipeline-operations/expectations)). This file is going to be read and its content uploaded to Firestore upon deployment of the data operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <p><strong>gcp\_project\_id</strong></p><p>type: string</p><p>optional</p>                                                         | <p>GCP Project ID.</p><p>Overrides <strong>default\_gcp\_project\_id</strong>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <p><strong>bq\_dataset</strong></p><p>type: string</p><p>optional</p>                                                              | <p>Name of the BigQuery destination dataset.</p><p>Overrides <strong>default\_bq\_dataset</strong>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| <p><strong>write\_disposition</strong></p><p>type: string</p><p>optional</p>                                                       | <p>Action that occurs if the destination table already exists (see <a href="https://googleapis.github.io/google-cloud-python/latest/bigquery/generated/google.cloud.bigquery.job.WriteDisposition.html#google.cloud.bigquery.job.WriteDisposition">Google BigQuery documentation</a>).<br>Possible values:</p><ul><li>"<strong>WRITE\_TRUNCATE</strong>" (default): The run will write table data from the beginning. If the table already contained lines, they will all be deleted and replaced by the new lines. This option is used most of the time for daily runs to avoid duplicates.</li><li>"<strong>WRITE\_APPEND</strong>": The run will append new lines to the table. When using this option, make sure not to run the data operation several times.</li><li>"<strong>WRITE\_EMPTY</strong>": This option only allows adding data to an empty table. If the table already contains data, it returns an error. It is hardly ever used as data operations are usually run periodically, so they will always contain data after the first run.</li></ul><p>Overrides <strong>default\_write\_disposition</strong>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <p><strong>table\_name</strong></p><p>type: string</p><p>mandatory if the SQL file contains a query, optional for a SQL script</p> | <p>Target table used upon SQL query execution.<br>This parameter is optional if the SQL file contains a script, i.e. one or more statements separated by a <code>;</code> (for ex. assertions or <a href="../../data-pipeline-operations/expectations">expectations</a>). Otherwise, this parameter is <strong>mandatory</strong>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><strong>criticality</strong></p><p>type: string</p><p>optional</p>                                                              | <p>Task criticality which defines the impact of an error on this task on the data operation global status and behavior. It allows to create tasks dedicated to warning tests (see <a href="../../data-pipeline-operations/expectations">expectations</a>) that won't break the execution if it fails or conditional tasks that can lead to different tasks depending on predefined conditions (see <a href="https://community.tailer.ai/post/1818873840">this article</a>).</p><p><br>Criticality can be:</p><ul><li><strong>critical</strong>: if a critical task fails, the <strong>run stops</strong> and have the global <strong>status "failed".</strong></li><li><strong>warning</strong>: if a warning task fails, the <strong>run proceeds</strong> to the next task, <strong>executing the following dependent task</strong> if any, and the global status of the run will be "<strong>warning</strong>" (if no critical task fails afterward). The workflow manager regards warning as success, so any <strong>job chained</strong> by a workflow configuration <strong>will be triggered</strong>.</li><li><strong>transparent</strong>: if a transparent task fails, the <strong>run proceeds</strong> to the next task, <strong>executing the following dependent task</strong> if any, and the global status of the run will be "<strong>success</strong>" (if no critical or warning task fails). Any <strong>job chained</strong> by a workflow configuration <strong>will be triggered</strong>.</li><li><strong>break</strong>: if a break task fails, the <strong>run skips</strong> all the <strong>dependent tasks</strong> and <strong>proceeds to the independent tasks</strong> if any<strong>.</strong> The global status of the run will be "<strong>success</strong>" (if no critical or warning task fails). Any <strong>job chained</strong> by a workflow configuration <strong>will be triggered</strong>. You can use this criticality to create conditional tasks that lead to different tasks depending on predefined conditions. See <a href="https://community.tailer.ai/post/1818873840">this article</a> for more information.</li></ul><p><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> <strong>Tasks chaining:</strong> We enforce rules at the validation of the configuration (at deployment time) to prevent inconsistent dependencies or criticalities in a chain of tasks. If a warning or a transparent task has a child linked critical task, the job is rejected. Indeed, if you have 3 tasks <code>A: critical >> B: warning >> C: critical</code>, then you have either an inconsistent dependency (B is not necessary for the task C and therefore should be parallelized with C) or an inconsistent criticality (B is necessary for the critical task C and therefore should be critical itself).<br></p><p><em>Default value: "critical"</em></p> |
| <p><strong>temporary\_table</strong></p><p>type: boolean</p><p>optional</p>                                                        | <p>If set to "true", this parameter will force the deletion of the table at the end of the data operation. If the TTT data operation failed before deleting the temporary table, the table will be deleted automatically after 24 hours.<br></p><p><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span>Please note that if this flag is set to "true", then the target table is preliminarily deleted if it exists. Description, partitionning and clustering are lost.</p><p><em>Default value: false</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <p><strong>sql\_query\_template</strong></p><p>type: string</p><p>optional</p>                                                     | <p>If you want to use variables in your SQL query or script, you need to set this parameter to "TEMPLATE\_CURRENT\_DATE" (only supported value). This variable will be set to the execution date of the data operation (and not today's date).</p><p>For example, if you want to retrieve data corresponding to the execution date, you can use the following instruction:</p><p><code>WHERE sale\_date = DATE('</code>{{TEMPLATE\_CURRENT\_DATE}}<code>')</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### **Table Creation task parameters**

| **Parameter**                                                                | Description                                                                                                                                                                                                                                                                                                        |
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong>task\_type</strong></p><p>type: string</p><p>mandatory</p>        | In this case, the value has to be set to "create\_gbq\_table".                                                                                                                                                                                                                                                     |
| <p><strong>id</strong></p><p>type: string</p><p>mandatory</p>                | ID of the task. It must be unique within the data operation.                                                                                                                                                                                                                                                       |
| <p><strong>short\_description</strong></p><p>type: string</p><p>optional</p> | Short description of what the task does.                                                                                                                                                                                                                                                                           |
| <p><strong>doc\_md</strong></p><p>type: string</p><p>optional</p>            | Path to a file containing a detailed description of the task. The file must be in Markdown format.                                                                                                                                                                                                                 |
| <p><strong>gcp\_project\_id</strong></p><p>type: string</p><p>optional</p>   | <p>GCP Project ID.</p><p>Overrides <strong>default\_gcp\_project\_id</strong>.</p>                                                                                                                                                                                                                                 |
| <p><strong>bq\_dataset</strong></p><p>type: string</p><p>optional</p>        | <p>Name of the BigQuery destination dataset.</p><p>Overrides <strong>default\_bq\_dataset</strong>.</p>                                                                                                                                                                                                            |
| <p><strong>bq\_table</strong></p><p>type: string</p><p>mandatory</p>         | Name of the BigQuery table name.                                                                                                                                                                                                                                                                                   |
| <p><strong>ddl\_file</strong></p><p>type: string</p><p>mandatory</p>         | Path to the JSON file containing DDL information to create the table.                                                                                                                                                                                                                                              |
| <p><strong>force\_delete</strong></p><p>type: boolean</p><p>optional</p>     | If set to "true", this parameter will force the deletion of the table prior to its creation.                                                                                                                                                                                                                       |
| <p><strong>criticality</strong></p><p>type: string</p><p>optional</p>        | <p>Task criticality which defines the impact of an error on this task on the data operation global status and behavior.</p><p>Criticality can be: critical, warning, transparent or break.</p><p>See "criticality" description in the SQL task above for more details</p><p><em>Default value: "critical"</em></p> |

### **Table copy task parameters**

| **Parameter**                                                                                                                                                                   | Description                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong>task\_type</strong></p><p>type: string</p><p>mandatory</p>                                                                                                           | In this case, the value has to be set to "copy\_gbq\_table".                                                                                                                                                                                                                                                       |
| <p><strong>id</strong></p><p>type: string</p><p>mandatory</p>                                                                                                                   | ID of the task. It must be unique within the data operation.                                                                                                                                                                                                                                                       |
| <p><strong>short\_description</strong></p><p>type: string</p><p>optional</p>                                                                                                    | Short description of what the task does.                                                                                                                                                                                                                                                                           |
| <p><strong>doc\_md</strong></p><p>type: string</p><p>optional</p>                                                                                                               | Path to a file containing a detailed description. The file must be in Markdown format.                                                                                                                                                                                                                             |
| <p><strong>source\_gcp\_project\_id</strong></p><p>type: string</p><p>mandatory</p>                                                                                             | GCP project ID for the source BigQuery table.                                                                                                                                                                                                                                                                      |
| <p><strong>source\_bq\_dataset</strong></p><p>type: string</p><p>mandatory</p>                                                                                                  | BigQuery dataset for the source table.                                                                                                                                                                                                                                                                             |
| <p><strong>source\_bq\_table</strong></p><p>type: string</p><p>mandatory</p>                                                                                                    | Name of the source table.                                                                                                                                                                                                                                                                                          |
| <p><strong>gcp\_project\_id</strong></p><p>type: string</p><p>optional</p>                                                                                                      | <p>GCP project ID for the destination BigQuery table.</p><p>Overrides <strong>default\_gcp\_project\_id</strong>.</p>                                                                                                                                                                                              |
| <p><strong>bq\_dataset</strong></p><p>type: string</p><p>optional</p>                                                                                                           | <p>Name of the BigQuery destination dataset.</p><p>Overrides <strong>default\_bq\_dataset</strong>.</p>                                                                                                                                                                                                            |
| <p><strong>destination\_bq\_table</strong></p><p>type: string</p><p>mandatory</p>                                                                                               | Name of the BigQuery destination table.                                                                                                                                                                                                                                                                            |
| <p><strong>destination\_bq\_table\_date\_suffix</strong></p><p>type: boolean</p><p>mandatory</p>                                                                                | Enables/Disables the date suffix to allow date partitioning in BigQuery.                                                                                                                                                                                                                                           |
| <p><strong>destination\_bq\_table\_date\_suffix\_format</strong></p><p>type: string</p><p>mandatory if <strong>destination\_bq\_table\_date\_suffix</strong> is set to true</p> | <p>Date format for the table suffix.</p><p><br>As of now, the only possible value is "%Y%m%d".</p>                                                                                                                                                                                                                 |
| <p><strong>criticality</strong></p><p>type: string</p><p>optional</p>                                                                                                           | <p>Task criticality which defines the impact of an error on this task on the data operation global status and behavior.</p><p>Criticality can be: critical, warning, transparent or break.</p><p>See "criticality" description in the SQL task above for more details</p><p><em>Default value: "critical"</em></p> |
