How Generative AI Is Changing Data Engineering
Generative AI helps data engineers build pipelines and now runs inside them, called from SQL. What Databricks and Snowflake offer for each, and where each goes wrong.
Tecyfy · Published · Updated · 4 min read

Introduction
Generative AI helps data engineers in two different ways, and it pays to keep them apart. It helps build pipelines: an assistant writes and fixes the SQL and Python, and explains code someone else wrote. And it runs inside pipelines: a language modelLarge Language ModelA model trained on a huge amount of text to predict the next token. Further training turns it into an assistant that follows instructions. called from SQL reads text that tables could never handle before, such as reviews, tickets and contracts, and turns it into columns. This article covers both, with the features Databricks and Snowflake ship for each, and where each goes wrong.
Building pipelines with an AI assistant
An AI assistant can draft a pipelineData PipelineA set of steps that moves data from where it is made to where it is used, cleaning and reshaping it on the way, run on a schedule or as data arrives. from a description: "read the raw orders files, drop test orders, convert amounts to euros and write a daily table". Data platforms now build this into the workspace. Databricks' Genie Code, for example, works in notebooks, the SQL editor and the pipelines editor. It plans the steps, runs the code, reads the output and fixes its own errors, and it works with the tables, columns and lineageData LineageThe record of where a piece of data came from and everything it passed through, from source tables to the dashboards, models and AI answers built on it. in Unity Catalog.
Two details of that design are worth copying wherever you use an assistant:
- It acts with your permissions. Genie Code can reach only the data you can reach in Unity Catalog. An assistant should never be given wider access than the engineer using it.
- It sends context to the model. To answer, it sends table and column names, your code, samples of table data and cell outputs. Know what leaves your workspace before you point an assistant at sensitive tables.
Our coding agents guide covers setting one up safely.
What the assistant does not do is guarantee correctness. Generated SQL runs, but it can join on the wrong key, count a row twice or quietly drop the rows a filter did not expect. Treat it like code from a new colleague: read it, and test it against data where you know the answer.
Running models inside pipelines
The second use is newer. Both platforms let you call a language model from SQL as part of a transformation. On Snowflake the functions are available in select regions, and some are still in preview, so check each one's status before you use it in production.
| Task | Databricks AI Functions | Snowflake Cortex AI Functions |
|---|---|---|
| Any prompt, any supported model | ai_query | AI_COMPLETE |
| Put text into your own categories | ai_classify | AI_CLASSIFY |
| Pull named fields out of text | ai_extract | AI_EXTRACT |
| Read PDFs and other documents | ai_parse_document | AI_PARSE_DOCUMENT |
| Keep rows that match a question | AI_FILTER | |
| Sum up many rows of text | AI_AGG |
A support team can then classify every ticket by product and urgency in the same SQL that loads them:
SELECT
ticket_id,
ai_classify(body, ARRAY('billing', 'delivery', 'account', 'other')) AS topic
FROM raw.support_tickets;
This turns unstructured text into columns a dashboard can count, and it fits the medallionMedallion ArchitectureOrganising a lakehouse in 3 layers of rising quality: bronze for raw data, silver for cleaned and joined data, and gold for tables shaped for reports and AI. pattern: the raw text lands in bronze, and the model's output becomes a silver column. On Snowflake, a related function, AI_EMBED, makes embeddingsEmbeddingA list of numbers that stands for the meaning of a piece of text, an image or other data. Things with similar meaning get similar numbers, so a computer can find them. for similarity search.
Three things to settle before you put one in a scheduled pipeline:
- Cost. Every row is a model call. Databricks notes that the model may run on separate infrastructure billed on top of your compute. Try it on a sample, and process only new rows each run, not the whole table.
- Repeatability. A model can give a different answer to the same row on a different day, or after the model is updated. Store the output, with the model name and the date, rather than recomputing it.
- Quality. A classifier with no checks drifts unnoticed. Keep a small labelled sample and measure the function against it, the same way you would run data qualityData QualityHow far data can be trusted: complete, correct, on time and in the expected shape. Pipelines check it with rules and stop or flag rows that fail. checks on any other column.
Asking questions of data in plain words
The third use reaches past the data team. Tools such as Databricks Genie One and Snowflake Cortex Analyst (Snowflake now recommends Cortex Agents in its place) answer business questions in natural language by writing SQL for you, a task known as text to SQLText-to-SQLA model turning a question in plain words into a database query, so people can ask the data directly. It is only as right as its knowledge of the tables and their meaning.. They only work well when someone has described the data first: which tables to trust, what "revenue" means, and which joins are correct. That description, a semantic layerSemantic LayerOne shared definition of business terms and metrics, such as revenue or active customer, that reports, dashboards and AI assistants all read instead of writing their own., is data engineering work, and it is what separates a correct answer from a confident wrong one.
What changes for data engineers
Less time goes on boilerplate: the first draft of a pipeline, a test suite or the documentation of an old job. More time goes on what the AI cannot check for itself:
- Clear data. Good table and column descriptions, contractsData ContractAn agreement between the team that produces data and the teams that use it, written down and checked, that fixes its columns, meaning and freshness. and lineage make both assistants and plain-language tools more accurate.
- Tests. The faster code is written, the more the tests matter.
- Access and cost. Deciding which data a model may read, and what a model call per row costs at full volume.
The data engineering subject follows one order from the moment it is made to an AI answer, with where each step runs on Databricks.
Tecyfy Takeaway
Generative AI writes pipeline code and, through SQL functions, now runs inside pipelines too. Use the assistant for first drafts and read what it writes. Use model functions where text needs to become columns, after you have checked their cost, stored their output and measured their accuracy. The engineering work moves from writing every line to making data clear, tested and governed enough for AI to use well.
Questions
- How is generative AI used in data engineering?
- In 2 ways. It helps build pipelines: an assistant writes, fixes and explains SQL and Python. And it runs inside pipelines: a language model called from SQL turns text such as tickets, reviews and contracts into columns.
- What are AI functions in Databricks and Snowflake?
- SQL functions that call a language model row by row. Databricks has ai_query, ai_classify, ai_extract and ai_parse_document; Snowflake Cortex has AI_COMPLETE, AI_CLASSIFY, AI_EXTRACT, AI_PARSE_DOCUMENT, AI_FILTER and AI_AGG.
- What should I check before using an LLM in a data pipeline?
- Cost, because every row is a model call; repeatability, so store the output with the model name and date instead of recomputing it; and quality, measured against a small labelled sample like any other data quality check.
- Can I trust SQL written by an AI assistant?
- Not without checking. Generated SQL runs, but it can join on the wrong key, count rows twice or drop rows silently. Read it like code from a new colleague and test it against data where you know the answer.
- Why does text to SQL need a semantic layer?
- Tools such as Databricks Genie and Snowflake Cortex Analyst write SQL from plain questions, and they are much more accurate when someone has described the tables, what each metric means and how the tables join. That description is the semantic layer.
Sources