You need LLM predictions across a whole table in SQL. What fits?
Why D is the answer
ai_query()
ai_query() calls a model from SQL, so it can run across a whole table in a batch.
In detail
- ai_query() applies a model to batch workloads.
- It calls a model from SQL across a table.
- Databricks says it can serve real-time or batch inference workloads.
Use case
An illustrative scenario, not a real incident.
An analyst needs sentiment on a million reviews in a table. ai_query() calls the model from SQL for each row, and no application is needed.
See it in different ways
sequenceDiagram participant C as pyfunc chain participant M as MLflow participant U as Unity Catalog participant S as Model Serving C->>M: Log the model M->>U: Register a version U->>S: Deploy to an endpoint
flowchart LR S0["Table of reviews"] --> S1["SELECT with ai_query"] --> S2["Result column"]
Key point: ai_query() brings LLMs into SQL.
Why the other options are wrong
- A. AI Playground, one row at a time
- Playground is for trying a prompt, one at a time.
- B. A Genie Space conversation
- Genie answers questions, and does not run row-by-row inference.
- C. A Vector Search index
- An index is for search, not predictions over rows.

