Hey <@U06PERT4XGQ>! We previously discussed “discr...
# daft-dev
j
Hey @Ismael Ghalimi! We previously discussed “discrete window groupby” functionality as one of the gaps in Daft functionality for your use-cases. I made a ticket (https://github.com/Eventual-Inc/Daft/issues/2107) would love to have you take a look and see if this is what you were looking for?
i
@jay I might be missing something, but I don't think this is a true
window
function. This looks more like a simple discretization (binning) function. For an example of
window
function, I would look at DuckDB's: https://duckdb.org/docs/sql/window_functions.html What makes it a true
window
function is the presence of sorting and grouping, alongside some
row_number
or
lag
, or group-level expressions that include some aggregations (e.g.
amount / sum(amount)
. Another way to think about it is that if you can execute what you are doing at the individual row level, it's not a
window
. And your last example looks like a plain vanilla
groupby
. In other words,
window
is inherently hard to implement... Does that make sense?
j
Ah ok! I think I misinterpreted the ask and conflated it with another user ask we’ve had around “discrete temporal groupbys” I think in our discussion we discussed window functions, and that for now it could be ok to only support window functions with partition boundaries. But these would still be full window functions that potentially overlap. I.e. Daft should add full API support for window functions in general, but overlapping windows could be supported only for the partitioned case. Sammy also had some good thoughts on the API for windowing, let me rework the issue and get back to yall again
i
Agreed. And DuckDB could be used to actually implement these, much like scalar functions.
j
👍 made a new ticket which I think is much more aligned with what you were thinking: https://github.com/Eventual-Inc/Daft/issues/2108
👍 1