SearchSemanticViews

Updated at:
Copy as MD

Retrieves semantic views.

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

adb:SearchSemanticViews

get

*DBClusterLakeVersion

acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}

None None

Request syntax

GET  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

The ADB cluster ID.

am-bp*****

QueryText

string

No

The text content to search.

Sales revenue

TopK

integer

No

The number of most relevant documents to return.

3

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

Id of the request

1AD222E9-E606-4A42-BF6D-8A4442913CEF

Data

array

The response data body.

SemanticViewModel

The response data.

-

Examples

Success response

JSON format

{
  "RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF",
  "Data": [
    {
      "ViewSchema": "sales_db",
      "Definition": "name: revenue_analysis\ndescription: \"Semantic view for analyzing revenue across products and customers\"\n\ntables:\n  - name: customers\n    description: \"Customer information\"\n    base_table:\n      schema: sales_db\n      table: customers\n    dimensions:\n      - name: customer_name\n        synonyms: [\"client name\", \"customer\"]\n        description: \"Full name of the customer\"\n        expr: c_name\n        data_type: VARCHAR\n      - name: customer_segment\n        synonyms: [\"segment\", \"market segment\"]\n        description: \"Customer market segment\"\n        expr: c_mktsegment\n        data_type: VARCHAR\n        is_enum: true\n\n  - name: orders\n    description: \"Order information\"\n    base_table:\n      schema: sales_db\n      table: orders\n    dimensions:\n      - name: order_date\n        description: \"Date when order was placed\"\n        expr: o_orderdate\n        data_type: DATE\n      - name: order_year\n        description: \"Year when order was placed\"\n        expr: YEAR(o_orderdate)\n        data_type: NUMBER\n    facts:\n      - name: order_total\n        description: \"Total order amount\"\n        expr: o_totalprice\n        data_type: NUMBER\n    metrics:\n      - name: total_orders\n        description: \"Total number of orders\"\n        expr: COUNT(*)\n      - name: total_revenue\n        description: \"Total revenue of orders\"\n        expr: SUM(o_totalprice)\n      - name: average_order_value\n        description: \"Average order value\"\n        expr: AVG(o_totalprice)\n\nrelationships:\n  - name: orders_to_customers\n    left_table: orders\n    right_table: customers\n    relationship_columns:\n      - left_column: o_custkey\n        right_column: c_custkey\n\nmetrics:\n  - name: revenue_per_customer\n    description: \"Average revenue per customer\"\n    expr: orders.total_revenue / customers.customer_count\n",
      "ViewName": "revenue_analysis",
      "Comment": "这是一个定义销售额相关指标的视图",
      "Score": 0.81
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 MDS.CatalogAlreadyExist The catalog already exists. Catalog already exists
400 MDS.IllegalArgument Invalid argument. An invalid parameter is used.
400 MDS.InvalidPrivilege No permissions. You are not authorized to perform this operation.
400 MDS.MetaSchemaAlreadyExist The database already exists. The specified database already exists.
400 MDS.MetaSchemaNotExist The database does not exist. The specified database does not exist.
400 MDS.MetaTableAlreadyExist The table already exists. The specified table already exists.
400 MDS.MetaTableNotExist The table is not found. The specified table does not exist.
400 MDS.SemanticViewAlreadyExist The semantic view already exists. Semantic view already exists
400 MDS.SemanticViewNotExist This semantic view does not exist. This semantic view does not exist
500 MDS.InternalError An internal MDS error occurred. An internal error occurred.
500 MDS.MetaVisitError Failed to access metadata. Failed to access the metadata.
403 MDS.RamAuthAccessDenied ram auth access denied. RAM authentication failed
404 MDS.InstanceNotExist ADB instance does not exist. ADB instance does not exist

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.