文档

Search - 搜索元数据

更新时间:

元数据检索。

接口说明

元数据检索

调试

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

授权信息

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

请求语法

POST /api/metastore/catalogs/search

请求参数

名称类型必填描述示例值
bodyobject

A short description of struct

CatalogIdstring

catalogid

默认是空,在多catalogid下填写对应的id
SearchTextstring

搜索问题

tags:tag1 or comment:^iso and name=aliyun and (createTime > "20211111" and createTime < "20211117") and has category
SortCriteriaarray

排序结构

SortCriterion

排序结构

PageSizelong

当前查询的页大小

1000
PageNumberlong

当前查询的页号

1
SearchTypestring

搜索类型

TABLE/DATABASE/CATALOG

返回参数

名称类型描述示例值
object

Schema of Response

Codestring

响应代码

OK
Messagestring

响应消息

""
RequestIdstring

请求 ID

460C862F-BB91-5C04-BC3F-946EEF467862
Successboolean

是否成功

True
DatabaseResultobject

返回的 db 结果

Databasesobject []

返回的 DatabaseList

DatabaseDatabase

返回的 Database

HighLightListarray

返回高亮文本

HighLight

返回高亮文本

TotalCountlong

满足匹配条件的总的 Database 个数

11000
TableResultobject

返回的 table result

Tablesobject []

返回的 TableList

TableTable

返回的 Table

HighLightListarray

返回的高亮文本

HighLight

返回的高亮文本

TotalCountlong

满足匹配条件的总的 Table 个数

1100

示例

正常返回示例

JSON格式

