SearchSemanticViews - 检索语义视图

更新时间:
复制为 MD 格式

检索语义视图

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求语法

GET  HTTP/1.1

请求参数

名称

类型

必填

描述

示例值

DBClusterId

string

ADB 集群 ID。

am-bp*****

QueryText

string

待搜索文本内容。

销售额

TopK

integer

要返回的最相关文档的数量。

3

返回参数

名称

类型

描述

示例值

object

Schema of Response

RequestId

string

Id of the request

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

Data

array

返回数据体。

SemanticViewModel

返回数据。

-

示例

正常返回示例

JSON格式

{
  "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
    }
  ]
}

错误码

HTTP status code

错误码

错误信息

描述

400 MDS.CatalogAlreadyExist The catalog already exists. 目录已经存在
400 MDS.IllegalArgument Invalid argument. 用户使用了非法参数
400 MDS.InvalidPrivilege No permissions. 用户无权限进行操作
400 MDS.MetaSchemaAlreadyExist The database already exists. 数据库已存在
400 MDS.MetaSchemaNotExist The database does not exist. 操作的数据库不存在
400 MDS.MetaTableAlreadyExist The table already exists. 操作的表已经存在
400 MDS.MetaTableNotExist The table is not found. 操作的表不存在
400 MDS.SemanticViewAlreadyExist The semantic view already exists. 此语义视图已经存在
400 MDS.SemanticViewNotExist This semantic view does not exist. 此语义视图不存在
500 MDS.InternalError An internal MDS error occurred. MDS服务内部错误
500 MDS.MetaVisitError Failed to access metadata. 访问元数据失败
403 MDS.RamAuthAccessDenied ram auth access denied. RAM鉴权失败
404 MDS.InstanceNotExist ADB instance does not exist. ADB 实例不存在

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情