-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Deserialize DateHistogram bucket with no sub aggregations #3678
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small comments
@@ -745,15 +757,21 @@ private IBucket GetDateHistogramBucket(ref JsonReader reader, IJsonFormatterReso | |||
reader.ReadNext(); // , | |||
reader.ReadNext(); // "key" | |||
reader.ReadNext(); // : | |||
var key = reader.ReadNullableLong().GetValueOrDefault(0); | |||
var key = reader.ReadInt64(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an artifact of porting over from Json.NET, where the conversion is made to long?
- I don't believe nullability it's actually needed here, based on
reader.ReadNext(); // , | ||
reader.ReadNext(); // "doc_count" | ||
reader.ReadNext(); // : | ||
var docCount = reader.ReadNullableLong().GetValueOrDefault(0); | ||
reader.ReadNext(); // , | ||
var docCount = reader.ReadInt64(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, no longer nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to previous comment, this is an artifact of porting over from Json.NET. Based on
there is always a long
value for doc count.
Fixes #3673