# \[V1-V2: deprecated] Table to Storage configuration file

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

* Global parameters: General information about the data operation.
* Table copy parameters: Optionally, you can add a creation step for a table that will contain the result of the extraction.

## :eye\_in\_speech\_bubble: Example

Here is an example of TTS configuration file:

```
{
  "configuration_type": "table-to-storage",
  "configuration_id": "tts-some-id-example",
  "short_description" : "Short description of the job",
  "environment": "DEV",
  "account": "000111",
  "activated": true,
  "archived": false,
  "gcs_dest_bucket": "152-composer-test",
  "gcs_dest_prefix": "jultest_table_to_storage/",
  "gcp_project": "fd-tailer-datalake",
  "field_delimiter": "|",
  "print_header": true,
  "sql_file": "jul_test.sql",
  "compression": "None",
  "output_filename": "{{FD_DATE}}_some_file_name.csv",
  "copy_table": false,
  "dest_gcp_project_id": "GCP Project ID used if copy_table is true",
  "dest_gbq_dataset": "GBQ Dataset used if copy_table is true",
  "dest_gbq_table": "GBQ Table name used if copy_table is true",
  "dest_gbq_table_suffix": "dag_execution_date",
  "delete_dest_bucket_content": true
}
```

## :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 TTS data operation, the value is always "table-to-storage".</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 "extract",</li><li>and a description of the data to extract.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                        |
| <p><strong>short\_description</strong></p><p>type: string</p><p>optional</p>             | Short description of the table to storage data operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <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 Tailer¯Studio.</p><p><em>Default value: false</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p><strong>gcs\_dest\_bucket</strong></p><p>type: string</p><p>mandatory</p>             | <p>Google Cloud Storage destination bucket.</p><p>This is the bucket where the data is going to be extracted.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <p><strong>gcs\_dest\_prefix</strong></p><p>type: string</p><p>mandatory</p>             | Path in the GCS bucket where the files will be extracted, e.g. "some/sub/dir".                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <p><strong>delete\_dest\_bucket\_content</strong></p><p>type: boolean</p><p>optional</p> | <p>If set to true, this parameter will trigger the preliminary deletion of any items present in the destination directory.</p><p>This can prevent an issue when a new run of the same operation is needed after a fix. If the first run had generated file-0.csv and file-1.csv, and then the 2nd run only returns and erases file-0.csv, then you need to delete the destination bucket at the begining of the 2nd run, or you will end up with a file-0.csv from the 2nd run and a file-1.csv from the first run.</p><p><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> If several table-to-storage operations write in the same directory at the same time, and if this parameter is true, then some extracted files can be deleted by mistake. The best practice is to have a dedicated subdirectory for each operation.</p><p><em>Default value: false</em></p> |
| <p><strong>gcp\_project</strong></p><p>type: string</p><p>mandatory</p>                  | ID of the Google Cloud project containing the BigQuery instance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| <p><strong>gcp\_project\_id</strong></p><p>type: string</p><p>optional</p>               | Enter the same value as gcp\_project to avoid the question of project selection during a deployment with tailer deploy configuration command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><strong>field\_delimiter</strong></p><p>type: string</p><p>optional</p>               | <p>Separator for fields in the CSV output file, e.g. ";".</p><p><strong>Note</strong>: For Tab separator, set to "\t".</p><p><em>Default value: "</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>print\_header</strong></p><p>type: boolean</p><p>optional</p>                 | <p>Print a header row in the exported data.</p><p><em>Default value: true</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><strong>sql\_file</strong></p><p>type: string</p><p>mandatory</p>                     | Path to the file containing the extraction query.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <p><strong>compression</strong></p><p>type: string</p><p>optional</p>                    | <p>Compression mode for the output file.</p><p>Possible values: "None", "GZIP"</p><p>Note that if you specify "GZIP", a ".gz" extension will be added at the end of the filename.<br><em>Default value: "None"</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| <p><strong>output\_filename</strong></p><p>type: string</p><p>mandatory</p>              | <p>Template for the output filename.</p><p>You can use the following placeholders inside the name:</p><ul><li>{{FD\_DATE}}: The date format will be YYYYMMDD</li><li>{{FD\_TIME}}: The time format will be hhmmss<br></li></ul><p><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> BigQuery splits the content in several numbered files if you export more than 1 GB of data. A number starting at 0 and left-padded to 12 digits is added before the extension and after a "-". To ensure a consistent behavior, this number is always added, even if you export less than 1 GB.<br><br>For example, an operation with the output\_filename <strong>"</strong>{{FD\_DATE}}-{{FD\_TIME}}\_my\_data\_extraction.csv" executed the 2022-01-01 on 06:32:16 will generate a file: 20220101-063216\_my\_data\_extraction-000000000000.csv</p>                             |
| <p><strong>destination\_format</strong></p><p>type: string</p><p>optional</p>            | <p>Define the format of the output file :</p><p>Possible values: "NEWLINE\_DELIMITED\_JSON" (JSON file), "AVRO"</p><p>Note that if you specify "NEWLINE\_DELIMITED\_JSON", the field-delimiter parameter is not taken into account.<br><em>Default value: "CSV"</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

## :two\_men\_holding\_hands: Table copy parameters

If you want to create a copy of your output data in a BigQuery table, you need to set the following parameters.

| Parameter                                                                                                                     | Description                                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>copy\_table</strong></p><p>type: boolean</p><p>optional</p>                                                        | <p>Parameter used to enable a copy of the output data in a BigQuery table.</p><p><em>Default value: false</em></p>                                                                 |
| <p><strong>dest\_gcp\_project\_id</strong></p><p>mandatory if <strong>copy\_table</strong> is set to "true"</p>               | ID of the GCP project that will contain the table copy.                                                                                                                            |
| <p><strong>dest\_gbq\_dataset</strong></p><p>mandatory if <strong>copy\_table</strong> is set to "true"</p>                   | Name of the BigQuery dataset that will contain the table copy.                                                                                                                     |
| <p><strong>dest\_gbq\_table</strong></p><p>mandatory if <strong>copy\_table</strong> is set to "true"</p>                     | Name of the BigQuery table copy.                                                                                                                                                   |
| <p><strong>dest\_gbq\_table\_suffix</strong></p><p>optional, to use only if <strong>copy\_table</strong> is set to "true"</p> | <p>The only supported value for this parameter is "dag\_execution\_date".</p><p>This will add "\_yyyymmdd" at the end of the table name to enable ingestion time partitioning.</p> |
