aggs_for_arrays
Various functions for computing statistics on arrays of numbers
aggs_for_arrays : Various functions for computing statistics on arrays of numbers
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4750 | aggs_for_arrays | aggs_for_arrays | 1.3.3 |
FUNC | MIT | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | intarray arraymath aggs_for_vecs floatvec |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.3.3 |
18 17 16 15 14 | aggs_for_arrays |
- |
| RPM | PIGSTY | 1.3.3 |
18 17 16 15 14 | aggs_for_arrays_$v |
- |
| DEB | PIGSTY | 1.3.3 |
18 17 16 15 14 | postgresql-$v-aggs-for-arrays |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| el8.aarch64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| el9.x86_64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| el9.aarch64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| el10.x86_64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| el10.aarch64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| d12.x86_64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| d12.aarch64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| d13.x86_64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| d13.aarch64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| u22.x86_64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| u22.aarch64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| u24.x86_64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| u24.aarch64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| u26.x86_64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
| u26.aarch64 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 | PIGSTY 1.3.3 |
Source
github.com/pjungwir/aggs_for_arrays
aggs_for_arrays-1.3.3.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
aggs_for_arrays: aggregate-like functions for single arrays (column-based)
Provides functions that compute statistics on a single array input. Supports SMALLINT, INTEGER, BIGINT, REAL, and DOUBLE PRECISION.
Functions
| Function | Description |
|---|---|
array_to_hist(values T[], start T, width T, count INT) |
Compute histogram bucket counts |
array_to_hist_2d(x[], y[], ...) |
2-D histogram |
array_to_mean(values T[]) |
Mean of array elements |
array_to_median(values T[]) |
Median (unsorted input OK) |
sorted_array_to_median(values T[]) |
Median (pre-sorted input) |
array_to_mode(values T[]) |
Mode of array elements |
sorted_array_to_mode(values T[]) |
Mode (pre-sorted input) |
array_to_percentile(values T[], pct FLOAT) |
Percentile (0 to 1) |
sorted_array_to_percentile(values T[], pct FLOAT) |
Percentile (pre-sorted input) |
array_to_percentiles(values T[], pcts FLOAT[]) |
Multiple percentiles |
sorted_array_to_percentiles(values T[], pcts FLOAT[]) |
Multiple percentiles (pre-sorted) |
array_to_max(values T[]) |
Maximum element |
array_to_min(values T[]) |
Minimum element |
array_to_min_max(values T[]) |
{min, max} tuple |
array_to_skewness(values T[]) |
Skewness |
array_to_kurtosis(values T[]) |
Kurtosis |