获取表的列统计信息
功能介绍
获取表的列统计信息。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
POST /v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/column-statistics/batch-get
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目编号。获取方法,请参见获取项目ID。 |
instance_id |
是 |
String |
LakeFormation实例ID。创建实例时自动生成。例如:2180518f-42b8-4947-b20b-adfc53981a25。 |
catalog_name |
是 |
String |
catalog名称。只能包含字母、数字和下划线,且长度为1~256个字符。 |
database_name |
是 |
String |
数据库名称。只能包含中文、字母、数字、下划线、中划线,且长度为1~128个字符。 |
table_name |
是 |
String |
表名称。只能包含中文、字母、数字、下划线、中划线,且长度为1~256个字符。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
Array of strings |
租户token。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
column_names |
是 |
Array of strings |
列名称。 |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
[数组元素] |
Array of ColumnStatisticsObj objects |
列统计信息。 |
参数 |
参数类型 |
描述 |
---|---|---|
column_name |
String |
列名称。只能包含中文、字母、数字和_-+*(), 特殊字符,且长度为1~767个字符。 |
column_type |
String |
数据类型,字段类型包括array bigint binary boolean char date decimal double float int interval map set smallint string struct timestamp tinyint union varchar |
data_type |
String |
统计信息类型:binaryStats、booleanStats、dateStats、decimalStats、doubleStats、longStats、stringStats。 |
binary_statistics_data |
BinaryColumnStatisticsData object |
字节数组类型统计信息。 |
long_statistics_data |
LongColumnStatisticsData object |
长整数类型统计信息。 |
decimal_statistics_data |
DecimalColumnStatisticsData object |
小数类型统计信息。 |
string_statistics_data |
StringColumnStatisticsData object |
字符串类型统计信息。 |
double_statistics_data |
DoubleColumnStatisticsData object |
浮点数类型统计信息。 |
date_statistics_data |
DateColumnStatisticsData object |
日期类型统计信息。 |
boolean_statistics_data |
BooleanColumnStatisticsData object |
布尔类型统计信息。 |
参数 |
参数类型 |
描述 |
---|---|---|
maximum_length |
Long |
列中字节数组的最大值。 |
average_length |
Double |
列中字节数组的平均长度。 |
number_of_null |
Long |
列中空值个数。 |
参数 |
参数类型 |
描述 |
---|---|---|
minimum_value |
Long |
列中长整数最小值。 |
maximum_value |
Long |
列中长整数最大值。 |
number_of_null |
Long |
列中空值个数。 |
number_of_distinct_value |
Long |
列中去重后的长整数个数。 |
bit_vector |
String |
估算唯一值使用的位图。 |
参数 |
参数类型 |
描述 |
---|---|---|
minimum_value |
Decimal object |
列中小数最小值。 |
maximum_value |
Decimal object |
列中小数最大值。 |
number_of_null |
Long |
列中空值个数。 |
number_of_distinct_value |
Long |
列中去重后的小数个数。 |
bit_vector |
String |
估算唯一值使用的位图。 |
参数 |
参数类型 |
描述 |
---|---|---|
average_length |
Double |
列中字符串平均长度。 |
maximum_length |
Long |
列中字符串最长长度。 |
number_of_null |
Long |
列中空值个数。 |
number_of_distinct_value |
Long |
列中去重后字符串个数。 |
bit_vector |
String |
估算唯一值使用的位图。 |
参数 |
参数类型 |
描述 |
---|---|---|
minimum_value |
Double |
列中浮点数最小值。 |
maximum_value |
Double |
列中浮点数最大值。 |
number_of_null |
Long |
列中空值个数。 |
number_of_distinct_value |
Long |
列中去重后浮点数个数。 |
bit_vector |
String |
估算唯一值使用的位图。 |
参数 |
参数类型 |
描述 |
---|---|---|
minimum_value |
String |
列中的最小时间戳。 |
maximum_value |
String |
列中的最大时间戳。 |
number_of_null |
Long |
列中空值个数。 |
number_of_distinct_value |
Long |
列中去重后的时间戳个数。 |
bit_vector |
String |
估算唯一值使用的位图。 |
参数 |
参数类型 |
描述 |
---|---|---|
number_of_true |
Long |
列中为真的数量。 |
number_of_false |
Long |
列中为假的数量。 |
number_of_null |
Long |
列中为空的数量。 |
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
solution_msg |
String |
解决方案描述。 |
状态码:401
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
solution_msg |
String |
解决方案描述。 |
状态码:403
参数 |
参数类型 |
描述 |
---|---|---|
error |
Error object |
错误信息。 |
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
title |
String |
标题。 |
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
title |
String |
标题。 |
message |
String |
错误信息。 |
code |
String |
状态码。 |
状态码:404
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
solution_msg |
String |
解决方案描述。 |
状态码:408
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
solution_msg |
String |
解决方案描述。 |
状态码:500
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
solution_msg |
String |
解决方案描述。 |
请求示例
POST https://{endpoint} /v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/column-statistics/batch-get
{
"column_names" : [ "column1" ]
}
响应示例
状态码:200
OK
[ {
"column_name" : "column_name",
"column_type" : "string",
"data_type" : "int",
"binary_statistics_data" : {
"maximum_length" : 0,
"average_length" : 0,
"number_of_null" : 0
},
"long_statistics_data" : {
"minimum_value" : 0,
"maximum_value" : 0,
"number_of_null" : 0,
"number_of_distinct_value" : 0,
"bit_vector" : "string"
},
"decimal_statistics_data" : {
"minimum_value" : {
"scale" : 0,
"unscaled" : "string"
},
"maximum_value" : {
"scale" : 0,
"unscaled" : "string"
},
"number_of_null" : 0,
"number_of_distinct_value" : 0,
"bit_vector" : "string"
},
"string_statistics_data" : {
"average_length" : 0,
"maximum_length" : 0,
"number_of_null" : 0,
"number_of_distinct_value" : 0,
"bit_vector" : "string"
},
"double_statistics_data" : {
"minimum_value" : 0,
"maximum_value" : 0,
"number_of_null" : 0,
"number_of_distinct_value" : 0,
"bit_vector" : "string"
},
"date_statistics_data" : {
"minimum_value" : "2023-01-09T09:40:45.206Z",
"maximum_value" : "2023-01-09T09:40:45.206Z",
"number_of_null" : 0,
"number_of_distinct_value" : 0,
"bit_vector" : "string"
},
"boolean_statistics_data" : {
"number_of_true" : 0,
"number_of_false" : 0,
"number_of_null" : 0
}
} ]
状态码:400
Bad Request
{
"error_code" : "common.01000001",
"error_msg" : "failed to read http request, please check your input, code: 400, reason: Type mismatch., cause: TypeMismatchException"
}
状态码:401
Unauthorized
{
"error_code": 'APIG.1002',
"error_msg": 'Incorrect token or token resolution failed'
}
状态码:403
Forbidden
{
"error" : {
"code" : "403",
"message" : "X-Auth-Token is invalid in the request",
"error_code" : null,
"error_msg" : null,
"title" : "Forbidden"
},
"error_code" : "403",
"error_msg" : "X-Auth-Token is invalid in the request",
"title" : "Forbidden"
}
状态码:404
Not Found
{
"error_code" : "common.01000001",
"error_msg" : "response status exception, code: 404"
}
状态码:408
Request Timeout
{
"error_code" : "common.00000408",
"error_msg" : "timeout exception occurred"
}
状态码:500
Internal Server Error
{
"error_code" : "common.00000500",
"error_msg" : "internal error"
}
状态码
状态码 |
描述 |
---|---|
200 |
OK |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
408 |
Request Timeout |
500 |
Internal Server Error |
错误码
请参见错误码。