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}/v1beta1/{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)
    }
  ],
  "startTime": string,

  // 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.

startTime

string (Timestamp format)

Optional. Excludes feature values with feature generation timestamp before this timestamp. If not set, retrieve oldest values kept in feature Store. timestamp, if present, must not have higher than millisecond precision.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

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.