Skip to content

Commit 393248d

Browse files
committed
Add integers data set and test multiple rows with decay
1 parent 6e4b077 commit 393248d

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/CsvTestsDataLoader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ public class CsvTestsDataLoader {
165165
private static final TestDataset MV_TEXT = new TestDataset("mv_text");
166166
private static final TestDataset DENSE_VECTOR = new TestDataset("dense_vector");
167167
private static final TestDataset COLORS = new TestDataset("colors");
168+
private static final TestDataset INTEGERS = new TestDataset("integers");
168169

169170
public static final Map<String, TestDataset> CSV_DATASET_MAP = Map.ofEntries(
170171
Map.entry(EMPLOYEES.indexName, EMPLOYEES),
@@ -231,7 +232,8 @@ public class CsvTestsDataLoader {
231232
Map.entry(DENSE_VECTOR.indexName, DENSE_VECTOR),
232233
Map.entry(COLORS.indexName, COLORS),
233234
Map.entry(MULTI_COLUMN_JOINABLE.indexName, MULTI_COLUMN_JOINABLE),
234-
Map.entry(MULTI_COLUMN_JOINABLE_LOOKUP.indexName, MULTI_COLUMN_JOINABLE_LOOKUP)
235+
Map.entry(MULTI_COLUMN_JOINABLE_LOOKUP.indexName, MULTI_COLUMN_JOINABLE_LOOKUP),
236+
Map.entry(INTEGERS.indexName, INTEGERS)
235237
);
236238

237239
private static final EnrichConfig LANGUAGES_ENRICH = new EnrichConfig("languages_policy", "enrich-policy-languages.json");
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
value:integer
2+
0
3+
10
4+
50
5+
100
6+
2500

x-pack/plugin/esql/qa/testFixtures/src/main/resources/decay.csv-spec

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ decay_result:double
9090
1.0
9191
;
9292

93+
intMultipleRows
94+
FROM integers
95+
| EVAL decay_result = decay(value, 0, 10, {"offset": 5, "decay": 0.5, "type": "linear"})
96+
| KEEP decay_result;
97+
98+
decay_result:double
99+
1.0
100+
0.75
101+
0.0
102+
0.0
103+
0.0
104+
;
105+
93106
doubleLinear
94107
required_capability: decay_function
95108

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"properties": {
3+
"value": {
4+
"type": "integer"
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)