# Using AI_Functions in Your Data Warehouse: Top Use Cases

> Source: <https://www.databricks.com/blog/using-aifunctions-your-data-warehouse-top-use-cases>
> Published: 2026-08-14 21:30:00+00:00

Six AI use cases you can run in pure SQL - replacing the notebooks, APIs, and pipelines you use today.

by [Srikant Das](/blog/author/srikant-das) and [Ismail Makhlouf](/blog/author/ismail-makhlouf)

In most organizations, data warehouses hold structured data, while unstructured data is kept in the data lake. This works well for analytics workloads, which consume structured data at scale, serving a known body of reports day in and day out.

AI workloads, however, require different inputs. AI models often need to parse unstructured data - like reviews, support tickets, and PDFs - and combine them with the structured data to train, build, and serve models. So an analyst who wants sentiment on support tickets has to ship the rows out to a service, wait for predictions, and stitch them back into a table by hand. It's slow, it breaks when a schema changes, and it introduces unnecessary security and governance risks.

[AI Functions](https://docs.databricks.com/aws/en/large-language-models/ai-functions) solve this by bringing the AI directly to your data, rather than moving your data to a separate AI environment. You invoke models within standard SQL queries, keeping the entire inference process within your existing pipelines and [Unity Catalog](https://www.databricks.com/product/unity-catalog) governance. This architecture fundamentally changes how you work with AI in your data warehouse:

`SELECT`

statement, you can build with AI. Databricks manages the complexity - planning, parallelization, and retries so you don't have to worry about cluster management or external orchestration. It's just as easy to run an inference on millions of rows as one row, the same query scales without rewriting.`system.billing.usage`

`ai_classify`

`ai_extract`

`ai_translate`

`ai_parse_document`

You can use these AI functions from anywhere on Databricks, including notebooks, Lakeflow Spark Declarative Pipelines, and Workflow. But in this post we're going to be focusing on calling these functions from Databricks Lakehouse specifically. The use cases below will show you how you can integrate these AI functions into workloads where you need to combine structured data in your data warehouse with unstructured data, either from outside the data warehouse or by producing it yourself via GenAI-enabled functions.

[ ai_parse_document](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_parse_document) acts as the ingestion bridge that converts raw binary file content - like PDFs or images - into readable text. Once parsed,

`ai_extract`

In this use case, we point the [ ai_parse_document](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_parse_document) at a Databricks volume that contains invoices. Once those invoices are parsed an AI parse document produces the results in JSON, which are then passed to the

`ai_extract`

Lineage now runs from the raw PDF to the extracted rows inside a single query plan. The bridge people build for this by hand - a Python OCR service, an LLM call and a JSON-flattening step - all collapse into the query.

[Demo notebook: Document intelligence](https://github.com/databricks-solutions/databricks-blogposts/blob/main/2026-05-ai-functions-data-warehouse-use-cases/02_document_intelligence.py)

The [ ai_classify](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_classify) function performs zero-shot classification, mapping free-text feedback into a specific set of user-defined labels without requiring model training. This process transforms chaotic, unstructured text into governed, queryable columns, making sentiment and topic data immediately available for BI dashboards and executive reporting.

In this example, we want to classify customer reviews from the bronze.nps_responses table into positive, negative, neutral, and mixed.

[Demo notebook: Sentiment analysis](https://github.com/databricks-solutions/databricks-blogposts/blob/main/2026-05-ai-functions-data-warehouse-use-cases/03_sentiment_analysis.py)

With [ ai_translate](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_translate), you can normalize multilingual data into a single target language directly within the query layer. This prevents data silos and fragmentation, allowing all downstream analysis (including classification and extraction) to operate on the entire global dataset simultaneously rather than processing English-only slices.

In this example, we extract sentiment from different customer reviews and then we translate them into English.

[Demo notebook: Translation and normalization](https://github.com/databricks-solutions/databricks-blogposts/blob/main/2026-05-ai-functions-data-warehouse-use-cases/04_translation_normalization.py)

Focusing on operational efficiency, [ ai_classify](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_classify) converts free-form inputs like support tickets or call transcripts into actionable categories. By identifying the intent and urgency of incoming feedback at the point of ingestion, it enables automated, intelligent routing to the appropriate teams or automated response systems.

In the use case below we're ingesting different support tickets from a table and then using [ ai_classify](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_classify) to determine the user intent and urgency of the ticket.

[Demo notebook: Classification and routing](https://github.com/databricks-solutions/databricks-blogposts/blob/main/2026-05-ai-functions-data-warehouse-use-cases/05_communication_triage.py)

The [ ai_extract](https://docs.databricks.com/aws/en/sql/language-manual/functions/ai_extract) function is designed to mine semi-structured information from long-form content, such as sales call transcripts, and convert narrative text into discrete, structured fields. This provides significant value by putting qualitative information directly into BI tools, effectively turning spoken conversations into queryable metrics like deal stage and risk flags.

In this use case we're mining a long transcript to identify what the next step, the deal stage, the risk flag, and the risk reason is so that salespeople can action the outcome of the meeting that produced the transcript.

[Demo notebook: Sales-call extraction](https://github.com/databricks-solutions/databricks-blogposts/blob/main/2026-05-ai-functions-data-warehouse-use-cases/06_sales_call_extraction.py)

[ ai_query](https://docs.databricks.com/aws/en/large-language-models/ai-query) is the most general function and the foundation for the rest: it allows you to send a prompt to any

In this use case, we can use ai_query to draft a renewal outreach email for every customer account in the fictional `gold.renewal_signals`

table which shows us which accounts are primed for renewal.

Because you write the prompt, it can do anything the model can do, which is why it handles the cases the more specific functions do not.

[Demo notebook: Generative drafting](https://github.com/databricks-solutions/databricks-blogposts/blob/main/2026-05-ai-functions-data-warehouse-use-cases/01_renewal_outreach_drafting.py)

The thread through all six is the same. The AI runs in the same place as the rest of the warehouse: one platform, one governance model, one bill, one set of pipelines. Any line of your existing SQL ETL can pick up an AI step without you standing up a system to host it, and each Python script that used to translate, score or classify data on the side becomes a candidate for a one-line replacement.

So start with one column. Take the workload where the current service is most fragile, rewrite it as a SELECT, run it on 10,000 rows, and read what comes back. You will know after a quick sprint whether it fits - and you will have stopped paying the extra overhead of shipping data out just to use it.

Each notebook ships with inline sample data, the SQL step by step, and the output you should expect.

Subscribe to our blog and get the latest posts delivered to your inbox.
