湖仓构建 LAKEFORMATION-批量设置分区的统计信息:请求示例

时间:2024-10-22 17:23:06

请求示例

POST https://{endpoint} /v1/{project_id}/instances/{instance_id}/catalogs/{catalog_name}/databases/{database_name}/tables/{table_name}/partitions/column-statistics

{
  "need_merge" : false,
  "statistics" : [ {
    "column_statistics_desc" : {
      "partition_values" : [ "value1", "value2" ],
      "last_analyzed_time" : "2023-05-31T02:52:16.137Z"
    },
    "column_statistics_objects" : [ {
      "column_name" : "column_prefix0",
      "column_type" : "string",
      "data_type" : "stringStats",
      "string_statistics_data" : {
        "average_length" : 10,
        "maximum_length" : 100,
        "number_of_null" : 30,
        "number_of_distinct_value" : 20,
        "bit_vector" : "FwAAAAAAAAAAAA=="
      }
    }, {
      "column_name" : "column_prefix1",
      "column_type" : "string",
      "data_type" : "stringStats",
      "string_statistics_data" : {
        "average_length" : 10,
        "maximum_length" : 100,
        "number_of_null" : 30,
        "number_of_distinct_value" : 20,
        "bit_vector" : "FwAAAAAAAAAAAA=="
      }
    }, {
      "column_name" : "column_prefix2",
      "column_type" : "string",
      "data_type" : "stringStats",
      "string_statistics_data" : {
        "average_length" : 10,
        "maximum_length" : 100,
        "number_of_null" : 30,
        "number_of_distinct_value" : 20,
        "bit_vector" : "FwAAAAAAAAAAAA=="
      }
    }, {
      "column_name" : "column_prefix3",
      "column_type" : "string",
      "data_type" : "stringStats",
      "string_statistics_data" : {
        "average_length" : 10,
        "maximum_length" : 100,
        "number_of_null" : 30,
        "number_of_distinct_value" : 20,
        "bit_vector" : "FwAAAAAAAAAAAA=="
      }
    }, {
      "column_name" : "column_prefix4",
      "column_type" : "string",
      "data_type" : "stringStats",
      "string_statistics_data" : {
        "average_length" : 10,
        "maximum_length" : 100,
        "number_of_null" : 30,
        "number_of_distinct_value" : 20,
        "bit_vector" : "FwAAAAAAAAAAAA=="
      }
    }, {
      "column_name" : "column_prefix5",
      "column_type" : "string",
      "data_type" : "stringStats",
      "string_statistics_data" : {
        "average_length" : 10,
        "maximum_length" : 100,
        "number_of_null" : 30,
        "number_of_distinct_value" : 20,
        "bit_vector" : "FwAAAAAAAAAAAA=="
      }
    }, {
      "column_name" : "column_prefix6",
      "column_type" : "string",
      "data_type" : "stringStats",
      "string_statistics_data" : {
        "average_length" : 10,
        "maximum_length" : 100,
        "number_of_null" : 30,
        "number_of_distinct_value" : 20,
        "bit_vector" : "FwAAAAAAAAAAAA=="
      }
    }, {
      "column_name" : "column_prefix7",
      "column_type" : "string",
      "data_type" : "stringStats",
      "string_statistics_data" : {
        "average_length" : 10,
        "maximum_length" : 100,
        "number_of_null" : 30,
        "number_of_distinct_value" : 20,
        "bit_vector" : "FwAAAAAAAAAAAA=="
      }
    }, {
      "column_name" : "column_prefix8",
      "column_type" : "string",
      "data_type" : "stringStats",
      "string_statistics_data" : {
        "average_length" : 10,
        "maximum_length" : 100,
        "number_of_null" : 30,
        "number_of_distinct_value" : 20,
        "bit_vector" : "FwAAAAAAAAAAAA=="
      }
    }, {
      "column_name" : "column_prefix9",
      "column_type" : "string",
      "data_type" : "stringStats",
      "string_statistics_data" : {
        "average_length" : 10,
        "maximum_length" : 100,
        "number_of_null" : 30,
        "number_of_distinct_value" : 20,
        "bit_vector" : "FwAAAAAAAAAAAA=="
      }
    } ]
  } ]
}
support.huaweicloud.com/api-lakeformation/SetPartitionColumnStatistics.html