Use Gemini Cloud Assist
This document describes how to use Gemini Cloud Assist, a product of the Gemini for Google Cloud portfolio, to help you understand and work with your metadata, jobs, and queries in BigQuery.
Before you begin
Before you can use Gemini Cloud Assist, your administrator must perform the steps to Set up Gemini Cloud Assist for the project or folder that you're working in.
In order to support questions and requests about your Google Cloud resources, Gemini Cloud Assist needs the appropriate Identity and Access Management (IAM) permissions for those resources. Gemini Cloud Assist inherits your permissions when you prompt it to query your BigQuery data, so in many cases, the necessary IAM permissions are already granted. For more information, see IAM requirements for using Gemini Cloud Assist.
Use Gemini Cloud Assist
Go to the BigQuery page.
In the Google Cloud toolbar, click spark Open or close Gemini AI chat to open Gemini Cloud Assist chat.
In the Enter a prompt field, enter your prompt.
Click Send prompt.
The following sections provide examples of tasks that you can perform with Gemini Cloud Assist.
Analyze jobs
Learn more about jobs executed in your project, including your personal job history and project job history, to support the following use cases:
Debug long-running queries. Learn about the current status of a job and reasons it might be taking longer than expected, such as slot contention, a large number of rows scanned, high data volume, and others. In the Cloud Assist panel, enter a prompt similar to the following:
Why is this job taking so long? JOB_IDAnalyze the cause of a failed job. Learn about why a specific query failed. In the Cloud Assist panel, enter a prompt similar to the following:
Why did JOB_ID fail?Find resource-intensive queries. Learn about your most expensive queries based on the estimated number of bytes processed. In the Cloud Assist panel, enter a prompt similar to the following:
What are the 3 most expensive queries that I ran in the last 2 days?
Generate SQL
Generate a SQL query by describing what you want the query to do. For best results, include the name of the table that you want to query. For example, in the Cloud Assist panel, enter a prompt similar to the following:
Generate a SQL query to show me the duration and subscriber type for the ten longest trips.
Use the `bigquery-public-data.san_francisco_bikeshare.bikeshare_trips` table.
Generate Python code
Generate Python code by describing what you want it to do. For example, in the
Cloud Assist panel, you can enter the
following prompt to ask Gemini to query the penguins table
from a public dataset using the BigQuery magics syntax:
Generate python code to query the `bigquery-public-data.ml_datasets.penguins`
table using bigquery magics
What's next
- Learn more about Gemini Cloud Assist.
- Learn how Gemini for Google Cloud uses your data.