# Storage to Tables configuration file

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

* Global parameters: General information about the data operation.
* Source parameters: Information related to the data source provider.
* Destination parameters: Information about input file templates and destination tables. The "destinations" section will refer to [DDL files](/data-pipeline-operations/load-data-with-storage-to-tables/storage-to-tables-ddl-files.md), which contain the schema of the destination tables.

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

Here is an example of STT configuration file for a GCS to BigQuery transfer:

```sql
{
  "$schema": "http://jsonschema.tailer.ai/schema/storage-to-tables-veditor",
  "configuration_type": "storage-to-tables",
  "configuration_id": "Load_sales_files_from_it",
  "version": "2",
  "environment": "DEV",
  "account": "000099",
  "activated": true,
  "archived": false,
  "max_active_runs" : 5,
  "short_description": "This Job load sales files into the Persistent Staging Area",
  "doc_md": "Load_sales_files_from_it.md",
  "source": {
    "type": "gcs",
    "gcp_project_id": "dlk_demo",
    "gcs_source_bucket": "mirror-fd-io-exc-demo-wbd--n-in",
    "gcs_source_prefix": "testjul",
    "gcs_archive_prefix": "archive",
    "gcp_credentials_secret": {
      "cipher_aes": "223xxx",
      "tag": "8ddxxx",
      "ciphertext": "4c7xxx",
      "enc_session_key": "830xxx"
    }
  },
  "destinations": [
    {
      "type": "bigquery",
      "gcp_project_id": "my-project",
      "gbq_dataset": "dlk_demo_wbd_psa",
      "source_format": "CSV",
      "create_disposition": "CREATE_IF_NEEDED",
      "write_disposition": "WRITE_TRUNCATE",
      "bq_load_job_ignore_unknown_values": true,
      "skip_leading_rows": 1,
      "field_delimiter": "|",
      "add_tailer_metadata": true,
      "gcp_credentials_secret": {
        "cipher_aes": "223xxx",
        "tag": "8ddxxx",
        "ciphertext": "4c7xxx",
        "enc_session_key": "830xxx"
      },
      "tables": [
        {
          "table_name": "sales_details_test",
          "short_description": "Daily sales with tickets and tickets lines",
          "filename_template": "input_{{FD_DATE}}-{{FD_TIME}}-sales_details.csv",
          "ddl_mode": "file",
          "ddl_file": "ddl/sales_details.json",
          "doc_md": "ddl/sales_details.md",
          "add_tailer_metadata": true,
          "skip_leading_rows": 0,
          "write_disposition": "WRITE_APPEND"
        },
        {
          "table_name": "stores",
          "short_description": "Full Stores referential",
          "filename_template": "input_{{FD_DATE}}-{{FD_TIME}}-stores.csv",
          "ddl_mode": "file",
          "ddl_file": "ddl/stores.json",
          "doc_md": "ddl/stores.md",
          "add_tailer_metadata": false
        }
      ]
    }
  ]
}
```

## :globe\_with\_meridians: Global parameters

General information about the data operation

| Parameter                                                                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>$schema</strong></p><p>type: string</p><p>optional</p>              | The url of the json-schema that contains the properties that your configuration must verify. Most Code Editor can use that to validate your configuration, display help boxes and enlighten issues.                                                                                                                                                                                                                                                            |
| <p><strong>configuration\_type</strong></p><p>type: string</p><p>mandatory</p> | <p>Type of data operation.<br><br>For an STT data operation, the value is always "storage-to-tables".</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 source bucket name,</li><li>and the source directory name.</li></ul> |
| <p><strong>version</strong><br>type: string<br>mandatory</p>                   | Use only version 2, version 1 is depreciated.                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><strong>environment</strong></p><p>type: string</p><p>mandatory</p>         | <p>Deployment context.<br><br>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.<br><br>If not specified, the default value will be "true".</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.<br><br>If not specified, the default value will be "false".</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.</p><p>If not set, the default value is 50.</p>                                                                                                                                                                                                                                                                                                                                 |
| <p><strong>short\_description</strong></p><p>type: string</p><p>optional</p>   | Short description of the context of the configuration.                                                                                                                                                                                                                                                                                                                                                                                                         |
| <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.                                                                                                                                                                                                                                                                                                                                                                         |

