Skip to content

Commit e1973aa

Browse files
author
zhilingc
committed
Differentiate batch and online feature requests
1 parent 36163e8 commit e1973aa

1 file changed

Lines changed: 64 additions & 12 deletions

File tree

protos/feast/serving/ServingService.proto

Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ service ServingService {
3434
rpc GetFeastServingType (GetFeastServingTypeRequest) returns (GetFeastServingTypeResponse);
3535

3636
// Get online features synchronously.
37-
rpc GetOnlineFeatures (GetFeaturesRequest) returns (GetOnlineFeaturesResponse);
37+
rpc GetOnlineFeatures (GetOnlineFeaturesRequest) returns (GetOnlineFeaturesResponse);
3838

39-
// Get batch features asynchronously.
40-
//
39+
// Get batch features asynchronously.
40+
//
4141
// The client should check the status of the returned job periodically by
42-
// calling ReloadJob to determine if the job has completed successfully
42+
// calling ReloadJob to determine if the job has completed successfully
4343
// or with an error. If the job completes successfully i.e.
4444
// status = JOB_STATUS_DONE with no error, then the client can check
4545
// the file_uris for the location to download feature values data.
4646
// The client is assumed to have access to these file URIs.
47-
rpc GetBatchFeatures (GetFeaturesRequest) returns (GetBatchFeaturesResponse);
47+
rpc GetBatchFeatures (GetBatchFeaturesRequest) returns (GetBatchFeaturesResponse);
4848

4949
// Get the latest job status for batch feature retrieval.
5050
rpc GetJob (GetJobRequest) returns (GetJobResponse);
@@ -62,7 +62,7 @@ message GetFeastServingTypeResponse {
6262
FeastServingType type = 1;
6363
}
6464

65-
message GetFeaturesRequest {
65+
message GetOnlineFeaturesRequest {
6666

6767
// List of feature sets and their features that are being retrieved
6868
repeated FeatureSet feature_sets = 1;
@@ -72,6 +72,8 @@ message GetFeaturesRequest {
7272
// rows into a final dataset
7373
repeated EntityRow entity_rows = 2;
7474

75+
// Option to omit entities from the response. If true, only feature
76+
// values will be returned.
7577
bool omit_entities_in_response = 3;
7678

7779
message FeatureSet {
@@ -87,7 +89,7 @@ message GetFeaturesRequest {
8789
// The features will be retrieved if:
8890
// entity_timestamp - max_age <= event_timestamp <= entity_timestamp
8991
//
90-
// If unspecified the default max_age specified in FeatureSetSpec will
92+
// If unspecified the default max_age specified in FeatureSetSpec will
9193
// be used.
9294
google.protobuf.Duration max_age = 4;
9395
}
@@ -103,12 +105,41 @@ message GetFeaturesRequest {
103105
}
104106
}
105107

108+
message GetBatchFeaturesRequest {
109+
110+
// List of feature sets and their features that are being retrieved.
111+
repeated FeatureSet feature_sets = 1;
112+
113+
// Source of the entity dataset containing the timestamps and entity keys to retrieve
114+
// features for.
115+
DatasetSource dataset_source = 2;
116+
117+
message FeatureSet {
118+
// Feature set name
119+
string name = 1;
120+
121+
// Feature set version
122+
int32 version = 2;
123+
124+
// Features that should be retrieved from this feature set
125+
repeated string feature_names = 3;
126+
127+
// The features will be retrieved if:
128+
// entity_timestamp - max_age <= event_timestamp <= entity_timestamp
129+
//
130+
// If unspecified the default max_age specified in FeatureSetSpec will
131+
// be used.
132+
google.protobuf.Duration max_age = 4;
133+
}
134+
}
135+
106136
message GetOnlineFeaturesResponse {
137+
// Feature values retrieved from feast.
107138
repeated FieldValues field_values = 1;
108139

109-
// TODO: update this comment
110-
// does not include timestamp, includes features and entities
111140
message FieldValues {
141+
// Map of feature or entity name to feature/entity values.
142+
// Timestamps are not returned in this response.
112143
map<string,feast.types.Value> fields = 1;
113144
}
114145
}
@@ -127,10 +158,10 @@ message GetJobResponse {
127158

128159
enum FeastServingType {
129160
FEAST_SERVING_TYPE_INVALID = 0;
130-
// Online serving receives entity data directly and synchronously and will
161+
// Online serving receives entity data directly and synchronously and will
131162
// respond immediately.
132163
FEAST_SERVING_TYPE_ONLINE = 1;
133-
// Batch serving receives entity data asynchronously and orchestrates the
164+
// Batch serving receives entity data asynchronously and orchestrates the
134165
// retrieval through a staging location.
135166
FEAST_SERVING_TYPE_BATCH = 2;
136167
}
@@ -163,10 +194,31 @@ message Job {
163194
JobStatus status = 3;
164195
// Output only. If not empty, the job has failed with this error message.
165196
string error = 4;
166-
// Output only. The list of URIs for the files to be downloaded or
197+
// Output only. The list of URIs for the files to be downloaded or
167198
// uploaded (depends on the job type) for this particular job.
168199
repeated string file_uris = 5;
169200
// Output only. The data format for all the files.
170201
// For CSV format, the files contain both feature values and a column header.
171202
DataFormat data_format = 6;
172203
}
204+
205+
message DatasetSource {
206+
oneof dataset_source {
207+
// SQL query to generate the dataset from. It is recommended that the SQL follows the
208+
// ANSI standard.
209+
string sql_query = 1;
210+
211+
// File source to load the dataset from.
212+
FileSource file_source = 2;
213+
}
214+
215+
message FileSource {
216+
// URIs to retrieve the dataset from, e.g. gs://bucket/directory/object.csv. Wildcards are
217+
// supported. This data must be compatible to be uploaded to the serving store, and also be
218+
// accessible by this serving instance.
219+
repeated string file_uris = 1;
220+
221+
// Format of the data.
222+
DataFormat data_format = 2;
223+
}
224+
}

0 commit comments

Comments
 (0)