Skip to content

Commit 8c74a4f

Browse files
Google APIscopybara-github
authored andcommitted
feat: add FeatureViewDirectWrite API in v1
PiperOrigin-RevId: 790876671
1 parent f26b1c8 commit 8c74a4f

File tree

6 files changed

+101
-13
lines changed

6 files changed

+101
-13
lines changed

google/cloud/aiplatform/v1/aiplatform_v1.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -759,11 +759,7 @@ authentication:
759759
oauth:
760760
canonical_scopes: |-
761761
https://www.googleapis.com/auth/cloud-platform
762-
- selector: google.cloud.aiplatform.v1.FeatureOnlineStoreService.FetchFeatureValues
763-
oauth:
764-
canonical_scopes: |-
765-
https://www.googleapis.com/auth/cloud-platform
766-
- selector: google.cloud.aiplatform.v1.FeatureOnlineStoreService.SearchNearestEntities
762+
- selector: 'google.cloud.aiplatform.v1.FeatureOnlineStoreService.*'
767763
oauth:
768764
canonical_scopes: |-
769765
https://www.googleapis.com/auth/cloud-platform

google/cloud/aiplatform/v1/feature_online_store_service.proto

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/cloud/aiplatform/v1/featurestore_online_service.proto";
2424
import "google/protobuf/struct.proto";
25+
import "google/protobuf/timestamp.proto";
26+
import "google/rpc/status.proto";
2527

2628
option csharp_namespace = "Google.Cloud.AIPlatform.V1";
2729
option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb";
@@ -57,6 +59,17 @@ service FeatureOnlineStoreService {
5759
body: "*"
5860
};
5961
}
62+
63+
// Bidirectional streaming RPC to directly write to feature values in a
64+
// feature view. Requests may not have a one-to-one mapping to responses and
65+
// responses may be returned out-of-order to reduce latency.
66+
rpc FeatureViewDirectWrite(stream FeatureViewDirectWriteRequest)
67+
returns (stream FeatureViewDirectWriteResponse) {
68+
option (google.api.http) = {
69+
post: "/v1/{feature_view=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:directWrite"
70+
body: "*"
71+
};
72+
}
6073
}
6174

6275
// Format of the data in the Feature View.
@@ -329,3 +342,75 @@ message SearchNearestEntitiesResponse {
329342
// The nearest neighbors of the query entity.
330343
NearestNeighbors nearest_neighbors = 1;
331344
}
345+
346+
// Request message for
347+
// [FeatureOnlineStoreService.FeatureViewDirectWrite][google.cloud.aiplatform.v1.FeatureOnlineStoreService.FeatureViewDirectWrite].
348+
message FeatureViewDirectWriteRequest {
349+
// A data key and associated feature values to write to the feature view.
350+
message DataKeyAndFeatureValues {
351+
// Feature name & value pair.
352+
message Feature {
353+
// Feature value data to write.
354+
oneof data_oneof {
355+
// Feature value. A user provided timestamp may be set in the
356+
// `FeatureValue.metadata.generate_time` field.
357+
FeatureValue value = 3;
358+
}
359+
360+
// Feature short name.
361+
string name = 1;
362+
}
363+
364+
// The data key.
365+
FeatureViewDataKey data_key = 1;
366+
367+
// List of features to write.
368+
repeated Feature features = 2;
369+
}
370+
371+
// FeatureView resource format
372+
// `projects/{project}/locations/{location}/featureOnlineStores/{featureOnlineStore}/featureViews/{featureView}`
373+
string feature_view = 1 [(google.api.resource_reference) = {
374+
type: "aiplatform.googleapis.com/FeatureView"
375+
}];
376+
377+
// Required. The data keys and associated feature values.
378+
repeated DataKeyAndFeatureValues data_key_and_feature_values = 2
379+
[(google.api.field_behavior) = REQUIRED];
380+
}
381+
382+
// Response message for
383+
// [FeatureOnlineStoreService.FeatureViewDirectWrite][google.cloud.aiplatform.v1.FeatureOnlineStoreService.FeatureViewDirectWrite].
384+
message FeatureViewDirectWriteResponse {
385+
// Details about the write for each key.
386+
message WriteResponse {
387+
// What key is this write response associated with.
388+
FeatureViewDataKey data_key = 1;
389+
390+
// When the feature values were written to the online store.
391+
// If
392+
// [FeatureViewDirectWriteResponse.status][google.cloud.aiplatform.v1.FeatureViewDirectWriteResponse.status]
393+
// is not OK, this field is not populated.
394+
google.protobuf.Timestamp online_store_write_time = 2;
395+
}
396+
397+
// Response status for the keys listed in
398+
// [FeatureViewDirectWriteResponse.write_responses][google.cloud.aiplatform.v1.FeatureViewDirectWriteResponse.write_responses].
399+
//
400+
// The error only applies to the
401+
// listed data keys - the stream will remain open for further
402+
// [FeatureOnlineStoreService.FeatureViewDirectWriteRequest][] requests.
403+
//
404+
// Partial failures (e.g. if the first 10 keys of a request fail, but the
405+
// rest succeed) from a single request may result in multiple responses -
406+
// there will be one response for the successful request keys and one response
407+
// for the failing request keys.
408+
google.rpc.Status status = 1;
409+
410+
// Details about write for each key. If status is not OK,
411+
// [WriteResponse.data_key][google.cloud.aiplatform.v1.FeatureViewDirectWriteResponse.WriteResponse.data_key]
412+
// will have the key with error, but
413+
// [WriteResponse.online_store_write_time][google.cloud.aiplatform.v1.FeatureViewDirectWriteResponse.WriteResponse.online_store_write_time]
414+
// will not be present.
415+
repeated WriteResponse write_responses = 2;
416+
}

