-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Adding 'SortedFeatureView' type to support Range Queries #168
Conversation
// System-populated metadata for this feature view. | ||
FeatureViewMeta meta = 2; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This empty line can be removed.
import "feast/core/DataSource.proto"; | ||
import "feast/core/Entity.proto"; | ||
import "feast/core/Feature.proto"; | ||
import "feast/core/FeatureView.proto"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import FeatureView can be removed?
SortedFeatureViewSpec spec = 1; | ||
|
||
// System-populated metadata for this feature view. | ||
FeatureViewMeta meta = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FeatureViewMeta
definition is missing, this needs to be defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FeatureViewMeta
is defined in FeatureView.proto which is why it is imported
|
||
// Batch/Offline DataSource where this view can retrieve offline feature data. | ||
DataSource batch_source = 7; | ||
// Streaming DataSource from where this view can consume "online" feature data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need an empty line here? (between batch and stream source definitions)
repeated FeatureSpecV2 entity_columns = 12; | ||
|
||
// List of sort keys for this feature view. | ||
repeated SortKey sort_keys = 31; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I was thinking we decided not to allow more than one field as a sort key, we need to double check this about whether we want to allow multiple fields as sort keys or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to buffer the index for this field, it is a critical field for this feature view type, so just use index 13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on using index 13. This is completely new implementation.
|
||
// Defines the sorting criteria for range-based feature queries. | ||
message SortKey { | ||
// Name of the feature or entity used for sorting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name of the feature or entity used for sorting.
Entities in feature view maps to partition key in Scylla db and not used as a sort key right? You think we should remove entity
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, will remove
@@ -40,6 +41,12 @@ service RegistryServer{ | |||
rpc GetFeatureView (GetFeatureViewRequest) returns (feast.core.FeatureView) {} | |||
rpc ListFeatureViews (ListFeatureViewsRequest) returns (ListFeatureViewsResponse) {} | |||
|
|||
// SortedFeatureView RPCs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check but are you sure that you need to have ApplySortedFeatureView
and DeleteSortedFeatureView
here? Because for example if you look at StreamFeatureView or OnDemandFeatureView RPCs below, they only have Get and List. I think it should be similar for SortedFeatureView too, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generic Apply and Delete rpcs should handle all feature view types, we don't need specific ones for SortedFeatureView.
@@ -277,6 +286,36 @@ message ListOnDemandFeatureViewsResponse { | |||
repeated feast.core.OnDemandFeatureView on_demand_feature_views = 1; | |||
} | |||
|
|||
// SortedFeatureView for range queries | |||
|
|||
message ApplySortedFeatureViewRequest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed if we know that Apply and Delete is not needed for SortedFeatureView.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for remote registry. We should implement it for remote registry.
repeated feast.core.SortedFeatureView sorted_feature_views = 1; | ||
} | ||
|
||
message DeleteSortedFeatureViewRequest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, this can be removed if we know that Apply and Delete is not needed for SortedFeatureView.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for Remote registry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remote registry already uses the generic apply and delete methods that internally handle the logic for different feature view types. I think it's best to keep this consistent and not make a special case here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah agree, the delete looks generic for all feature view types. For example, we just need to add logic for our SortedFeatureView type here in the existing DeleteFeatureView
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove ApplySortedFeatureView and DeleteSortedFeatureViews.
@@ -421,4 +460,4 @@ message ListProjectsResponse { | |||
message DeleteProjectRequest { | |||
string name = 1; | |||
bool commit = 2; | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and this is not the right place to comment, but you should also add SortedFeatureView to Registry.proto somewhere over here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I missed that, thanks!
} | ||
|
||
// A collection of multiple SortedFeatureViews. | ||
message SortedFeatureViewList { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant with ListSortedFeatureViewsResponse
below and not needed.
@@ -217,6 +225,7 @@ message AnyFeatureView { | |||
feast.core.FeatureView feature_view = 1; | |||
feast.core.OnDemandFeatureView on_demand_feature_view = 2; | |||
feast.core.StreamFeatureView stream_feature_view = 3; | |||
feast.core.SortedFeatureView sorted_feature_view = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave a buffer on the index for sorted feature view in case Feast adds other feature views and we get a conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add SortedFeatureView
similar to the other feature view types to the Registry.proto (not RegistryServer) as well.
…, RegistryServer.proto and SortedFeatureView.proto
What this PR does / why we need it:
Updating the feast protos with a new FeatureView type 'SortedFeatureView' used specifically for range series support.