Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 8c90e5a

Browse files
committed
Add split_time_range integration test
Recently, there was a regression caused by a bug in splitTimeRangeExt optimization (see #1454), which splits queries with long time ranges. Our unit/integration tests failed to catch the issue. The reproducer for the issue is to run a _search query: sorted by time, over some time range and with a filter. This PR adds a new integration test. This test runs the reproducing query (_search query: sorted by time, over some time range and with a filter), as well as different variations of the query: short/long time range, with/without filter, inclusive/exclusive ends of time range. This should cover the splitTimeRangeExt optimization more thoroughly. There are two types of tests: - testTimerangesHandwritten: handwritten different queries - testTimerangesRandom: randomly generated ranges
1 parent 38b6652 commit 8c90e5a

File tree

3 files changed

+480
-0
lines changed

3 files changed

+480
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
frontendConnectors:
2+
- name: elastic-ingest
3+
type: elasticsearch-fe-ingest
4+
config:
5+
listenPort: 8080
6+
- name: elastic-query
7+
type: elasticsearch-fe-query
8+
config:
9+
listenPort: 8080
10+
backendConnectors:
11+
- name: my-minimal-elasticsearch
12+
type: elasticsearch
13+
config:
14+
url: "http://{{ .elasticsearch_host }}:{{ .elasticsearch_port }}"
15+
user: elastic
16+
password: quesmaquesma
17+
- name: my-clickhouse-instance
18+
type: clickhouse-os
19+
config:
20+
url: clickhouse://{{ .clickhouse_host }}:{{ .clickhouse_port }}
21+
logging:
22+
path: "logs"
23+
level: "info"
24+
disableFileLogging: false
25+
enableSQLTracing: true
26+
processors:
27+
- name: my-query-processor
28+
type: quesma-v1-processor-query
29+
config:
30+
indexes:
31+
testtable1:
32+
target:
33+
- my-clickhouse-instance
34+
"*":
35+
target:
36+
- my-clickhouse-instance
37+
- name: my-ingest-processor
38+
type: quesma-v1-processor-ingest
39+
config:
40+
indexes:
41+
testtable1:
42+
target:
43+
- my-clickhouse-instance
44+
"*":
45+
target:
46+
- my-clickhouse-instance
47+
48+
pipelines:
49+
- name: my-elasticsearch-proxy-read
50+
frontendConnectors: [ elastic-query ]
51+
processors: [ my-query-processor ]
52+
backendConnectors: [ my-minimal-elasticsearch, my-clickhouse-instance ]
53+
- name: my-elasticsearch-proxy-write
54+
frontendConnectors: [ elastic-ingest ]
55+
processors: [ my-ingest-processor ]
56+
backendConnectors: [ my-minimal-elasticsearch, my-clickhouse-instance ]
57+

ci/it/integration_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,8 @@ func TestIndexNameRewrite(t *testing.T) {
7676
testCase := testcases.NewIndexNameRewriteTestcase()
7777
runIntegrationTest(t, testCase)
7878
}
79+
80+
func TestSplitTimeRange(t *testing.T) {
81+
testCase := testcases.NewSplitTimeRangeTestcase()
82+
runIntegrationTest(t, testCase)
83+
}

0 commit comments

Comments
 (0)