SearchSemanticViews
Retrieves semantic views.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
adb:SearchSemanticViews |
get |
*DBClusterLakeVersion
|
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.