# BigQuery

The integrated Google Cloud service offers a scalable, high-performance relational database that operates serverlessly.

## Supported Methods

Means for Lumi to connect to the client to implement the services required:

* [x] **Direct**&#x20;

  *The default / typical connection option. Interfaces directly with the target system over the Internet with no mediation. Suitable for most cloud-hosted scenarios or public-facing resources. See* [*Network Configuration*](https://docs.lumi-ai.com/using-lumi/network-configuration) *for more details.*
* [ ] **Gateway**\
  \&#xNAN;*An alternative connection method leveraging a Lumi AI Data Gateway. This uses Lumi AI's purpose-built connection agent to mediate communications. Ideal for restricting access to systems within a protected network. For more information, see* [*Data Gateway*](https://docs.lumi-ai.com/product-features/data-gateway)*.*&#x20;

## Supported Limits

The following are limitations that can be set to fine tune the agents' actions:&#x20;

* [x] **Cost Limit**\
  \&#xNAN;*Before running a query, if the system supports it, the system-specific compute cost (or surrogate) estimate will be processed and compared to an organization-level/admin-set cost limit for systems of this type (if configured/set). If exceeded, the query will not run (and either the workflow will attempt an optimization or the user will be notified).*
* [ ] **Duration Limit**\
  \&#xNAN;*An alternative to cost, queries will be stopped the system supports a duration/timeout limit and one is set/configured at the organization level (across systems).*

## Available Parameters

These properties are the essential source system connection properties that all queries are directed towards.

*\* Required parameters*

<details>

<summary>Project ID*</summary>

The unique identifier for the Google Cloud project which consists of lowercase letters, digits, and/or hyphens while starting with a letter.

[How To Obtain Project ID](https://support.google.com/googleapi/answer/7014113?hl=en)

</details>

<details>

<summary>Service Account Credentials*</summary>

Credentials obtained from the Google BigQuery API interface to allow Lumi to access the database. The credentials should be a JSON key file containing the private keys and other information needed.

[How to Get Credentials](https://cloud.google.com/iam/docs/keys-create-delete)

</details>

## System Permissions & Configuration

To ensure proper access and functionality, please follow these recommended steps:

* **Create a Service Account:** Proceed with this step if you have not already established a service account.
  * For guidance, see [How to Generate A Service Account](https://cloud.google.com/iam/docs/service-accounts-create).
* **Assign Roles:** The following permissions need to be assigned to the associated Service account.
  * **BigQuery Data Viewer**: Grants permission to view tables.
  * **BigQuery Job User**: Allows for the execution of queries.

## Special Considerations

No noteworthy considerations.

## Common Issues

* Ensure BigQuery API is enabled for the project
* Ensure the generated service has its required roles
