importFeatureValues method

Imports Feature values into the Featurestore from a source storage.

The progress of the import is tracked by the returned operation. The imported features are guaranteed to be visible to subsequent read operations after the operation is marked as successfully done.

If an import operation fails, the Feature values returned from reads and exports may be inconsistent. If consistency is required, the caller must retry the same import request again and wait till the new operation returned is marked as successfully done.

There are also scenarios where the caller can cause inconsistency.

  • Source data for import contains multiple distinct Feature values for the same entity ID and timestamp.
  • Source is modified during an import. This includes adding, updating, or removing source data and/or metadata. Examples of updating metadata include but are not limited to changing storage location, storage class, or retention policy.
  • Online serving cluster is under-provisioned.

Throws a http.ClientException if there were problems communicating with the API service. Throws a StatusException if the API failed with a Status message. Throws a ServiceException for any other failure.

Returns an Operation representing the status of the long-running operation.

When complete, Operation.done will be true. If successful, Operation.responseAsMessage will contain the operation's result.

Implementation

Future<
  Operation<ImportFeatureValuesResponse, ImportFeatureValuesOperationMetadata>
>
importFeatureValues(ImportFeatureValuesRequest request) async {
  final url = Uri.https(
    _host,
    '/v1beta1/${request.entityType}:importFeatureValues',
  );
  final response = await _client.post(url, body: request);
  return Operation.fromJson(
    response,
    OperationHelper(
      ImportFeatureValuesResponse.fromJson,
      ImportFeatureValuesOperationMetadata.fromJson,
    ),
  );
}