惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
M
MIT News - Artificial intelligence
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
IT之家
IT之家
F
Fortinet All Blogs
博客园 - 聂微东
U
Unit 42
Martin Fowler
Martin Fowler
腾讯CDC
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
量子位
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky

Databricks

How Scottish Water Made Its Capital Investment Data Conversational With Databricks Genie What are AI Hallucinations? Smart Routing in Unity AI Gateway: Match frontier quality with 30%+ lower cost per task Databricks Network Configuration delivery to Tens of Millions of Serverless VMs How Amtrak is building the data backbone for its largest transformation in over 50 years How a major freight railroad scaled pipeline creation with Genie Code The Future of Data Analytics: Why AI is rewriting the Analyst’s Job Description Taking AUTO CDC to the next level: Solving the hardest real-world use cases Open-sourcing Metals v2: Databricks’ Java and Scala language server for multi‑million line codebases Modern Risk Demands a Real-Time Foundation: The CRO’s Mandate Electric joins Databricks to bring WASM Postgres to AI agent sandboxes How to ground Genie Agents in both structured data and documents without losing governance Innocent until combined: Blocking the lethal trifecta with Omnigent Contextual Policies Introducing FILE type: a native column type for multimodal data Managing AI Coding Costs at Scale What is an AI Assistant? What are Agentic Workflows? What is Tool Calling? Kimi K3 from Moonshot AI is now available on Databricks through Unity AI Gateway Introducing OfficeQA Pro V2: A New Benchmark for Enterprise Grounded-Reasoning BigQuery to Databricks: A Strategic Framework for Modern Migration Unity AI Gateway is Generally Available Granular Usage Attribution for dbt Pipelines with Query Tags - Cloned Databricks joins the Open Secure AI Alliance to advance AI safety and security The New Monday Morning Report: How Generative AI can deliver the insights your executives need. Ingest semi-structured data faster and more efficiently with Variant - Now Generally Available Databricks Completes Acquisition of Panther: Accelerating the Security Lakehouse Era Backstage with Lakebase, part 3 Foundations for an AI-forward healthcare organization Agentic media buying cannot scale without the right foundation. See how buyers and sellers get there on Databricks.
Using AI_Functions in Your Data Warehouse: Top Use Cases
Srikant Das, Ismail Makhlouf · 2026-08-15 · via Databricks

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 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 governance. This architecture fundamentally changes how you work with AI in your data warehouse:

  • Governance by default: Because AI Functions respect Unity Catalog permissions, your data remains secure and private. The model only accesses the data you explicitly permit.
  • SQL-native simplicity: If you can write a 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.
  • Unified billing: Eliminate the complexity of reconciling disparate dashboards. AI usage surfaces in system.billing.usage right alongside your standard Databricks SQL warehouse costs.
  • Specialized functions: Get better results for less cost. By using task-specific functions - such as ai_classify, ai_extract, ai_translate, and ai_parse_document - you leverage models tailored for specific jobs rather than overpaying for general-purpose inference.

image3.png

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.

Use case 1: Document intelligence, from raw files to structured rows

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 handles the granular extraction of specific keys and values. This combined approach eliminates the need for fragile, custom OCR pipelines or third-party parsing services that often break during schema changes.

In this use case, we point the 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 function, in which we define what entities we want to extract from those invoices. The result is a structured table with the fields that we want extracted from the invoices.

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

Use case 2: Sentiment analysis on customer feedback

The 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

Use case 3: Inline translation for multilingual data

With 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

Use case 4: Classification and routing at scale

Focusing on operational efficiency, 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 to determine the user intent and urgency of the ticket.

Demo notebook: Classification and routing

Use case 5: Sales-call structured extraction with ai_extract

The 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

Use case 6: Generative drafting with ai_query

ai_query is the most general function and the foundation for the rest: it allows you to send a prompt to any Databricks-hosted Foundation Model serving point you have access to, and it will return the model's answer for each row.

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

Pro tips for production

  • Tag jobs on day one: This will allow you to attribute the cost of AI Functions to the right jobs
  • Try the task-specific function first: Use ai_query only when none of ai_classify, ai_extract, ai_parse_document or ai_translate fits
  • Ask for structured output: For ai_query, use responseFormat for structured output. If you pass a DDL STRUCT schema, you get typed fields instead of raw strings; JSON-schema/json_object formats still return JSON strings.
  • Be intentional about model choice: Every foundation model has trade-offs including cost, performance, and supported input formats. Make sure that you are intentional about which model you want to choose for which use case
  • Sample before you scale: Run at least 10,000 rows, read the output, then run the rest. The cost-accuracy trade-off is specific to each use case.
  • Treat prompts as code: Version them, review them in pull requests, comment them. A prompt is a transformation with business logic in it in this workflow

What this means for your data warehouse strategy

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.

Demo notebooks

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

Read next