-
-
Notifications
You must be signed in to change notification settings - Fork 709
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
add date_histogram #1900
add date_histogram #1900
Conversation
47b8a62
to
490752f
Compare
1efc451
to
cf38158
Compare
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1900 +/- ##
==========================================
+ Coverage 94.47% 94.49% +0.01%
==========================================
Files 307 309 +2
Lines 55658 55984 +326
==========================================
+ Hits 52582 52900 +318
- Misses 3076 3084 +8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
} | ||
|
||
fn parse_into_milliseconds(input: &str) -> Result<u64, DateHistogramParseError> { | ||
fn parse_offset_into_microseconds(input: &str) -> Result<i64, AggregationError> { | ||
let is_sign = |byte| &[byte] == b"-" || &[byte] == b"+"; |
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.
Why do we need to parse numbers?
str::parse
does not work here?
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.
ah ok, so you wanted to reuse parse_into_microseconds
, but offset can be negative or something like that?
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 really I don't get it... O_o
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.
ah ok, so you wanted to reuse parse_into_microseconds, but offset can be negative or something like that?
Yes, that's it. The sign is optional
e.g. offset: 5d
or -5d
let (sign, input) = input.split_at(1); | ||
let mut val = parse_into_microseconds(input)?; | ||
if sign == "-" { | ||
val *= -1; |
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 can overflow.
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.
Not a this point, that's an i64
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.
see comments inline
Can you help me understand the point of parse_offset_into_microseconds
?
9bee6a5
to
0ba14d7
Compare
add date_histogram (DateHistogramReq) to aggregations
Limitations: