> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# export_to_bigquery

> Export data to a BigQuery Table. 

## Usage

The following examples show how the step can be used in a recipe.

<Accordion title="Examples" icon="code" defaultOpen="true">
  <Tabs>
    <Tab title="Example 1">
      Export dataset to a BigQuery table

      ```stan theme={null}
      export_to_bigquery(ds, {"integration": "MY_BIGQUERY_INTEGRATION", "dataset_id": "my_dataset", "table_id": "survey_results"})
      ```
    </Tab>

    <Tab title="Example 2">
      Append data to an existing BigQuery table

      ```stan theme={null}
      export_to_bigquery(ds, {"integration": "MY_BIGQUERY_INTEGRATION", "dataset_id": "analytics", "table_id": "daily_metrics", "if_exists": "append"})
      ```
    </Tab>

    <Tab title="Signature">
      General syntax for using the step in a recipe. Shows the inputs and outputs the step is expected to receive and will produce respectively. For futher details see sections below.

      ```stan theme={null}
      export_to_bigquery(ds: dataset, {
          "param": value,
          ...
      })
      ```
    </Tab>
  </Tabs>
</Accordion>

## Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally
columns (`ds.first_name`), datasets (`ds` or `ds[["first_name", "last_name"]]`) or models (referenced
by name e.g. `"churn-clf"`).

<Accordion title="Inputs" icon="right-to-bracket">
  <ParamField path="ds" type="dataset" required>
    Dataset to be exported.
  </ParamField>
</Accordion>

<Accordion title="Outputs" icon="right-from-bracket" />

## Configuration

The following parameters can be used to configure the behaviour of the step by including them in
a json object as the last "input" to the step, i.e. `step(..., {"param": "value", ...}) -> (output)`.

<Accordion title="Parameters" defaultOpen="true" icon="sliders">
  <ParamField path="integration" type="string" required>
    ID of the integration you'd like to use.
  </ParamField>

  <ParamField path="table_id" type="string" required>
    The name of the table you want to upload data to.
  </ParamField>

  <ParamField path="dataset_id" type="string" required>
    The name of the dataset you want to upload data to.

    Values must match the following regex pattern:

    ```regex theme={null}
    ^[a-zA-Z0-9_]*$
    ```
  </ParamField>

  <ParamField path="if_exists" type="string" default="fail">
    The preferred method for handling existing tables.

    * 'Fail' if there is another table with the same name. The default value is 'fail' to prevent you from accidentally losing your data or compromising a table's structure in your database.
    * 'Replace' if you want to override the existing table. Keep in mind this option deletes your previous data.
    * 'Append' if you want to append the dataset's rows to the table.

    Values must be one of the following:

    * `fail`
    * `replace`
    * `append`
  </ParamField>
</Accordion>
