Skip to content
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 aggregation support for date type #1693

Merged
merged 4 commits into from Nov 28, 2022
Merged

add aggregation support for date type #1693

merged 4 commits into from Nov 28, 2022

Conversation

PSeitz
Copy link
Contributor

@PSeitz PSeitz commented Nov 23, 2022

Add support for date type in aggregations

Histogram

return additionally key_as_string formatted as Rfc3339

{
    "key_as_string" : "2019-01-01T00:00:00Z",
    "key" : 1546300800000000,
    "doc_count" : 1
}

Range

return additionally from_as_string, to_as_string formatted as Rfc3339.
Currently unsupported: pass ranges as formatted text.

{
  "key" : "*-2019-01-01T00:00:00Z",
  "to" : 1546300800000000.0,
  "to_as_string" : "2019-01-01T00:00:00Z",
  "doc_count" : 0
}

@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2022

Codecov Report

Merging #1693 (ee8fd25) into main (e758080) will increase coverage by 0.02%.
The diff coverage is 98.05%.

@@            Coverage Diff             @@
##             main    #1693      +/-   ##
==========================================
+ Coverage   94.04%   94.07%   +0.02%     
==========================================
  Files         256      257       +1     
  Lines       49169    49452     +283     
==========================================
+ Hits        46243    46522     +279     
- Misses       2926     2930       +4     
Impacted Files Coverage Δ
src/fastfield/mod.rs 99.73% <ø> (ø)
src/aggregation/date.rs 69.23% <69.23%> (ø)
src/aggregation/bucket/histogram/histogram.rs 99.55% <98.59%> (-0.07%) ⬇️
src/aggregation/agg_req_with_accessor.rs 95.68% <100.00%> (+1.89%) ⬆️
src/aggregation/agg_result.rs 76.92% <100.00%> (+1.41%) ⬆️
src/aggregation/bucket/range.rs 97.35% <100.00%> (+0.32%) ⬆️
src/aggregation/collector.rs 100.00% <100.00%> (ø)
src/aggregation/intermediate_agg_result.rs 98.43% <100.00%> (+0.13%) ⬆️
src/aggregation/metric/stats.rs 97.21% <100.00%> (ø)
src/aggregation/mod.rs 98.87% <100.00%> (+0.01%) ⬆️
... and 12 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@PSeitz PSeitz force-pushed the date_in_agg branch 2 times, most recently from 40c9d6c to f79276e Compare November 24, 2022 01:56
@fulmicoton fulmicoton merged commit ee1f2c1 into main Nov 28, 2022
@fulmicoton fulmicoton deleted the date_in_agg branch November 28, 2022 00:12
ppodolsky pushed a commit to izihawa/tantivy that referenced this pull request Dec 8, 2022
* add aggregation support for date type
fixes quickwit-oss#1332

* serialize key_as_string as rfc3339 in date histogram
* update docs
* enable date for range aggregation
This was referenced Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants