apache / apache/texera

Cut a numeric column into bins

Open
#8,479 0 comments 0 reactions 1 assignee Claimed by @kz930 View on GitHub
Dominant language
Scala
Stars
314
Forks
187
Avg merge
1d 21h
Merged PRs (30d)
214

Description

### Task Summary

The same gap as #8478, on the other kind of column. Grouping by a continuous number puts almost every row in a group of its own, so counts per age bracket or per price band cannot be asked for. A user wanting them had to write a Python UDF.

An operator that cuts a numeric column into bins closes it. Two cuts, because they answer different questions: equal width divides the span into bins of one size, and equal frequency cuts at the quantiles so the bins hold about as many rows as each other. The bin reads as its own range, `(2.5, 5.0]`, which is a label to group by rather than a number to do arithmetic on.

It reads the whole table before it emits, since a quantile is not known until the last row has arrived.

Not part of #8325: nothing here makes a workflow exportable. It does ship standalone code, so it comes after the trait #8327 introduces, and its parity assertions need the harness that issue builds.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.