The Cloud Spanner connector lets you access data from Google Cloud Spanner within Data Studio. Cloud Spanner is an enterprise-grade, globally-distributed, and strongly consistent database service built for the cloud specifically to combine the benefits of relational database structure with non-relational horizontal scale.

Cloud Spanner is a paid service. [Learn more about pricing](https://cloud.google.com/spanner/pricing).

## How to connect to Google Cloud Spanner

A Data Studio data source can connect to Cloud Spanner databases using [Google Standard SQL query syntax](https://docs.cloud.google.com/spanner/docs/query-syntax).

### To connect

1. [Sign in to Data Studio.](https://datastudio.google.com)
2. On the Data Studio home page, in the top left, click ![The Create icon.](https://docs.cloud.google.com/static/data-studio/images/rainbow-plus-2019-06-26.png)**Create** , and then select **Data Source**.
3. Select the **Cloud Spanner** connector.
4. If asked, authorize Data Studio to access your data.
5. On the left, set up the connection to your database. You'll need to provide:
   1. Project ID
   2. Instance ID (see the *Notes* section to find out how to list your instance configurations).
   3. Database ID
6. In the text field, enter your SQL query.
7. In the upper right, click **CONNECT**.

In a moment, the data source fields list page appears. Click **CREATE REPORT** to start visualizing your data.

## Notes

### List instance configurations

The [Cloud SDK](https://cloud.google.com/sdk) command-line tool lets you interact with Cloud Spanner. For example, the following command lists the regional and multi-region instance configurations that are available for your project:


    gcloud spanner instance-configs list

Regional configurations distribute data in a single region, while multi-region configurations distribute data geographically across multiple regions. Learn more about [Instances](https://docs.cloud.google.com/spanner/docs/instances).
Data Studio maps your database's built-in data types to a unified set of [data types](https://docs.cloud.google.com/data-studio/data-types). If Data Studio encounters a column in your table or query of an unsupported type, it won't create a field for that column.

<br />

## Limits of the Spanner connector

- The response size from Spanner is limited to 10 MB. See the [Spanner Limits article](https://cloud.google.com/spanner/quotas) for other limits.
- Column headers (field names) must use ASCII characters only. Non-ASCII characters aren't supported.

## Troubleshooting

See the [Data Studio troubleshooting guide](https://docs.cloud.google.com/data-studio/troubleshooting-guide) for a list of common error messages and steps to resolve them.

## Related resources

- [Create a data source](https://docs.cloud.google.com/data-studio/add-data-to-a-report)
- [Google Cloud Platform overview](https://cloud.google.com/docs/overview/)