You can use Gemini to aggregate table data during BigQuery data preparations, a feature currently in Preview. To aggregate data, select the Aggregate option in the data or schema view and enter a descriptive prompt like "Find the total revenue for a region." Gemini then generates grouping keys and aggregation expressions based on this prompt.
You can optionally edit or manually add grouping keys and aggregation expressions. Grouping keys require column names or expressions with aliases (e.g., EXTRACT(YEAR FROM order_date) AS order_year
), and no duplicates are allowed. Aggregation expressions must also have aliases (e.g., SUM(quantity) AS total_quantity
) and can be multiple, comma-separated expressions without duplicates. Supported aggregation expressions are listed under Aggregate functions.
After optionally previewing the step, click Apply to complete the aggregation.