{
  "Code": "OK",
  "Message": "\"\"",
  "RequestId": "460C862F-BB91-5C04-BC3F-946EEF467862",
  "Success": true,
  "DatabaseResult": {
    "Databases": [
      {
        "Database": {
          "CreateTime": 1608707407,
          "Description": "this is a hive database",
          "LocationUri": "/hdfs/hivedb/data",
          "Name": "database_test",
          "OwnerName": "zhangsan",
          "OwnerType": "USER",
          "Parameters": {
            "key": "key"
          },
          "Privileges": {
            "GroupPrivileges": {
              "key": [
                {
                  "CreateTime": 1606226844,
                  "GrantOption": true,
                  "Grantor": "Grantor",
                  "GrantorType": "GrantorType",
                  "Privilege": "Privilege"
                }
              ]
            },
            "RolePrivileges": {
              "key": [
                {
                  "CreateTime": 1606226844,
                  "GrantOption": true,
                  "Grantor": "Grantor",
                  "GrantorType": "GrantorType",
                  "Privilege": "Privilege"
                }
              ]
            },
            "UserPrivileges": {
              "key": [
                {
                  "CreateTime": 1606226844,
                  "GrantOption": true,
                  "Grantor": "Grantor",
                  "GrantorType": "GrantorType",
                  "Privilege": "Privilege"
                }
              ]
            }
          },
          "UpdateTime": 1608707407,
          "CreatedBy": "root"
        },
        "HighLightList": [
          {
            "Key": "name",
            "Value": "<em>tab</em>2"
          }
        ]
      }
    ],
    "TotalCount": 11000
  },
  "TableResult": {
    "Tables": [
      {
        "Table": {
          "Cascade": false,
          "CreateTime": 1608707407,
          "CreatedBy": "zhangsan",
          "DatabaseName": "database_test",
          "LastAccessTime": 1608707407,
          "LastAnalyzedTime": 1608707407,
          "Owner": "zhangsan",
          "OwnerType": "USER",
          "Parameters": {
            "key": "key"
          },
          "PartitionKeys": [
            {
              "Comment": "comment_day",
              "Name": "day",
              "Parameters": {
                "key": "key"
              },
              "Type": "int"
            }
          ],
          "Privileges": {},
          "Retention": 30000,
          "RewriteEnabled": true,
          "Sd": {
            "BucketCols": [
              "2010"
            ],
            "Cols": [
              {
                "Comment": "comment_day",
                "Name": "day",
                "Type": "int"
              }
            ],
            "Compressed": false,
            "InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
            "Location": "file:///tmp/table",
            "NumBuckets": 10,
            "OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
            "Parameters": {
              "key": "key"
            },
            "SerDeInfo": {
              "Name": "name",
              "SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
            },
            "SkewedInfo": {
              "SkewedColNames": [
                "col1"
              ],
              "SkewedColValueLocationMaps": {
                "key": "{“col1”:\"val1\"}"
              },
              "SkewedColValues": [
                [
                  "\"123\""
                ]
              ]
            },
            "SortCols": [
              {
                "Col": "col1",
                "Order": 1
              }
            ],
            "StoredAsSubDirectories": false
          },
          "TableName": "table_name",
          "TableType": "MANAGED_TABLE",
          "Temporary": false,
          "UpdateTime": 1608707407,
          "ViewExpandedText": "''",
          "ViewOriginalText": "''",
          "TableId": "59c6c8fefeaa46d8b599c1f790c59a19",
          "TableVersion": {
            "Table": {
              "Cascade": false,
              "CreateTime": 1608707407,
              "CreatedBy": "zhangsan",
              "DatabaseName": "database_test",
              "LastAccessTime": 1608707407,
              "LastAnalyzedTime": 1608707407,
              "Owner": "zhangsan",
              "OwnerType": "USER",
              "PartitionKeys": [
                {
                  "Comment": "comment_day",
                  "Name": "day",
                  "Type": "int"
                }
              ],
              "Privileges": {},
              "Retention": 30000,
              "RewriteEnabled": true,
              "Sd": {
                "BucketCols": [
                  "2010"
                ],
                "Cols": [],
                "Compressed": false,
                "InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
                "Location": "file:///tmp/table",
                "NumBuckets": 10,
                "OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
                "Parameters": {
                  "key": "key"
                },
                "SerDeInfo": {
                  "Name": "name",
                  "SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
                },
                "SkewedInfo": {
                  "SkewedColNames": [
                    "col1"
                  ],
                  "SkewedColValueLocationMaps": {
                    "key": "{“col1”:\"val1\"}"
                  },
                  "SkewedColValues": [
                    [
                      "\"123\""
                    ]
                  ]
                },
                "SortCols": [
                  {
                    "Col": "col1",
                    "Order": 1
                  }
                ],
                "StoredAsSubDirectories": false
              },
              "TableName": "table_name",
              "TableType": "MANAGED_TABLE",
              "Temporary": false,
              "UpdateTime": 1608707407,
              "ViewExpandedText": "''",
              "ViewOriginalText": "''",
              "TableId": "59c6c8fefeaa46d8b599c1f790c59a19",
              "TableVersion": {
                "Table": {
                  "Cascade": false,
                  "CreateTime": 1608707407,
                  "CreatedBy": "zhangsan",
                  "DatabaseName": "database_test",
                  "LastAccessTime": 1608707407,
                  "LastAnalyzedTime": 1608707407,
                  "Owner": "zhangsan",
                  "OwnerType": "USER",
                  "PartitionKeys": [],
                  "Retention": 30000,
                  "RewriteEnabled": true,
                  "Sd": {
                    "BucketCols": [
                      "2010"
                    ],
                    "Cols": [],
                    "Compressed": false,
                    "InputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat",
                    "Location": "file:///tmp/table",
                    "NumBuckets": 10,
                    "OutputFormat": "org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat",
                    "Parameters": {
                      "key": "key"
                    },
                    "SerDeInfo": {
                      "Name": "name",
                      "SerializationLib": "org.apache.hadoop.hive.serde2.OpenCSVSerde"
                    },
                    "SkewedInfo": {
                      "SkewedColNames": [
                        "col1"
                      ],
                      "SkewedColValueLocationMaps": {
                        "key": "{“col1”:\"val1\"}"
                      },
                      "SkewedColValues": [
                        [
                          "\"123\""
                        ]
                      ]
                    },
                    "SortCols": [
                      {
                        "Col": "col1",
                        "Order": 1
                      }
                    ],
                    "StoredAsSubDirectories": false
                  },
                  "TableName": "table_name",
                  "TableType": "MANAGED_TABLE",
                  "Temporary": false,
                  "UpdateTime": 1608707407,
                  "ViewExpandedText": "''",
                  "ViewOriginalText": "''",
                  "TableId": "59c6c8fefeaa46d8b599c1f790c59a19",
                  "TableVersion": {
                    "VersionId": 5
                  }
                },
                "VersionId": 5
              }
            },
            "VersionId": 5
          }
        },
        "HighLightList": [
          {
            "Key": "name",
            "Value": "<em>tab</em>2"
          }
        ]
      }
    ],
    "TotalCount": 1100
  }
}

错误码

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

  • 本页导读 (0)
文档反馈