GetFeatureView

更新时间:
复制 MD 格式

Gets the details of a feature view, including its field definitions, data source binding, and synchronization status.

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:GetFeatureView

get

*All Resource

*

None None

Request syntax

GET /api/v1/instances/{InstanceId}/featureviews/{FeatureViewId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID. You can call ListInstances to obtain the ID.

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

FeatureViewId

string

Yes

The feature view ID. You can call ListFeatureViews to obtain the ID.

3

Request parameters

Parameter

Type

Required

Description

Example

No parameters required.

Response elements

Element

Type

Description

Example

object

The schema of the response.

RequestId

string

The request ID.

72F15A8A-5A28-5B18-A0DE-0EABD7D3245A

ProjectId

string

The project ID.

3

ProjectName

string

The project name.

project1

FeatureEntityName

string

The feature entity name.

featureEntity1

Name

string

The feature view name.

featureView1

Owner

string

The Alibaba Cloud account ID of the owner.

12321421412****

Type

string

The type of the feature view. Valid values:

Batch: A batch feature.

Stream: A stream feature.

Batch

GmtCreateTime

string

The creation time.

2021-12-15T23:24:33.132+08:00

GmtModifiedTime

string

The modification time.

2021-12-15T23:24:33.132+08:00

FeatureEntityId

string

The feature entity ID.

3

JoinId

string

The join ID of the feature entity.

user_id

WriteMethod

string

The write method. Valid values:

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

Custom: Uses a custom table structure.

custom

RegisterTable

string

The name of the registered table.

table1

RegisterDatasourceId

string

The ID of the data source where the registered table resides.

4

RegisterDatasourceName

string

The name of the data source where the registered table resides.

datasource1

WriteToFeatureDB

boolean

Indicates whether to write data to the online managed storage.

false

SyncOnlineTable

boolean

Indicates whether to synchronize the online feature table.

true

TTL

integer

The time to live (TTL).

86400

Tags

array

The list of tags.

string

A tag for the feature view.

tag1

Config

string

The configuration.

{"save_original_field":true}

GmtSyncTime

string

The synchronization time.

2021-12-15T23:24:33.132+08:00

LastSyncConfig

string

The most recent synchronization configuration.

{ "mode": "overwrite", "partitions": { "ds": { "value": "20230820" } }, "event_time": "", "config": {}, "offline_to_online": true }

Fields

array<object>

The list of fields.

array<object>

Name

string

The field name.

user

Type

string

The data type of the field. Valid values:

int

string

float

int

Attributes

array

The list of field attributes. Valid values:

Partition: The partition field.

PrimaryKey: The primary key.

EventTime: The event time.

string

A field attribute.

Partition

Transform

array<object>

The feature transformation.

array<object>

Type

string

The feature transformation type.

LLMEmbedding

LLMConfigId

integer

The LLM configuration ID.

1

Input

array<object>

The input for the feature transformation.

object

Name

string

The feature name.

feature1

Type

string

The feature type.

STRING

Modality

string

The modality type.

TEXT

PublishTableScript

string

The script for data synchronization.

from feature_store_py.fs_client import FeatureStoreClient\nimport datetime\nfrom feature_store_py.fs_datasource import MaxComputeDataSource\nimport sys\n\ncur_day = args['dt']\nprint('cur_day = ', cur_day)\n\naccess_key_id = o.account.access_id\naccess_key_secret = o.account.secret_access_key\nfs = FeatureStoreClient(access_key_id=access_key_id, access_key_secret=access_key_secret, region='cn-beijing')\ncur_project_name = 'p1'\nproject = fs.get_project(cur_project_name)\n\nfeature_view_name = 'user_fea'\nbatch_feature_view = project.get_feature_view(feature_view_name)\ntask = batch_feature_view.publish_table(partitions={'ds':cur_day}, mode='Overwrite')\ntask.wait()\ntask.print_summary()\n

MockTableName

string

The name of the mock data table for the stream feature view.

item_table_mock_1

Examples

Success response

JSON format

{
  "RequestId": "72F15A8A-5A28-5B18-A0DE-0EABD7D3245A",
  "ProjectId": "3",
  "ProjectName": "project1",
  "FeatureEntityName": "featureEntity1",
  "Name": "featureView1",
  "Owner": "12321421412****",
  "Type": "Batch",
  "GmtCreateTime": "2021-12-15T23:24:33.132+08:00",
  "GmtModifiedTime": "2021-12-15T23:24:33.132+08:00",
  "FeatureEntityId": "3",
  "JoinId": "user_id",
  "WriteMethod": "custom",
  "RegisterTable": "table1",
  "RegisterDatasourceId": "4",
  "RegisterDatasourceName": "datasource1",
  "WriteToFeatureDB": false,
  "SyncOnlineTable": true,
  "TTL": 86400,
  "Tags": [
    "tag1"
  ],
  "Config": "{\"save_original_field\":true}",
  "GmtSyncTime": "2021-12-15T23:24:33.132+08:00",
  "LastSyncConfig": "{\n\t\"mode\": \"overwrite\",\n\t\"partitions\": {\n\t\t\"ds\": {\n\t\t\t\"value\": \"20230820\"\n\t\t}\n\t},\n\t\"event_time\": \"\",\n\t\"config\": {},\n\t\"offline_to_online\": true\n}",
  "Fields": [
    {
      "Name": "user",
      "Type": "int",
      "Attributes": [
        "Partition"
      ],
      "Transform": [
        {
          "Type": "LLMEmbedding",
          "LLMConfigId": 1,
          "Input": [
            {
              "Name": "feature1",
              "Type": "STRING",
              "Modality": "TEXT"
            }
          ]
        }
      ]
    }
  ],
  "PublishTableScript": "from feature_store_py.fs_client import FeatureStoreClient\\nimport datetime\\nfrom feature_store_py.fs_datasource import MaxComputeDataSource\\nimport sys\\n\\ncur_day = args['dt']\\nprint('cur_day = ', cur_day)\\n\\naccess_key_id = o.account.access_id\\naccess_key_secret = o.account.secret_access_key\\nfs = FeatureStoreClient(access_key_id=access_key_id, access_key_secret=access_key_secret, region='cn-beijing')\\ncur_project_name = 'p1'\\nproject = fs.get_project(cur_project_name)\\n\\nfeature_view_name = 'user_fea'\\nbatch_feature_view = project.get_feature_view(feature_view_name)\\ntask = batch_feature_view.publish_table(partitions={'ds':cur_day}, mode='Overwrite')\\ntask.wait()\\ntask.print_summary()\\n",
  "MockTableName": "item_table_mock_1"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.