Skip to content

Commit 3fd48e4

Browse files
Add more test datasets
1 parent a17fa88 commit 3fd48e4

File tree

5 files changed

+90
-1
lines changed

5 files changed

+90
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ public class CsvTestsDataLoader {
6363
private static final TestDataset HOSTS = new TestDataset("hosts");
6464
private static final TestDataset APPS = new TestDataset("apps");
6565
private static final TestDataset APPS_SHORT = APPS.withIndex("apps_short").withTypeMapping(Map.of("id", "short"));
66+
private static final TestDataset MULTI_COLUMN_JOINABLE = new TestDataset(
67+
"multi_column_joinable",
68+
"mapping-multi_column_joinable.json",
69+
"multi_column_joinable.csv"
70+
);
71+
private static final TestDataset MULTI_COLUMN_JOINABLE_LOOKUP = new TestDataset(
72+
"multi_column_joinable_lookup",
73+
"mapping-multi_column_joinable2.json",
74+
"multi_column_joinable2.csv"
75+
).withSetting("lookup-settings.json");
6676
private static final TestDataset LANGUAGES = new TestDataset("languages");
6777
private static final TestDataset LANGUAGES_LOOKUP = LANGUAGES.withIndex("languages_lookup").withSetting("lookup-settings.json");
6878
private static final TestDataset LANGUAGES_LOOKUP_NON_UNIQUE_KEY = LANGUAGES_LOOKUP.withIndex("languages_lookup_non_unique_key")
@@ -213,7 +223,9 @@ public class CsvTestsDataLoader {
213223
Map.entry(LOGS.indexName, LOGS),
214224
Map.entry(MV_TEXT.indexName, MV_TEXT),
215225
Map.entry(DENSE_VECTOR.indexName, DENSE_VECTOR),
216-
Map.entry(COLORS.indexName, COLORS)
226+
Map.entry(COLORS.indexName, COLORS),
227+
Map.entry(MULTI_COLUMN_JOINABLE.indexName, MULTI_COLUMN_JOINABLE),
228+
Map.entry(MULTI_COLUMN_JOINABLE_LOOKUP.indexName, MULTI_COLUMN_JOINABLE_LOOKUP)
217229
);
218230

219231
private static final EnrichConfig LANGUAGES_ENRICH = new EnrichConfig("languages_policy", "enrich-policy-languages.json");
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
id_int,name_str,is_active_bool,ip_addr,extra1,extra2
2+
1,Alice,true,192.168.1.1,foo,100
3+
2,Bob,false,192.168.1.2,bar,200
4+
3,Charlie,true,192.168.1.3,baz,300
5+
4,David,false,192.168.1.4,qux,400
6+
5,Eve,true,192.168.1.5,quux,500
7+
6,,true,192.168.1.6,corge,600
8+
7,Grace,false,,grault,700
9+
8,Hank,true,192.168.1.8,garply,800
10+
9,Ivy,false,192.168.1.9,waldo,900
11+
10,John,true,192.168.1.10,fred,1000
12+
,Kate,false,192.168.1.11,plugh,1100
13+
12,Liam,true,192.168.1.12,xyzzy,1200
14+
13,Mia,false,192.168.1.13,thud,1300
15+
14,Nina,true,192.168.1.14,foo2,1400
16+
15,Oscar,false,192.168.1.15,bar2,1500
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
id_int,name_str,is_active_bool,ip_addr,other1,other2
2+
1,Alice,true,192.168.1.1,alpha,1000
3+
1,Alice,true,192.168.1.2,beta,2000
4+
2,Bob,false,192.168.1.3,gamma,3000
5+
3,Charlie,true,192.168.1.3,delta,4000
6+
3,Charlie,false,192.168.1.3,epsilon,5000
7+
4,David,false,192.168.1.4,zeta,6000
8+
5,Eve,true,192.168.1.5,eta,7000
9+
5,Eve,true,192.168.1.5,theta,8000
10+
6,,true,192.168.1.6,iota,9000
11+
7,Grace,false,,kappa,10000
12+
8,Hank,true,192.168.1.8,lambda,11000
13+
,Kate,false,192.168.1.11,mu,12000
14+
12,Liam,true,192.168.1.12,nu,13000
15+
13,Mia,false,192.168.1.13,xi,14000
16+
14,Nina,true,192.168.1.14,omicron,15000
17+
16,Paul,true,192.168.1.16,pi,16000
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"properties": {
3+
"id_int": {
4+
"type": "integer"
5+
},
6+
"name_str": {
7+
"type": "keyword"
8+
},
9+
"is_active_bool": {
10+
"type": "boolean"
11+
},
12+
"ip_addr": {
13+
"type": "ip"
14+
},
15+
"extra1": {
16+
"type": "keyword"
17+
},
18+
"extra2": {
19+
"type": "integer"
20+
}
21+
}
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"properties": {
3+
"id_int": {
4+
"type": "integer"
5+
},
6+
"name_str": {
7+
"type": "keyword"
8+
},
9+
"is_active_bool": {
10+
"type": "boolean"
11+
},
12+
"ip_addr": {
13+
"type": "ip"
14+
},
15+
"other1": {
16+
"type": "keyword"
17+
},
18+
"other2": {
19+
"type": "integer"
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)