Skip to main content

feature_views

Creates, updates, deletes, gets or lists a feature_views resource.

Overview

Namefeature_views
TypeResource
Idgoogle.aiplatform.feature_views

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. Name of the FeatureView. Format: projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}
bigQuerySourceobjectOptional. Configures how data is supposed to be extracted from a BigQuery source to be loaded onto the FeatureOnlineStore. (id: GoogleCloudAiplatformV1FeatureViewBigQuerySource)
createTimestring (google-datetime)Output only. Timestamp when this FeatureView was created.
etagstringOptional. Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.
featureRegistrySourceobjectOptional. Configures the features from a Feature Registry source that need to be loaded onto the FeatureOnlineStore. (id: GoogleCloudAiplatformV1FeatureViewFeatureRegistrySource)
indexConfigobjectOptional. Configuration for index preparation for vector search. It contains the required configurations to create an index from source data, so that approximate nearest neighbor (a.k.a ANN) algorithms search can be performed during online serving. (id: GoogleCloudAiplatformV1FeatureViewIndexConfig)
labelsobjectOptional. The labels with user-defined metadata to organize your FeatureViews. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information on and examples of labels. No more than 64 user labels can be associated with one FeatureOnlineStore(System labels are excluded)." System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable.
optimizedConfigobjectOptional. Configuration for FeatureView created under Optimized FeatureOnlineStore. (id: GoogleCloudAiplatformV1FeatureViewOptimizedConfig)
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
serviceAccountEmailstringOutput only. A Service Account unique to this FeatureView. The role bigquery.dataViewer should be granted to this service account to allow Vertex AI Feature Store to sync data to the online store.
serviceAgentTypestringOptional. Service agent type used during data sync. By default, the Vertex AI Service Agent is used. When using an IAM Policy to isolate this FeatureView within a project, a separate service account should be provisioned by setting this field to SERVICE_AGENT_TYPE_FEATURE_VIEW. This will generate a separate service account to access the BigQuery source table.
syncConfigobjectConfigures when data is to be synced/updated for this FeatureView. At the end of the sync the latest featureValues for each entityId of this FeatureView are made ready for online serving. (id: GoogleCloudAiplatformV1FeatureViewSyncConfig)
updateTimestring (google-datetime)Output only. Timestamp when this FeatureView was last updated.
vertexRagSourceobjectOptional. The Vertex RAG Source that the FeatureView is linked to. (id: GoogleCloudAiplatformV1FeatureViewVertexRagSource)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, featureOnlineStoresId, featureViewsIdGets details of a single FeatureView.
listselectprojectsId, locationsId, featureOnlineStoresIdfilter, pageSize, pageToken, orderByLists FeatureViews in a given FeatureOnlineStore.
createinsertprojectsId, locationsId, featureOnlineStoresIdfeatureViewId, runSyncImmediatelyCreates a new FeatureView in a given FeatureOnlineStore.
patchupdateprojectsId, locationsId, featureOnlineStoresId, featureViewsIdupdateMaskUpdates the parameters of a single FeatureView.
deletedeleteprojectsId, locationsId, featureOnlineStoresId, featureViewsIdDeletes a single FeatureView.
syncexecprojectsId, locationsId, featureOnlineStoresId, featureViewsIdTriggers on-demand sync for the FeatureView.
fetch_feature_valuesexecprojectsId, locationsId, featureOnlineStoresId, featureViewsIdFetch feature values under a FeatureView.
search_nearest_entitiesexecprojectsId, locationsId, featureOnlineStoresId, featureViewsIdSearch the nearest entities under a FeatureView. Search only works for indexable feature view; if a feature view isn't indexable, returns Invalid argument response.
direct_writeexecprojectsId, locationsId, featureOnlineStoresId, featureViewsIdBidirectional streaming RPC to directly write to feature values in a feature view. Requests may not have a one-to-one mapping to responses and responses may be returned out-of-order to reduce latency.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
featureOnlineStoresIdstring
featureViewsIdstring
locationsIdstring
projectsIdstring
featureViewIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
runSyncImmediatelyboolean
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single FeatureView.

SELECT
name,
bigQuerySource,
createTime,
etag,
featureRegistrySource,
indexConfig,
labels,
optimizedConfig,
satisfiesPzi,
satisfiesPzs,
serviceAccountEmail,
serviceAgentType,
syncConfig,
updateTime,
vertexRagSource
FROM google.aiplatform.feature_views
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND featureOnlineStoresId = '{{ featureOnlineStoresId }}' -- required
AND featureViewsId = '{{ featureViewsId }}' -- required;

INSERT examples

Creates a new FeatureView in a given FeatureOnlineStore.

INSERT INTO google.aiplatform.feature_views (
data__bigQuerySource,
data__featureRegistrySource,
data__vertexRagSource,
data__name,
data__etag,
data__labels,
data__syncConfig,
data__indexConfig,
data__optimizedConfig,
data__serviceAgentType,
projectsId,
locationsId,
featureOnlineStoresId,
featureViewId,
runSyncImmediately
)
SELECT
'{{ bigQuerySource }}',
'{{ featureRegistrySource }}',
'{{ vertexRagSource }}',
'{{ name }}',
'{{ etag }}',
'{{ labels }}',
'{{ syncConfig }}',
'{{ indexConfig }}',
'{{ optimizedConfig }}',
'{{ serviceAgentType }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ featureOnlineStoresId }}',
'{{ featureViewId }}',
'{{ runSyncImmediately }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single FeatureView.

UPDATE google.aiplatform.feature_views
SET
data__bigQuerySource = '{{ bigQuerySource }}',
data__featureRegistrySource = '{{ featureRegistrySource }}',
data__vertexRagSource = '{{ vertexRagSource }}',
data__name = '{{ name }}',
data__etag = '{{ etag }}',
data__labels = '{{ labels }}',
data__syncConfig = '{{ syncConfig }}',
data__indexConfig = '{{ indexConfig }}',
data__optimizedConfig = '{{ optimizedConfig }}',
data__serviceAgentType = '{{ serviceAgentType }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND featureOnlineStoresId = '{{ featureOnlineStoresId }}' --required
AND featureViewsId = '{{ featureViewsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single FeatureView.

DELETE FROM google.aiplatform.feature_views
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND featureOnlineStoresId = '{{ featureOnlineStoresId }}' --required
AND featureViewsId = '{{ featureViewsId }}' --required;

Lifecycle Methods

Triggers on-demand sync for the FeatureView.

EXEC google.aiplatform.feature_views.sync 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@featureOnlineStoresId='{{ featureOnlineStoresId }}' --required,
@featureViewsId='{{ featureViewsId }}' --required;