Before you can use Gemini in BigQuery, which offers AI-powered assistance for your data analytics, your team must do the following:
- Purchase Gemini in BigQuery
- Enable necessary APIs.
- Grant required Identity and Access Management (IAM) roles.
- Turn on Gemini in BigQuery features in the Google Cloud console.
Purchase Gemini in BigQuery
To use Gemini in BigQuery, you must do one of the following:
- Create Enterprise Plus assignments with Gemini in BigQuery - includes all Gemini in BigQuery capabilities
- Purchase Gemini Code Assist Enterprise edition - includes Gemini in BigQuery code assistance capabilities
For a list of included capabilities, see Gemini in BigQuery Pricing Overview.
Purchase Enterprise Plus edition
To give users access to Gemini in BigQuery
capabilities, create a BigQuery Enterprise Plus edition
reservation and an assignment with job_type
of
QUERY
for the
organization or project. Query jobs that run in projects assigned to that
reservation can use Gemini in
BigQuery capabilities.
You can try Gemini in BigQuery at no charge until January 27, 2025.
Required permissions
To create and assign a reservation that allows Gemini in
BigQuery capabilities, you must have the BigQuery
Resource Admin
or
another role with the bigquery.reservations.create
and
bigquery.reservationAssignments.create
IAM permissions. For more information about IAM roles in BigQuery, see Predefined roles and permissions.
Create Enterprise Plus assignments with Gemini in BigQuery
In the Google Cloud console, go to the BigQuery Capacity Management page.
On the Capacity Management page in the Slot Reservation section, identify the Enterprise Plus edition reservation you want to use to assign Gemini in BigQuery capabilities. To create a new reservation, follow the instructions in Create reservations and select Enterprise Plus for Edition.
In the Actions column for your Enterprise Plus edition reservation, click
Reservation Actions, and then click Create assignment.On the The Create an assignment pane, for Select an organization, folder, or project, click Browse to search for the project or organization to assign the selected reservation. Folders are not supported for Gemini in BigQuery assignments.
For Job Type, only
QUERY
job types are supported for Gemini in BigQuery assignments.To enable Gemini in BigQuery, toggle Enable Gemini in BigQuery for this assignment. By allowing Gemini in BigQuery to be used for the
QUERY
type assignment, you agree to its terms and conditions.Click Create to create the assignment.
Purchase Gemini Code Assist Enterprise
Gemini Code Assist Enterprise includes Gemini in BigQuery capabilities that accelerate end-to-end data & analytics lifecycle with AI assistance. To learn how to purchase, see Purchase a Gemini Code Assist Enterprise subscription and follow the instructions to purchase Enterprise edition.
Enable necessary APIs
To use Gemini in BigQuery,
you must enable the Gemini for Google Cloud API. A service administrator or project
owner with the serviceusage.services.enable
IAM permission
typically performs this step.
To enable the Gemini for Google Cloud API, go to the Gemini for Google Cloud page.
In the project selector, select a project.
Click Enable.
The page updates and shows a status of Enabled. Gemini in BigQuery is now available in the selected Google Cloud project to all users who have the required IAM permissions.
To use recommendations for the partitioning and clustering recommender and materialized view recommender, enable the Recommender API if it's not already enabled.
Enable Apache Spark in BigQuery
To use autotuning and assisted troubleshooting for Apache Spark, you must enable the Dataproc API for a project.
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Dataproc API.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Dataproc API.
Automatic enablement of asset management APIs
The following asset management APIs are automatically enabled for all Google Cloud projects that use BigQuery:
- Analytics Hub API
- BigQuery Connection API
- BigQuery Data Policy API
- BigQuery Reservation API
- Dataform API
- Dataplex API
If you have automation scripts from before March 2024 that depended on the status of these APIs, you might need to update them.
These APIs don't incur any additional costs. Users that have IAM permissions to use enabled services on corresponding resources can incur charges, as described in BigQuery pricing, Dataform pricing, and Dataplex pricing.
You can prevent enablement of additional APIs by setting the Restrict Resource Service Usage organization policy constraint. You can disable selected APIs at any time.
Enable Gemini in BigQuery preview features
Certain Gemini in BigQuery features in Preview are part of the trusted tester program. To request access to these features, an administrator must complete the Gemini in BigQuery Pre-GA Sign-up form. Gemini in BigQuery pre-GA feature access is enabled periodically in batches.
Preview features that require Gemini in BigQuery sign-up include the following:
- SQL query completion
- Materialized view recommendations
- Apache Spark autotuning and assisted troubleshooting
Grant IAM roles on a Google Cloud project
This section describes the steps required to grant the Cloud AI Companion User
IAM role
(roles/cloudaicompanion.user
) to users. Additional roles are required for other
Gemini in BigQuery features. An administrator
typically performs this step.
To grant the IAM roles that are required to use Gemini in BigQuery, go to the IAM & Admin page.
To grant access, click View by principals.
In the Principal column, find a principal for which you want to enable access to Gemini in BigQuery, and then click Edit principal in that row.
In the Edit access pane, click
Add another role.In the Select a role list, select Gemini for Google Cloud User. Users with the Gemini for Google Cloud User role can use Gemini for Google Cloud, but they might need additional permission to use specific Gemini in BigQuery features.
Optional: Grant roles that give permissions to access other Gemini in BigQuery features, if necessary:
To give permissions to view cluster and partition recommendations, click Add another role, and then select BigQuery Partitioning Clustering Recommender Viewer. For more information, see Required permissions.
To give permissions to view materialized view recommendations, click Add another role, and then select BigQuery Materialized View Recommender Viewer. For more information, see Required permissions.
To give permissions to generate data insights with Gemini assistance, click Add another role, and then select Dataplex DataScan Editor. Repeat these steps to add BigQuery Data Viewer. For more information, see Required roles and permissions.
Click Save.
Grant IAM roles for Gemini in BigQuery Apache Spark features
To grant the necessary IAM roles to use Gemini in BigQuery Apache Spark features to optimize with autotuning and to use advanced troubleshooting, see Dataproc Serverless roles.
Turn on Gemini in BigQuery features
If you're a data analyst, data scientist, or developer who wants to use specific Gemini in BigQuery features to write SQL queries and Python code, then you need to turn on the feature in the Google Cloud console. To learn how to turn on features, see Before you begin in "Write queries with Gemini assistance." Users who have the necessary IAM roles or permissions can access the Gemini in BigQuery features that are enabled for their Google Cloud project. For more information, see Gemini for Google Cloud overview.