Skip to content

Commit e86539b

Browse files
alex-spiesdnhatn
andcommitted
Avoid HandleLimitFS in LookupJoinTypesIT
Co-authored-by: Nhat Nguyen <[email protected]>
1 parent db3b5bb commit e86539b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/LookupJoinTypesIT.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77

88
package org.elasticsearch.xpack.esql.action;
99

10+
import org.apache.lucene.tests.util.LuceneTestCase;
1011
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
12+
import org.elasticsearch.action.index.IndexRequestBuilder;
1113
import org.elasticsearch.common.settings.Settings;
1214
import org.elasticsearch.index.mapper.extras.MapperExtrasPlugin;
1315
import org.elasticsearch.plugins.Plugin;
1416
import org.elasticsearch.test.ESIntegTestCase;
1517
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
18+
import org.elasticsearch.xcontent.XContentType;
1619
import org.elasticsearch.xpack.core.esql.action.ColumnInfo;
1720
import org.elasticsearch.xpack.esql.VerificationException;
1821
import org.elasticsearch.xpack.esql.core.type.DataType;
@@ -76,6 +79,10 @@
7679
* E.g. the field {@code main_byte} will occur another time in the index {@code main_byte_as_short} when we're testing a byte-short union
7780
* type.
7881
*/
82+
// TODO: This suite creates a lot of indices. It should be sufficient to just create 1 main index with 1 field per relevant type and 1
83+
// lookup index with 1 field per relevant type; only union types require additional main indices so we can have the same field mapped to
84+
// different types.
85+
@LuceneTestCase.SuppressFileSystems(value = "HandleLimitFS")
7986
@ClusterScope(scope = SUITE, numClientNodes = 1, numDataNodes = 1)
8087
public class LookupJoinTypesIT extends ESIntegTestCase {
8188
private static final String MAIN_INDEX_PREFIX = "main_";
@@ -322,10 +329,14 @@ private void initIndexes(TestConfigs configs) {
322329
}
323330

324331
private void initData(TestConfigs configs) {
325-
for (TestDocument doc : configs.docs()) {
326-
index(doc.indexName, doc.id, doc.source);
327-
refresh(doc.indexName);
332+
List<TestDocument> docs = configs.docs();
333+
List<IndexRequestBuilder> indexRequests = new ArrayList<>(docs.size());
334+
335+
for (TestDocument doc : docs) {
336+
var indexRequest = client().prepareIndex().setIndex(doc.indexName()).setId(doc.id).setSource(doc.source, XContentType.JSON);
337+
indexRequests.add(indexRequest);
328338
}
339+
indexRandom(true, indexRequests);
329340
}
330341

331342
private static String propertyFor(String fieldName, DataType type) {

0 commit comments

Comments
 (0)