BigQuery's new AI.AGG() function lets you run natural-language instructions over millions of rows of unstructured or multimodal data using a single SQL query. The post covers practical use cases including analyzing Apache Spark system logs for hidden inefficiencies, discovering and applying product categories from text and image data using AI.AGG() combined with AI.CLASSIFY(), and handling multimodal inputs from Cloud Storage. Key technical details include how AI.AGG() manages LLM context windows via automatic multi-level batching, token usage considerations, model endpoint configuration (short-form vs. fully-qualified), NULL handling in STRUCT inputs, and error reporting via job statistics. The function is currently in preview and always returns a string output.

10m read timeFrom cloud.google.com
Post cover image
Table of contents
Analyzing system logs with AI.AGG()
250 Impressions