Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 1.79 KB

File metadata and controls

60 lines (44 loc) · 1.79 KB

datafusion-extra-functions

CI Crates.io

Extra aggregate functions for Apache DataFusion. This is not an official Apache Software Foundation release.

Version 0.5.5 supports DataFusion 55.0 and Rust edition 2024.

Installation

cargo add datafusion-extra-functions

From Python (datafusion-python 55), install the FFI wheel and register aggregates via the PyCapsule protocol. See python/README.md.

pip install datafusion-extra-functions

Register all functions with your session context:

datafusion_extra_functions::register_all_extra_functions(&mut ctx)?;

Available functions

Function Description
mode(expression) Returns most frequent value.
max_by(value, key) Returns value at maximum key.
min_by(value, key) Returns value at minimum key.
skewness(expression) Computes skewness.
kurtosis_pop(expression) Computes population excess kurtosis.
kurtosis(expression) Computes sample excess kurtosis.
SELECT mode(city) FROM visits;
SELECT max_by(user_id, score) FROM results;
SELECT min_by(user_id, score) FROM results;
SELECT skewness(measurement) FROM readings;
SELECT kurtosis_pop(measurement) FROM readings;
SELECT kurtosis(measurement) FROM readings;

Testing

cargo test

Python bindings (from python/):

pip install maturin pytest
maturin develop --release
pytest