google/cloud/aiplatform/v1/featurestore_online_service.proto

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,11 @@ message FeatureValue {
238238
// Feature generation timestamp. Typically, it is provided by user at
239239
// feature ingestion time. If not, feature store
240240
// will use the system timestamp when the data is ingested into feature
241-
// store. For streaming ingestion, the time, aligned by days, must be no
242-
// older than five years (1825 days) and no later than one year (366 days)
243-
// in the future.
241+
// store.
242+
//
243+
// Legacy Feature Store: For streaming ingestion, the time, aligned by days,
244+
// must be no older than five years (1825 days) and no later than one year
245+
// (366 days) in the future.
244246
google.protobuf.Timestamp generate_time = 1;
245247
}
246248

google/cloud/aiplatform/v1/featurestore_service.proto

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,6 @@ message SearchFeaturesRequest {
11761176
// containing the substring `foo` and description containing the substring
11771177
// `bar`.
11781178
//
1179-
//
11801179
// Besides field queries, the following exact-match filters are
11811180
// supported. The exact-match filters do not support wildcards. Unlike
11821181
// field-restricted queries, exact-match filters are case-sensitive.

google/cloud/aiplatform/v1beta1/feature_online_store_service.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,10 @@ message FeatureViewDirectWriteRequest {
442442

443443
// Feature value data to write.
444444
oneof data_oneof {
445+
// Feature value. A user provided timestamp may be set in the
446+
// `FeatureValue.metadata.generate_time` field.
447+
FeatureValue value = 3;
448+
445449
// Feature value and timestamp.
446450
FeatureValueAndTimestamp value_and_timestamp = 2;
447451
}

google/cloud/aiplatform/v1beta1/featurestore_online_service.proto

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ message ReadFeatureValuesResponse {
206206
}
207207

208208
// Request message for
209-
// [FeaturestoreOnlineServingService.StreamingFeatureValuesRead][].
209+
// [FeaturestoreOnlineServingService.StreamingReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.StreamingReadFeatureValues].
210210
message StreamingReadFeatureValuesRequest {
211211
// Required. The resource name of the entities' type.
212212
// Value format:
@@ -238,9 +238,11 @@ message FeatureValue {
238238
// Feature generation timestamp. Typically, it is provided by user at
239239
// feature ingestion time. If not, feature store
240240
// will use the system timestamp when the data is ingested into feature
241-
// store. For streaming ingestion, the time, aligned by days, must be no
242-
// older than five years (1825 days) and no later than one year (366 days)
243-
// in the future.
241+
// store.
242+
//
243+
// Legacy Feature Store: For streaming ingestion, the time, aligned by days,
244+
// must be no older than five years (1825 days) and no later than one year
245+
// (366 days) in the future.
244246
google.protobuf.Timestamp generate_time = 1;
245247
}
246248

0 commit comments

Comments
 (0)