feast-dev / feast

The Open Source Feature Store for Machine Learning
https://feast.dev
Apache License 2.0
5.62k stars 1k forks source link

Use ASOF JOIN in Snowflake Source #4732

Open nanohanno opened 3 weeks ago

nanohanno commented 3 weeks ago

Is your feature request related to a problem? Please describe.

Requesting historical features from Snowflake uses multiple intermediate results to do the point-in-time correct join. Recently, a new Snowflake feature was released which does exactly what we would expect from the join: ASOF JOIN (https://www.snowflake.com/en/blog/time-series-analytics-asof-join-generally-available/). The reported improvements in efficiency are very substantial.

Describe the solution you'd like

Could we use the ASOF JOIN in https://github.com/feast-dev/feast/blame/d1d80c0d208e25b92047fe5f162c67c00c69bb43/sdk/python/feast/infra/offline_stores/snowflake.py#L717 to improve efficiency of the query? From a superficial view it seems to be possible, only the ttl feature might be difficult with ASOF JOINs.

Describe alternatives you've considered

Additional context