Support variable window aggregation through ODFV

Open
#6,308 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cassandra, python

Research direction

Start by tracing the existing on-demand feature view API, including its raw data source, Field, and Aggregation handling. Compare how variable-window aggregations are currently validated and persisted, then determine where an optional input_schema can replace the raw source. Done means the supplied example works without a dummy source and supports reading and writing the aggregation data.

Written by the indexing model from the issue text.

Description

kind/feature

Is your feature request related to a problem? Please describe.
Currently, feast supports dynamic aggregation through ODFV from raw data source. For variable window aggregation, the features are independently computed so there is no raw source but aggregation is still being read / written.

Describe the solution you'd like
We want to allow users to not define raw data source but instead replace data source with new optional input_schema field to define raw data input type. For example, instead of passing in txn_amount from external feature view, it is submitted as input_schema. See example below:

@on_demand_feature_view(
      input_schema=[
          Field(name="txn_amount", dtype=Float64),
      ],
      schema=[
          Field(name="txn_count", dtype=Int64),
          Field(name="total_txn_amount", dtype=Float64),
          Field(name="avg_txn_amount", dtype=Float64),
      ],
      aggregations=[
          Aggregation(column="txn_amount", function="count", name="txn_count",
                      window=timedelta(days=30)),
          Aggregation(column="txn_amount", function="sum", name="total_txn_amount",
                      window=timedelta(days=30)),
          Aggregation(column="txn_amount", function="mean", name="avg_txn_amount",
                      window=timedelta(days=30)),
      ],
      entities=[user],
      write_to_online_store=True,
  )

This allows dynamic systems like cassandra or iceberg that support time series data representations, to support variable window engines which support writing and reading to / from same source.

Describe alternatives you've considered
Using dummy source (confusing, needlessly complex), using aggregation on feature view (not supported)

Dominant language
Python
Stars
7.4k
Forks
1.5k
Avg merge
2d 6h
Merged PRs (30d)
107

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from feast-dev/feast

All issues in feast-dev/feast

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.