#datafusion #expressions #plan #logical

datafusion-functions-aggregate

Aggregate function packages for the DataFusion query engine

1 stable release

38.0.0 May 10, 2024

#532 in Rust patterns

Download history 5423/week @ 2024-05-09 52036/week @ 2024-05-16 63466/week @ 2024-05-23 54831/week @ 2024-05-30

175,756 downloads per month
Used in 35 crates (3 directly)

Apache-2.0

2MB
37K SLoC

Aggregate Function packages for DataFusion.

This crate contains a collection of various aggregate function packages for DataFusion, implemented using the extension API. Users may wish to control which functions are available to control the binary size of their application as well as use dialect specific implementations of functions (e.g. Spark vs Postgres)

Each package is implemented as a separate module, activated by a feature flag.

Available Packages

See the list of modules in this crate for available packages.

Using A Package

You can register all functions in all packages using the register_all function.

Each package also exports an expr_fn submodule to help create Exprs that invoke functions using a fluent style. For example:

Implementing A New Package

To add a new package to this crate, you should follow the model of existing packages. The high level steps are:

  1. Create a new module with the appropriate [AggregateUDF] implementations.

  2. Use the macros in macros to create standard entry points.

  3. Add a new feature to Cargo.toml, with any optional dependencies

  4. Use the make_package! macro to expose the module when the feature is enabled.

Dependencies

~23–38MB
~621K SLoC