# Function

In DeltaStream, **functions** refer to user-defined functions that extend DeltaStream's processing capabilities. There are multiple built-in functions available you can use in your queries. You can also create and implement more functions and add them to DeltaStream via function declaration syntax.

There are three types of functions you can declare in DeltaStream.

1. **UDFs** (User-Defined Functions): These functions can have zero or more arguments and return one value.
2. **UDAFs** (User-Defined Aggregate Functions): These functions compute values across multiple rows (events) and return one value.
3. **UDTFs** (User-Defined Table Functions): These functions can have zero or more input arguments, but they return multiple values that can result in multiple rows in the output.

{% hint style="info" %}
**Note** As DeltaStream is powered by [Apache Flink](https://flink.apache.org/), you can implement functions as Apache Flink user-defined functions. For more details, see the corresponding [Apache Flink documentation](https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/functions/udfs/).
{% endhint %}

Package the implemented functions, plus their dependencies, in a [JAR](https://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html) file and upload the JAR file to DeltaStream. Then you can declare a new function and add it to the functions already available in DeltaStream.

You can use the declared function in the expressions in your DeltaStream queries.

For more details, see [Create a Function](/how-do-i.../creating-a-function.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.deltastream.io/overview/core-concepts/function.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