## :arrow\_down: Source parameters (GCS)

The destination section contains all information related to the data source provider.

```json
"source": {
  "type": "gcs",
  "gcp_project_id": "my-project",
  "gcs_source_bucket": "mirror-fd-io-exc-demo-wbd--n-in",
  "gcs_source_prefix": "testjul",
  "gcs_archive_prefix": "archive",
  "gcp_credentials_secret": {
    "cipher_aes": "223xxx",
    "tag": "8ddxxx",
    "ciphertext": "4c7xxx",
    "enc_session_key": "830xxx"
  }
}
```

| Parameter                                                                         | Description                                                                                                                                                                                                                                                                          |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong>type</strong></p><p>type: string</p><p>mandatory</p>                   | <p>Source type.</p><p>The only supported source type for now is "gcs".</p>                                                                                                                                                                                                           |
| <p><strong>gcp\_project\_id</strong></p><p>type: string</p><p>mandatory</p>       | <p>Specify the Google Cloud Platform project where to deploy the data operation and its associated cloud functions.</p><p>If not set, the user will be prompted to choose a project.</p>                                                                                             |
| <p><strong>gcs\_source\_bucket</strong></p><p>type: string</p><p>mandatory</p>    | <p>Name of the source bucket.<br><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> <em>See restrictions below</em></p>                                                                                                                                         |
| <p><strong>gcs\_source\_prefix</strong></p><p>type: string</p><p>mandatory</p>    | <p>Path where the files will be found, e.g. "some/sub/dir".<br><span data-gb-custom-inline data-tag="emoji" data-code="26a0">⚠️</span> <em>See restrictions below</em></p>                                                                                                           |
| <p><strong>gcs\_archive\_prefix</strong></p><p>type: string optional</p>          | <p>Path where the source files will be archived.</p><p>If present and populated, the STT data operation will archive the source files in the location specified, in the GCS source bucket.</p><p>If not present or empty, there will be no archiving.</p>                            |
| <p><strong>gcp\_credentials\_secret</strong></p><p>type: dict</p><p>mandatory</p> | <p>Encrypted credentials needed to read/move data from the source bucket.</p><p>You should have generated credentials when <a href="/pages/-MIJnfukb8Zjy8ZEqyoD">setting up GCP</a>. To learn how to encrypt them, refer to <a href="/pages/-MIJrDwu5SlcqIcRpywz">this page</a>.</p> |

## :arrow\_up: Destination parameters (BigQuery)

The destination section contains all the information related to the data destinations.

The **destinations** parameter is an array containing maps. Each map can contain a type of destination and many actual "tables" as ultimate destination.

Example:

```json
"destinations": [
{
  "type": "bigquery",
  "gcp_project_id": "my-project",
  "gbq_dataset": "dlk_demo_wbd_psa",
  "source_format": "CSV",
  "create_disposition": "CREATE_IF_NEEDED",
  "write_disposition": "WRITE_TRUNCATE",
  "skip_leading_rows": 1,
  "field_delimiter": "|",
  "add_tailer_metadata": true,
  "gcp_credentials_secret": {
    "cipher_aes": "223008256918c292ff3ec1axxx",
    "tag": "8dd3db4c71bfb963d475d1bbd1xxx",
    "ciphertext": "4c74df268d5a7541f8264c2e7a282fxxx",
    "enc_session_key": "830606cbc4f9401a29c7977d364398xxx"
    },
      "tables": [
      {
        "table_name": "sales_details_test",
        "short_description": "Daily detailed Sales with tickets and tickets lines",
        "filename_template": "input_{{FD_DATE}}-{{FD_TIME}}-ORS-ventes.csv",
        "ddl_mode": "file",
        "ddl_file": "ddl/sales_details.json",
        "doc_md": "ddl/sales_details.md",
        "add_tailer_metadata": true,
        "skip_leading_rows": 0,
        "write_disposition": "WRITE_APPEND"
      },
      {
        "table_name": "stores",
        "short_description": "Full Stores referential",
        "filename_template": "input_{{FD_DATE}}-{{FD_TIME}}-ORS-magasins.csv",
        "ddl_mode": "file",
        "ddl_file": "ddl/stores.json",
        "doc_md": "ddl/stores.md",
        "add_tailer_metadata": false
      }
    ]
  }
]
```

