Data stream support for rollup search

This commit is contained in:
Dan Hermann 2020-07-10 11:13:34 -05:00 committed by GitHub
parent 68dd431bc9
commit 7fa9cf601b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 74 additions and 1 deletions

View File

@ -100,7 +100,7 @@ public class TransportRollupSearchAction extends TransportAction<SearchRequest,
@Override
protected void doExecute(Task task, SearchRequest request, ActionListener<SearchResponse> listener) {
String[] indices = resolver.concreteIndexNames(clusterService.state(), request.indicesOptions(), request.indices());
String[] indices = resolver.concreteIndexNames(clusterService.state(), request);
RollupSearchContext rollupSearchContext = separateIndices(indices, clusterService.state().getMetadata().indices());
MultiSearchRequest msearch = createMSearchRequest(request, registry, rollupSearchContext);

View File

@ -409,3 +409,76 @@
indices.delete_data_stream:
name: simple-data-stream1
- is_true: acknowledged
---
"Verify data stream resolvability in rollup search":
- skip:
version: " - 7.99.99"
reason: "change to 7.8.99 after backport"
features: allowed_warnings
- do:
allowed_warnings:
- "index template [my-template1] has index patterns [simple-data-stream1] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template1] will take precedence during new index creation"
indices.put_index_template:
name: my-template1
body:
index_patterns: [simple-data-stream1]
template:
mappings:
properties:
'@timestamp':
type: date
partition:
type: keyword
price:
type: integer
data_stream:
timestamp_field: '@timestamp'
- do:
indices.create_data_stream:
name: simple-data-stream1
- is_true: acknowledged
- do:
index:
index: simple-data-stream1
body: { partition: a, price: 1, '@timestamp': '2020-12-12T00:00:00.000Z' }
- do:
index:
index: simple-data-stream1
body: { partition: a, price: 2, '@timestamp': '2020-12-12T01:00:00.000Z' }
- do:
index:
index: simple-data-stream1
body: { partition: b, price: 3, '@timestamp': '2020-12-12T01:00:00.000Z' }
- do:
indices.refresh:
index: simple-data-stream1
- do:
rollup.rollup_search:
index: "simple-data-stream1"
body:
size: 0
aggs:
histo:
date_histogram:
field: "@timestamp"
calendar_interval: "1h"
time_zone: "UTC"
- length: { aggregations.histo.buckets: 2 }
- match: { aggregations.histo.buckets.0.key_as_string: "2020-12-12T00:00:00.000Z" }
- match: { aggregations.histo.buckets.0.doc_count: 1 }
- match: { aggregations.histo.buckets.1.key_as_string: "2020-12-12T01:00:00.000Z" }
- match: { aggregations.histo.buckets.1.doc_count: 2 }
- do:
indices.delete_data_stream:
name: simple-data-stream1
- is_true: acknowledged