帮助文档 Logo
平台使用
阿里云
百度云
移动云
智算服务
教育生态
登录 →
帮助文档 Logo
平台使用 阿里云 百度云 移动云 智算服务 教育生态
登录
  1. 首页
  2. 阿里云
  3. 表格存储
  4. 开发参考
  5. API参考(数据管理)
  6. DataType定义
  7. GroupByField

GroupByField

  • DataType定义
  • 发布于 2025-04-22
  • 0 次阅读
文档编辑
文档编辑

在多元索引统计聚合中表示字段值分组,用于根据一个字段的值对查询结果进行分组,相同的字段值放到同一分组内,返回每个分组的值和该值对应的个数。

请求数据结构

message GroupByField {
    optional string field_name = 1;
    optional int32 size = 2;
    optional GroupBySort sort = 3;
    optional Aggregations sub_aggs = 4;
    optional GroupBys sub_group_bys = 5;
    optional int64  min_doc_count = 6;
}

名称

类型

是否必选

描述

field_name

string

是

用于统计聚合的字段。

size

int32

是

返回的分组数量,默认值为10。最大值为2000。当分组数量超过2000时,只会返回前2000个分组。

sort

GroupBySort

否

分组中的item排序规则,默认按照分组中item的数量降序排序,多个排序则按照添加的顺序进行排列。

sub_aggs

Aggregations

否

子统计聚合Aggregation,子统计聚合会根据分组内容再进行一次统计聚合分析。

sub_group_bys

GroupBys

否

子统计聚合GroupBy,子统计聚合会根据分组内容再进行一次统计聚合分析。

min_doc_count

int64

否

最小行数。当分组中的行数小于最小行数时,不会返回此分组的统计结果。

响应数据结构

message GroupByFieldResult {
    repeated GroupByFieldResultItem group_by_field_result_items = 1;
}

名称

类型

是否必选

描述

group_by_field_result_items

repeated GroupByFieldResultItem

是

返回的分组信息。

相关文章

ActionType 2025-04-22 14:32

在GetStreamRecord的响应消息中表示操作类型。 枚举取值列表

Aggregation 2025-04-22 14:32

表示单个统计聚合配置。 数据结构 message Aggregation { optional string name = 1; optional AggregationType type = 2;

AggregationResult 2025-04-22 14:32

表示单个统计聚合Aggregation的返回信息。 数据结构 message AggregationResult { optional string name = 1; optional Aggregatio

Aggregations 2025-04-22 14:32

表示统计聚合配置。 数据结构 message Aggregations { repeated Aggregation aggs = 1; }

AggregationsResult 2025-04-22 14:32

表示统计聚合中Aggregation的返回信息。 数据结构 message AggregationsResult { repeated AggregationResult agg_results = 1; }

AggregationType 2025-04-22 14:32

表示统计聚合类型。 枚举取值列表 AGG_AVG表示求平均值。 AGG_DISTINCT_COUNT表示去重统计行数,

目录
Copyright © 2025 your company All Rights Reserved. Powered by 博智数字服务平台.
闽ICP备08105208号-1