### Global destination parameters

| Parameter                                                                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>type</strong></p><p>type: string</p><p>mandatory</p>                                   | <p>Type of destination.</p><p>The only supported destination type for now is "bigquery".</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| <p><strong>gcp\_project\_id</strong></p><p>type: string</p><p>optional</p>                        | <p>Default GCP Project ID.</p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| <p><strong>gbq\_dataset</strong></p><p>type: string</p><p>optional</p>                            | <p>Default BigQuery Dataset.</p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <p><strong>gcp\_credentials\_secret</strong></p><p>type: object</p><p>optional</p>                | <p>Encrypted credentials needed to interact with Storage and BigQuery.</p><p>You should have generated credentials when <a href="/pages/-MIJnfukb8Zjy8ZEqyoD">setting up GCP</a>. To learn how to encrypt them, refer to <a href="/pages/-MIJrDwu5SlcqIcRpywz">this page</a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| <p><strong>source\_format</strong></p><p>type: string</p><p>optional</p>                          | <p>Default source format for input files.</p><p>Possible values (case sensitive):</p><ul><li>"CSV" (default)</li><li>"JSON"</li><li>"PARQUET" (see <a href="https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-parquet">BigQuery doc</a> for more info)</li><li>"AVRO" (see <a href="https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-avro">BigQuery doc</a> for more info)</li></ul><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| <p><strong>create\_disposition</strong></p><p>type: string</p><p>optional</p>                     | <p>Specifies behavior for creating tables (see <a href="https://googleapis.github.io/google-cloud-python/latest/bigquery/generated/google.cloud.bigquery.job.CreateDisposition.html#google.cloud.bigquery.job.CreateDisposition">Google BigQuery documentation</a>).</p><p>Possible values:</p><ul><li>"CREATE\_IF\_NEEDED" (default): If the table does not exist, BigQuery creates the table.</li><li>"CREATE\_NEVER": The table must already exist.</li></ul><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.</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>).</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.<br><br>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.</li></ul> |
| <p><strong>skip\_leading\_rows</strong></p><p>type: integer</p><p>optional</p>                    | <p>Number of rows to skip when reading data, CSV only.<br></p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.<br><br><em>Default value: 1</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| <p><strong>field\_delimiter</strong></p><p>type: string</p><p>optional</p>                        | <p>Separator for fields in a CSV file, e.g. ";".</p><p><strong>Note</strong>: For Tab separator, set to "\t".<br><br>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.<br><br><em>Default value:</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>quote\_character</strong></p><p>type: string</p><p>optional</p>                        | <p>Character used to quote data sections, CSV only (see <a href="https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.job.LoadJobConfig.html#google.cloud.bigquery.job.LoadJobConfig.quote_character">Google BigQuery documentation</a>).</p><p><strong>Note:</strong> For quote and double quotes, set to "'" and """ respectively.<br></p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.<br><br><em>Default value: ""</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| <p><strong>null\_marker</strong></p><p>type: string</p><p>optional</p>                            | <p>Represents a null value, CSV only (see <a href="https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.job.LoadJobConfig.html#google.cloud.bigquery.job.LoadJobConfig.null_marker">Google BigQuery documentation</a>).<br></p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.<br><br><em>Default value: ""</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| <p><strong>bq\_load\_job\_ignore\_unknown\_values</strong></p><p>type: boolean</p><p>optional</p> | <p>Ignore extra values not represented in the table schema (see <a href="https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.job.LoadJobConfig.html#google.cloud.bigquery.job.LoadJobConfig.ignore_unknown_values">Google BigQuery documentation</a>).<br></p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.<br><br><em>Default value: false</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p><strong>bq\_load\_job\_max\_bad\_records</strong></p><p>type: integer</p><p>optional</p>       | <p>Number of invalid rows to ignore (see <a href="https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.job.LoadJobConfig.html#google.cloud.bigquery.job.LoadJobConfig.max_bad_records">Google BigQuery documentation</a>).<br></p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.<br><br><em>Default value: 0</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| <p><strong>bq\_load\_job\_schema\_update\_options</strong></p><p>type: array</p><p>optional</p>   | <p>Specifies updates to the destination table schema to allow as a side effect of the load job (see <a href="https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.job.LoadJobConfig.html#google.cloud.bigquery.job.LoadJobConfig.max_bad_records">Google BigQuery documentation</a>).<br></p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.<br><br><em>Default value: \[]</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><strong>bq\_load\_job\_allow\_quoted\_newlines</strong></p><p>type: boolean</p><p>optional</p> | <p>Allows quoted data containing newline characters, CSV only (see <a href="https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.job.LoadJobConfig.html#google.cloud.bigquery.job.LoadJobConfig.max_bad_records">Google BigQuery documentation</a>).<br></p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.<br><br><em>Default value: false</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| <p><strong>bq\_load\_job\_allow\_jagged\_rows</strong></p><p>type : boolean</p><p>optional</p>    | <p>Allows missing trailing optional columns, CSV only (see <a href="https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.job.LoadJobConfig.html#google.cloud.bigquery.job.LoadJobConfig.max_bad_records">Google BigQuery documentation</a>).<br></p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.<br><br><em>Default value: false</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><strong>add\_tailer\_metadata</strong></p><p>type : boolean</p><p>optional</p>                 | <p><strong>\[NEW]</strong><br><br>Allows automatic metadata feature that add specific columns during the ingestion process related to the input source.</p><p>The added columns are:<br><br><code>tlr\_ingestion\_timestamp\_utc</code><br><code>(TIMESTAMP) tlr\_input\_file\_source\_type</code><br><code>(STRING)</code><br><code>tlr\_input\_file\_name</code><br><code>(STRING) tlr\_input\_file\_full\_resource\_name</code><br><code>(STRING)</code><br></p><p>This parameter can be set for each <strong>table</strong> sub-object, and will be overridden by that value if it is different.</p><p><br><em>Default value : false</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

### **Table sub-object parameters**

The "table" object contains the definition of expected input files and their BigQuery target.

| **Parameter**                                                                                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong>table\_name</strong></p><p>type: string</p><p>mandatory</p>                                              | Name of the destination BigQuery table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><strong>short\_description</strong></p><p>type: string</p><p>optional</p>                                        | Short description of the destination BigQuery table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>filename\_template</strong></p><p>type: string</p><p>mandatory</p>                                       | <p>Template for the files to be processed.<br>The following placeholders are currently supported:</p><ul><li>"FD\_DATE" looks for an 8-digit date (e.g. "20191015").</li><li>"FD\_DATE\_YEAR\_4" looks for 4-digit year (e.g "2021").</li><li>"FD\_DATE\_YEAR\_2" looks for 2-digit year (e.g "21").</li><li>"FD\_DATE\_MONTH" looks for 2-digit month (e.g "05").</li><li>"FD\_DATE\_DAY" looks for 2-digit day (e.g "12").</li><li>"FD\_TIME" looks for a 6-digit time (e.g. "124213").</li><li>"FD\_BLOB\_n", where "n" is a non-zero positive integer, looks for a string of characters of "n" length.</li><li>FD\_TABLE\_NAME: This is a special template used when you have to process a large number of different files sharing the same destination schema. This template has to be used in conjunction with the <strong>table\_name</strong> parameter.</li></ul><p><strong>Information:</strong></p><ul><li>if "FD\_DATE" is specified, it will have priority upon "FD\_DATE\_YEAR\_X".</li><li>if "FD\_DATE\_YEAR\_4" or "FD\_DATE\_YEAR\_2" is specified, the final date will be concatenated with "FD\_DATE\_MONTH" and "FD\_DATE\_DAY".</li><li>if "FD\_DATE\_YEAR\_2" is specified, it will be prefixed by "20".</li><li>if "FD\_DATE\_YEAR\_4" or "FD\_DATE\_YEAR\_2" is specified only "FD\_DATE\_MONTH" and "FD\_DATE\_DAY" will be set to "01".</li></ul><p><strong>Example 1</strong></p><p>This template:</p><p><code>"stores\_{{FD\_DATE}}</code><em><code>{{FD\_TIME}}.txt"</code></em></p><p><em>will allow you to process this type of files:</em></p><p><em>"stores\_20201116\_124213.txt"</em></p><p><em><strong>Example 2</strong></em></p><p><em>This template:</em></p><p><em><code>"{{FD\_DATE}}</code></em><code>{{FD\_BLOB\_5}}</code><em><code>fixedvalue</code></em><code>{{FD\_BLOB\_11}}.gz"</code></p><p>will allow you to process this type of files:</p><p>"20201116\_12397\_fixedvalue\_12312378934.gz"</p><p><strong>Example 3</strong></p><p>If <strong>table\_name</strong> is set to: <code>"table\_{{FD\_TABLE\_NAME}}"</code></p><p>and <strong>filename\_template</strong> to: <code>"{{FD\_DATE}}\_{{FD\_TIME}}</code><em><code>fixedvalue</code></em><code>{{FD\_TABLE\_NAME}}.csv"</code></p><p>A file named "20201116\_124523\_fixedvalue\_stores.csv" will be loaded into a table named: "table\_stores\_20191205"</p><p>A file named "20190212\_063412\_fixedvalue\_visits.csv" will be loaded into a table named: "table\_visits\_20190212"</p> |
| <p><strong>ddl\_mode</strong></p><p>type: string</p><p>optional</p>                                                 | <p>This parameter allows you to specify how the schema of the table will be obtained.</p><p>Possible values:</p><ul><li>"file": Legacy mode. The table schema is described in the DDL file specified in the <strong>ddl\_file</strong> parameter.</li><li>" file\_template": The table schema is described in a DDL file provided in the source directory together with the source file. It must have the same filename as the source file, with the ".ddl.json" suffix.</li><li>"header" (CSV file only): The columns of the CSV file first line are automatically used as columns for the database table. All the columns are given the STRING type. No DDL file needs to be provided.</li><li>"autodetect" (not recommended): Google’s default mode. The schema is automatically detected from the source file. This mode doesn’t work well with CSV files, but gives good results with structured formats such as JSON. (see <a href="https://cloud.google.com/bigquery/docs/schema-detect">Google BigQuery documentation</a>).</li></ul><p><em>Default value: file</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p><strong>ddl\_file</strong></p><p>type: string</p><p>mandatory if <strong>ddl\_mode</strong> is set to "file"</p> | Path to the [DDL file](/data-pipeline-operations/load-data-with-storage-to-tables/storage-to-tables-ddl-files.md) where the destination schema is described.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><strong>doc\_md</strong><br>type: string<br>optional</p>                                                         | Path to the Markdown file containing detailed information about the destination table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <p><strong>add\_tailer\_metadata</strong></p><p>type : boolean</p><p>optional</p>                                   | <p><strong>\[NEW]</strong><br><br>Allows automatic metadata feature that add specific columns during the ingestion process related to the input source.</p><p>The added columns are:<br><br><code>tlr\_ingestion\_timestamp\_utc</code><br><code>(TIMESTAMP) tlr\_input\_file\_source\_type</code><br><code>(STRING)</code><br><code>tlr\_input\_file\_name</code><br><code>(STRING) tlr\_input\_file\_full\_resource\_name</code><br><code>(STRING)</code><br><br><em>Default value : false</em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tailer.ai/data-pipeline-operations/load-data-with-storage-to-tables/storage-to-tables-configuration-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
