Skip to content

Commit f652215

Browse files
Test for Ends with on an index
1 parent 8f6ac25 commit f652215

File tree

1 file changed

+13
-0
lines changed
  • x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq

1 file changed

+13
-0
lines changed

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClustersIT.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,19 @@ public void testNotRLikeIndex() throws Exception {
529529
assertResultMapForLike(includeCCSMetadata, result, columns, values, false, false);
530530
}
531531

532+
public void testEndsWithIndex() throws Exception {
533+
boolean includeCCSMetadata = includeCCSMetadata();
534+
Map<String, Object> result = run("""
535+
FROM test-local-index,*:test-remote-index METADATA _index
536+
| WHERE ENDS_WITH(_index, "remote-index")
537+
| STATS c = COUNT(*) BY _index
538+
| SORT _index ASC
539+
""", includeCCSMetadata);
540+
var columns = List.of(Map.of("name", "c", "type", "long"), Map.of("name", "_index", "type", "keyword"));
541+
var values = List.of(List.of(remoteDocs.size(), REMOTE_CLUSTER_NAME + ":" + remoteIndex));
542+
assertResultMap(includeCCSMetadata, result, columns, values, false);
543+
}
544+
532545
private RestClient remoteClusterClient() throws IOException {
533546
var clusterHosts = parseClusterHosts(remoteCluster.getHttpAddresses());
534547
return buildClient(restClientSettings(), clusterHosts.toArray(new HttpHost[0]));

0 commit comments

Comments
 (0)