<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/using-ai-functions-in-your-data-warehouse-top-use-cases-om2ogbtjk" -->

---
title: Using AI_Functions in Your Data Warehouse: Top Use Cases
description: Databricks AI Functions let you invoke LLMs directly inside SQL queries against warehouse data, eliminating the need to ship rows out to external services for...
canonical: https://daily.dev/posts/using-ai-functions-in-your-data-warehouse-top-use-cases-om2ogbtjk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Using AI_Functions in Your Data Warehouse: Top Use Cases | daily.dev
og:description: Databricks AI Functions let you invoke LLMs directly inside SQL queries against warehouse data, eliminating the need to ship rows out to external services for...
og:url: https://daily.dev/posts/using-ai-functions-in-your-data-warehouse-top-use-cases-om2ogbtjk
og:image: https://api.daily.dev/og/posts/om2ogBTJK.png
og:image:alt: Using AI_Functions in Your Data Warehouse: Top Use Cases
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Using AI_Functions in Your Data Warehouse: Top Use Cases

**[databricks](https://daily.dev/sources/databricks)** · 7 min read · 1 upvotes · 0 comments

## Summary

Databricks AI Functions let you invoke LLMs directly inside SQL queries against warehouse data, eliminating the need to ship rows out to external services for AI processing. The post walks through six use cases: ai_parse_document plus ai_extract for pulling structured fields out of invoice PDFs, ai_classify for sentiment/topic/urgency tagging of NPS survey responses and support tickets, ai_translate combined with ai_extract for normalizing multilingual product reviews, ai_extract for mining sales call transcripts into deal-stage and risk fields, and ai_query for generating renewal outreach emails with a JSON schema response format. Each example includes runnable SQL and links to a demo notebook, with the pitch being that AI inference stays within existing SQL pipelines and Unity Catalog governance, scales from one row to millions without rewriting, and replaces ad hoc Python/OCR/LLM glue code with a single query.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.databricks.com/blog/using-aifunctions-your-data-warehouse-top-use-cases>

## Questions this post answers

### How do I classify customer feedback into sentiment categories using SQL in Databricks?

Use the ai_classify function directly in a SELECT statement, passing the text column and a JSON array of labels like positive, negative, neutral, and mixed. Databricks returns the label without requiring model training, and the same query can run multiple ai_classify calls to also tag topic and urgency in one pass over a table like bronze.nps_responses.

_daily.dev surfaces practical SQL-based AI workflows for teams weighing in-warehouse inference against external pipelines._

### How can I extract structured fields from PDF invoices using SQL instead of a Python OCR pipeline?

Chain ai_parse_document and ai_extract within a single query: ai_parse_document converts raw PDF or image binary content into readable text and JSON, then ai_extract pulls named fields such as vendor_name, invoice_no, invoice_date, total_amount, and line_items from that parsed content, replacing a separate OCR service, LLM call, and JSON-flattening step.

_Developers replacing brittle OCR pipelines with SQL-native extraction can find similar patterns on daily.dev._

### How do I draft personalized outreach emails from a SQL table using an LLM?

Call ai_query with a model name like databricks-gpt-oss-120b and a prompt built by concatenating account fields such as mrr_usd, days_to_renewal, open_risk_flags, and last_engagement_summary, specifying a responseFormat json_schema so the model returns a strict JSON object with subject, body, and suggested_send_date fields for each row in a table like gold.renewal_signals.

_daily.dev tracks emerging patterns for teams combining LLM generation with structured warehouse data._

## Similar posts on daily.dev

- [How Snowflake AI Functions Eliminate 80% of Custom Pipeline Code](https://daily.dev/posts/how-snowflake-ai-functions-eliminate-80-of-custom-pipeline-code-pknoewdku) · Snowflake Community · 2 upvotes · 0 comments
- [Boost Performance and Lower Costs with AlloyDB AI Functions](https://daily.dev/posts/boost-performance-and-lower-costs-with-alloydb-ai-functions-cvsjukeo1) · Google Cloud · 0 upvotes · 0 comments
- [Nine Unusual Ways My Clients Use AI With SQL Server](https://daily.dev/posts/nine-unusual-ways-my-clients-use-ai-with-sql-server-399rw1ejp) · SQL Authority · 0 upvotes · 0 comments
- [Google BigQuery gets managed AI functions to simplify unstructured data analysis](https://daily.dev/posts/google-bigquery-gets-managed-ai-functions-to-simplify-unstructured-data-analysis-jhmzgvsac) · InfoWorld · 0 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#sql](https://daily.dev/tags/sql), [#databricks](https://daily.dev/tags/databricks), [#data-warehouse](https://daily.dev/tags/data-warehouse), [#unity-catalog](https://daily.dev/tags/unity-catalog)

[View this post on daily.dev](https://daily.dev/posts/using-ai-functions-in-your-data-warehouse-top-use-cases-om2ogbtjk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Using AI_Functions in Your Data Warehouse: Top Use Cases","url":"https://daily.dev/posts/using-ai-functions-in-your-data-warehouse-top-use-cases-om2ogbtjk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/using-ai-functions-in-your-data-warehouse-top-use-cases-om2ogbtjk"},"datePublished":"2026-08-14T21:17:48.076Z","dateModified":"2026-09-14T06:17:27.549Z","description":"Databricks AI Functions let you invoke LLMs directly inside SQL queries against warehouse data, eliminating the need to ship rows out to external services for...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/16521d8c87eb7b19022b0863cbd4313c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/16521d8c87eb7b19022b0863cbd4313c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"databricks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"databricks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/fa7aa720f2db4d1eba826814730482c8","url":"https://daily.dev/sources/databricks"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/using-ai-functions-in-your-data-warehouse-top-use-cases-om2ogbtjk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,sql,databricks,data-warehouse,unity-catalog","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"databricks","item":"https://daily.dev/sources/databricks"},{"@type":"ListItem","position":3,"name":"Using AI_Functions in Your Data Warehouse: Top Use Cases"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/using-ai-functions-in-your-data-warehouse-top-use-cases-om2ogbtjk#faq","mainEntity":[{"@type":"Question","name":"How do I classify customer feedback into sentiment categories using SQL in Databricks?","acceptedAnswer":{"@type":"Answer","text":"Use the ai_classify function directly in a SELECT statement, passing the text column and a JSON array of labels like positive, negative, neutral, and mixed. Databricks returns the label without requiring model training, and the same query can run multiple ai_classify calls to also tag topic and urgency in one pass over a table like bronze.nps_responses. daily.dev surfaces practical SQL-based AI workflows for teams weighing in-warehouse inference against external pipelines."}},{"@type":"Question","name":"How can I extract structured fields from PDF invoices using SQL instead of a Python OCR pipeline?","acceptedAnswer":{"@type":"Answer","text":"Chain ai_parse_document and ai_extract within a single query: ai_parse_document converts raw PDF or image binary content into readable text and JSON, then ai_extract pulls named fields such as vendor_name, invoice_no, invoice_date, total_amount, and line_items from that parsed content, replacing a separate OCR service, LLM call, and JSON-flattening step. Developers replacing brittle OCR pipelines with SQL-native extraction can find similar patterns on daily.dev."}},{"@type":"Question","name":"How do I draft personalized outreach emails from a SQL table using an LLM?","acceptedAnswer":{"@type":"Answer","text":"Call ai_query with a model name like databricks-gpt-oss-120b and a prompt built by concatenating account fields such as mrr_usd, days_to_renewal, open_risk_flags, and last_engagement_summary, specifying a responseFormat json_schema so the model returns a strict JSON object with subject, body, and suggested_send_date fields for each row in a table like gold.renewal_signals. daily.dev tracks emerging patterns for teams combining LLM generation with structured warehouse data."}}]}
```

