Method: projects.locations.featurestores.batchReadFeatureValues

Batch reads Feature values from a Featurestore.

This API enables batch reading Feature values, where each read instance in the batch may read Feature values of entities from one or more EntityTypes. Point-in-time correctness is guaranteed for Feature values of each read instance as of each instance's read timestamp.

HTTP request

POST https://{service-endpoint}/v1/{featurestore}:batchReadFeatureValues

Where {service-endpoint} is one of the supported service endpoints.

Path parameters

Parameters
featurestore

string

Required. The resource name of the Featurestore from which to query Feature values. Format: projects/{project}/locations/{location}/featurestores/{featurestore}

Request body

The request body contains data with the following structure:

JSON representation
{
  "destination": {
    object (FeatureValueDestination)
  },
  "passThroughFields": [
    {
      object (PassThroughField)
    }
  ],
  "entityTypeSpecs": [
    {
      object (EntityTypeSpec)
    }
  ],

  // Union field read_option can be only one of the following:
  "csvReadInstances": {
    object (CsvSource)
  },
  "bigqueryReadInstances": {
    object (BigQuerySource)
  }
  // End of list of possible types for union field read_option.
}
Fields
destination

object (FeatureValueDestination)

Required. Specifies output location and format.

passThroughFields[]

object (PassThroughField)

When not empty, the specified fields in the *_read_instances source will be joined as-is in the output, in addition to those fields from the Featurestore Entity.

For BigQuery source, the type of the pass-through values will be automatically inferred. For CSV source, the pass-through values will be passed as opaque bytes.

entityTypeSpecs[]

object (EntityTypeSpec)

Required. Specifies EntityType grouping Features to read values of and settings. Each EntityType referenced in [BatchReadFeatureValuesRequest.entity_type_specs] must have a column specifying entity IDs in the EntityType in [BatchReadFeatureValuesRequest.request][] .

Union field read_option.

read_option can be only one of the following:

csvReadInstances

object (CsvSource)

Each read instance consists of exactly one read timestamp and one or more entity IDs identifying entities of the corresponding EntityTypes whose Features are requested.

Each output instance contains Feature values of requested entities concatenated together as of the read time.

An example read instance may be foo_entity_id, bar_entity_id, 2020-01-01T10:00:00.123Z.

An example output instance may be foo_entity_id, bar_entity_id, 2020-01-01T10:00:00.123Z, foo_entity_feature1_value, bar_entity_feature2_value.

Timestamp in each read instance must be millisecond-aligned.

csvReadInstances are read instances stored in a plain-text CSV file. The header should be: [ENTITY_TYPE_ID1], [ENTITY_TYPE_ID2], ..., timestamp

The columns can be in any order.

Values in the timestamp column must use the RFC 3339 format, e.g. 2012-07-30T10:43:17.123Z.

bigqueryReadInstances

object (BigQuerySource)

Similar to csvReadInstances, but from BigQuery source.

Response body

If successful, the response body contains an instance of Operation.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the featurestore resource:

  • aiplatform.featurestores.batchReadFeatureValues

For more information, see the IAM documentation.

PassThroughField

Describe pass-through fields in read_instance source.

JSON representation
{
  "fieldName": string
}
Fields
fieldName

string

Required. The name of the field in the CSV header or the name of the column in BigQuery table. The naming restriction is the same as Feature.name.

EntityTypeSpec

Selects Features of an EntityType to read values of and specifies read settings.

JSON representation
{
  "entityTypeId": string,
  "featureSelector": {
    object (FeatureSelector)
  },
  "settings": [
    {
      object (DestinationFeatureSetting)
    }
  ]
}
Fields
entityTypeId

string

Required. ID of the EntityType to select Features. The EntityType id is the entityTypeId specified during EntityType creation.

featureSelector

object (FeatureSelector)

Required. Selectors choosing which Feature values to read from the EntityType.

settings[]

object (DestinationFeatureSetting)

Per-Feature settings for the batch read.