-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composite aggregation iterates forever with date_histogram format #72556
Comments
Pinging @elastic/es-analytics-geo (Team:Analytics) |
it seems like some condition missing in DateFormatters, i try to fix it. |
So this is subtle. It looks like what's going on here is that the date formatter is happy to output mixed week-based and month-based values, but doesn't want to mix them in parsing. I'm looking at this post from Stack Overflow. The relevant excerpt from which says:
Based on that, my guess is the month and day are being ignored when we parse the after key, and so the date ends up as something like I need to do some more testing to make sure this is the problem, but so far this seems the most likely cause. Presuming that proves out, I think we should reject formats that can't be used for parsing correctly, at least for composite sources if not for aggs in general. Relates to #47469 |
@pgomulka - tagging you for feedback. Does my theory seem correct here? And if so, what options do we have for detecting formats that are going to lose data when parsing? |
when parsing basically any date from 2021 parsed with format as suggested, instead of Y use y :) date defaulting logic |
(Apologies, we have a managed Elasticsearch instance, I can only get the data through the API)
Elasticsearch version (
bin/elasticsearch --version
):"version" : "7.10.0",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "51e9d6f22758d0374a0f3f5c6e8f3a7997850f96",
Plugins installed: []
JVM version (
java -version
):"version" : "15.0.1",
"vm_name" : "OpenJDK 64-Bit Server VM",
"vm_version" : "15.0.1+9"
OS version (
uname -a
if on a Unix-like system):"name" : "Linux",
"pretty_name" : "Ubuntu 20.04.1 LTS",
"arch" : "amd64",
"version" : "5.4.0-58-generic",
Description of the problem including expected versus actual behavior:
When I run a composite aggregation with a certain format of
date_histogram
source, the pagination goes on infinitely.Steps to reproduce:
after_key
and try to get the following page (it should be empty)Actual response:
Subsequent calls with the
after_key
always return non-empty bucket list, resulting in infinite iteration.Please note how I made a mistake and used
YYYY
in the format instead ofyyyy
(I wanted ordinary dates, not week-based year). When I changed the format toyyyy-MM-dd
, the page iteration ends correctly.May be related to #68963
The text was updated successfully, but these errors were encountered: