Skip to content

Investigate multiple unit intervals in date_histogram using java.time #29411

@colings86

Description

@colings86

Spilt out from #28432.

This issue is also stalled until #27330 is complete.

Currently if multiple unit intervals (e.g. "2d" as opposed to "1d") are used in the date histogram aggregation we create fixed duration buckets instead of calendar interval buckets. For a 2d interval this means that the buckets represent 2 * 24 * 60 * 60 * 1000 = 172800000 milliseconds instead of representing two days starting at midnight the first day and ending just before midnight the third day.

This is not a great API experience and it would be better for all intervals to be calendar intervals. We have tried this before using Joda time but it was not possible to implement. Very preliminary investigations into java.time seem to suggest there is more of a chance of getting this working so once the move to java.time is complete we should investigate making all intervals in the date_histogram calendar intervals.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions