CreateFeatureView

更新时间:
复制 MD 格式

You can create three types of feature views: offline, real-time, and behavior sequence. Each feature view uses fields to define its structure and links to a feature entity.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

featurestore:CreateFeatureView

create

*All Resource

*

None None

Request syntax

POST /api/v1/instances/{InstanceId}/featureviews HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID. Call the ListInstances API to get this ID.

fs-cn-********

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

ProjectId

string

Yes

The ID of the project.

3

FeatureEntityId

string

No

The ID of the feature entity.

4

Name

string

Yes

The name of the feature view.

FeatureView1

Type

string

Yes

The type of the feature view. Valid values:

  • Batch: Offline feature.

  • Stream: Real-time feature.

Batch

WriteMethod

string

Yes

The write method. Valid values:

  • ByReadyMadeTable: Registers the feature view by using an existing table.

  • Custom: Defines a custom table structure.

Custom

WriteToFeatureDB

boolean

No

Specifies whether to write data to the online feature store. Valid values:

  • true: Writes data to the online feature store.

  • false: Does not write data to the online feature store.

false

RegisterTable

string

No

The name of the table to register.

table1

RegisterDatasourceId

string

No

The ID of the data source to which the table to be registered belongs. You can call the ListDatasources operation to obtain the data source ID.

5

SyncOnlineTable

boolean

Yes

Specifies whether to synchronize the online feature table. Valid values:

  • true: Synchronizes the online feature table.

  • false: Does not synchronize the online feature table.

true

TTL

integer

No

The time-to-live (TTL) of the feature view, in days.

90

Tags

array

No

The tags of the feature view.

string

No

A tag of the feature view.

label1

Config

string

No

The configurations of the feature view.

{"save_original_field":true}

Fields

array<object>

No

The fields.

array<object>

No

Name

string

No

The name of the field.

age

Type

string

No

The data type of the field. Valid values:

  • INT32

  • INT64

  • FLOAT

  • DOUBLE

  • STRING

  • BOOLEAN

  • TIMESTAMP

INT32

Attributes

array

No

The attributes of the field. Valid values:

  • Partition: partition field.

  • PrimaryKey: primary key.

  • EventTime: event time.

string

No

A field attribute.

Partition

Transform

array<object>

No

The feature generation configurations.

array<object>

No

Type

string

No

The type of the feature generation.

LLMEmbedding

LLMConfigId

integer

No

The ID of the large language model (LLM) configuration.

1

Input

array<object>

No

The input for feature generation.

object

No

Name

string

No

The name of the input field.

f1

Type

string

No

The data type of the input field.

STRING

Modality

string

No

The modality of the input, such as text or image.

Response elements

Element

Type

Description

Example

object

The response schema.

RequestId

string

The request ID.

0C89F5E1-7F24-5EEC-9F05-508A39278CC8

FeatureViewId

string

The feature view ID.

3

Examples

Success response

JSON format

{
  "RequestId": "0C89F5E1-7F24-5EEC-9F05-508A39278CC8",
  "FeatureViewId": "3"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.