---
title: "What is a UDF?"
description: "A UDF, a user-defined function, is your own logic the engine can call from a computed column or a query."
url: "https://pixeltable.com/learn/what-is-a-udf"
updated: "2026-09-29"
vertical: "Orchestration"
doc: "https://docs.pixeltable.com/datastore/computed-columns"
---

# What is a UDF?

A UDF, a user-defined function, is your own logic the engine can call from a computed column or a query.

Updated: 2026-09-29


## On this page

- [How it works](https://pixeltable.com/learn/what-is-a-udf#how-it-works)
- [What it is not](https://pixeltable.com/learn/what-is-a-udf#what-it-is-not)
- [Comparison](https://pixeltable.com/learn/what-is-a-udf#comparison)
- [Where Pixeltable fits](https://pixeltable.com/learn/what-is-a-udf#where-pixeltable-fits)
- [Questions](https://pixeltable.com/learn/what-is-a-udf#questions)

## How it works {#how-it-works}


- You write a function.
- A column calls it.
- Results cache with the row.

## What it is not {#what-it-is-not}

It is not a one-off script outside the table, and it is not a hosted function with no row cache.

## UDF: this, and the thing it is confused with {#comparison}

|  | This | Not this |
| --- | --- | --- |
| Runs | Inside the column expression | Only in your notebook |
| Cache | With the row | Nowhere |
| Reuse | Any column or query | Copy-paste |

## Where Pixeltable fits {#where-pixeltable-fits}

Pixeltable registers Python UDFs and calls them from computed columns, so custom logic participates in incremental updates.

## Questions {#questions}

### How does UDF work? {#faq-1}

You write a function. A column calls it. Results cache with the row.

### What is UDF often confused with? {#faq-2}

It is not a one-off script outside the table, and it is not a hosted function with no row cache.

## In the blog

- [Unlock Custom AI Workflows: Mastering Python UDFs in Pixeltable](https://pixeltable.com/blog/python-udfs-pixeltable)
- [Beyond AVG(): Building Custom Aggregation Functions for AI Workflows with Pixeltable UDA](https://pixeltable.com/blog/beyond-avg-custom-aggregations-uda)

## Related

- [Documentation](https://docs.pixeltable.com/datastore/computed-columns)
- [Unlock Custom AI Workflows: Mastering Python UDFs in Pixeltable](https://pixeltable.com/blog/python-udfs-pixeltable)
- [Turn Any Database Table into an AI Tool: Introducing pxt.retrieval_udf()](https://pixeltable.com/blog/retrieval-udf-database-ai-tool)
- [Computer vision pipeline](https://pixeltable.com/use-cases/computer-vision-pipeline-optimization)
