BigQuery AI.CHUNK_DOCUMENT and AI.PARSE_DOCUMENT Reach GA: Parse PDFs and Build RAG Retrieval with SQL
Google Cloud announced that BigQuery's document chunking (AI.CHUNK_DOCUMENT) and layout parsing (AI.PARSE_DOCUMENT) functions are now generally available. Together with AI.EMBED and AI.SEARCH, they let you process PDFs in Cloud Storage using GoogleSQL.
News date: About 7 min read
Contents
Google Cloud announced on its official blog that two BigQuery functions have reached general availability (GA): AI.CHUNK_DOCUMENT, which splits documents into chunks, and AI.PARSE_DOCUMENT, which parses their layout. Used with AI.EMBED and AI.SEARCH, they let enterprises process PDFs and documents in Cloud Storage with SQL directly inside the data warehouse. RAG (retrieval-augmented generation) means first finding the passages in your documents that are relevant to a question, then handing them to an AI model to answer. That way the response is grounded in those documents.
What changes with BigQuery's document processing?
Google Cloud notes that bringing large volumes of PDFs into a RAG pipeline has often meant stitching together several systems outside the data warehouse, including: - Simple text splitters - Separate Python worker processes - OCR (optical character recognition) processors The company argues these approaches tend to break multi-column layouts and financial tables. They also keep document fragments separate from structured data.
The two new functions bring the Document AI layout parser into BigQuery. They process documents by visual layout and hierarchy rather than simply counting characters. According to Google Cloud: - The chunking function analyzes headings, paragraphs, lists and tables, and records the start and end page of each chunk. - The parsing function outputs headings, paragraphs, images, page headers and footers, and tables as BigQuery-native JSON (a structured data format). Each block comes with its page number and normalized bounding-box coordinates, meaning where the block sits on the page. - Tables with merged cells are converted to structured HTML.
Which function suits which job?
Google Cloud says both use the same Document AI layout parser and can be used alone or together. - To chunk, embed and run semantic search in one step, use the chunking function. - To parse once and then filter in SQL by page number, block type or keyword, use the parsing function. Use it as well when you need HTML tables, visual citations or PII (personally identifiable information) redaction. Parsing results can be stored and later passed directly to the chunking function, without calling the Document AI processor again.
| Item | AI.CHUNK_DOCUMENT | AI.PARSE_DOCUMENT |
|---|---|---|
| Function type | Table-valued function, one row per chunk | Scalar function, one JSON object per document |
| Main use | RAG ingestion, auto-embedding, semantic search with AI.SEARCH | Parse first then filter with SQL, HTML table extraction, bounding-box citations, PII redaction |
| Input source | Cloud Storage URI, object table, ObjectRef query, or raw-docai output of AI.PARSE_DOCUMENT | Cloud Storage URI or ObjectRef value |
| Main output fields | chunk_id, start_page, end_page, content, status, uri, size, updated, ref | metadata.schema, errors, and a blocks array containing id, type, content, page_number, bbox |
| Table handling | Table content is kept in text chunks together with the heading of the section it belongs to | Each table block is output as structured HTML preserving row and column spans |
How do you build a RAG pipeline with three SQL steps?
In Google Cloud's demo, the flow has three steps. For the actual SQL, see the official article and reference documentation:
- Create a table with an auto-embedding column. An "embedding" turns text into a numeric vector that can be compared by meaning. Once you define a generated embedding column, BigQuery computes and maintains vectors in the background as new chunks arrive. You can use the built-in Gemma embedding model, which keeps your text inside BigQuery and computes embeddings using BigQuery slots. You can also point to a Gemini platform embedding endpoint instead.
- Ingest PDF chunks with AI.CHUNK_DOCUMENT by passing a Cloud Storage wildcard URI directly. By default, BigQuery authenticates with end-user credentials, meaning the account permissions of whoever runs the query, so you do not need to set up an external connection first. The official example filters on an empty-string status to keep only chunks that parsed without errors.
- Retrieve relevant chunks with AI.SEARCH by passing the table, the text column name and a natural-language question. BigQuery embeds the query with the same model configured on the table. It returns the chunks along with their source URI and page range.
Google Cloud also notes that chunks and embeddings are stored in standard BigQuery tables. That means they can be joined in the same query with structured tables such as company financials.
What should you know about cost, scale and limitations?
Google Cloud explains that when either function runs, BigQuery automatically provisions a single layout parser processor in the project and reuses it across queries. Users do not need to create or train a processor manually. Cost is the standard Document AI per-page processing rate plus BigQuery slot usage, with no idle holding fee. The official article does not give specific prices or regional availability.
On scale, the company says the functions grow with BigQuery's distributed execution engine, from dozens of documents to millions. File-level parsing errors are recorded in each result row and do not cause a large query to fail as a whole.
Frequently asked questions
Are these two functions in preview or GA now?
Google Cloud says AI.CHUNK_DOCUMENT and AI.PARSE_DOCUMENT are now generally available (GA). The article does not describe differences by region or plan.
Do I need to create a Document AI processor myself?
No. According to Google Cloud, when the functions run, BigQuery automatically provisions a single layout parser processor in the project and reuses it.
Can the chunk size be adjusted?
Yes. The official post says the target maximum chunk size can be set up to 2,000 tokens, with a default of 1,000 tokens.
Can I query it together with my existing structured data?
Yes. Google Cloud says parsed blocks and document chunks are stored in standard BigQuery tables and can be joined with business tables in a single query.
Where can I find the full syntax and tutorials?
Google Cloud recommends the following resources at the end of its article: - Reference documentation for AI.CHUNK_DOCUMENT and AI.PARSE_DOCUMENT - Documentation on automatic embedding generation and AI.SEARCH - A step-by-step tutorial on parsing PDFs in a RAG pipeline
Found this guide helpful? Share it with someone who needs it
Amazon EC2 P7 with NVIDIA Vera Rubin is generally available: NVIDIA cites 2.3x the GPU compute of P6e-GB300
NVIDIA announced that Amazon EC2 P7-VeraRubin UltraServers and P7-Rubin instances are generally available (GA) for training, inference and agentic AI. This guide covers the specs, the use cases and the gaps the companies have not yet filled, such as HyperPod support, pricing and regions.
New Threads Communities features: vote any topic into a community, plus member-only replies and trends (rolling out from Dec. 1)
Fireblocks' Open-Source Post-Quantum Bitcoin Research Claims Quantum-Safe Transactions for About $3, Not $60, With No Network Upgrade (Decrypt)
Profit Connect Fake AI Crypto Mining Ponzi: Las Vegas Owner Brent Kovar Sentenced to 12 Years Over $24 Million
Sources
Compiled from the references and verification dates listed above; fares, schedules, product features, and terms can change, so please confirm the latest details on the relevant official website before travelling, booking, or purchasing.