All Products
Search
Document Center

Tablestore:GroupByDateHistogram

Last Updated:Apr 29, 2026

GroupByDateHistogram groups query results into date-based intervals. Rows whose field values fall within the same interval are placed in the same group. Each group returns its value range and the number of matching rows.

Request parameters

message GroupByDateHistogram {
    optional string field_name = 1;
    optional DateTimeValue interval = 2;
    optional FieldRange field_range = 3;
    optional bytes missing = 4;
    optional int64  min_doc_count = 5;
    optional string time_zone = 6;
    optional GroupBySort sort = 7;
    optional Aggregations sub_aggs = 8;
    optional GroupBys sub_group_bys = 9;
}

Parameter

Type

Required

Description

field_name

string

Yes

The field to aggregate on.

interval

DateTimeValue

Yes

The interval configuration.

field_range

FieldRange

Yes

The value range used together with interval to limit the number of groups. The value of (field_range.max-field_range.min)/interval cannot exceed 2,000.

missing

bytes

No

The default value for rows where the field is empty. The value must be encoded in PlainBuffer format. For more information, see PlainBuffer.

  • If not set, rows with an empty field are excluded from the results.

  • If set, the specified value is used as the field value for those rows.

min_doc_count

int64

No

The minimum number of rows a group must contain to be included in the results. Groups with fewer rows are excluded.

time_zone

string

No

The time zone offset in +hh:mm or -hh:mm format, such as +08:00 or -09:00.

sort

GroupBySort

No

The sort rules for groups. Groups are sorted in descending order by default. When multiple rules are specified, they are applied in the order listed.

sub_aggs

Aggregations

No

Sub-aggregations to run on each group's results.

sub_group_bys

GroupBys

No

Sub-GroupBy operations to run on each group's results.

Response parameters

message GroupByDateHistogramResult {
    repeated GroupByDateHistogramItem group_by_date_histogram_items = 1;
}

Parameter

Type

Required

Description

group_by_date_histogram_items

repeated GroupByDateHistogramItem

Yes

The returned groups.