Skip to content

Commit 544171b

Browse files
Set cluster string to null when it cannot be associated with an index
pattern
1 parent c2160bb commit 544171b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/IdentifierBuilder.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,12 @@ private static void validateClusterAndIndexPatterns(
175175
.flatMap(Arrays::stream)
176176
.toArray(String[]::new);
177177
} else if (clusterString != null) {
178+
// This is not a remote index pattern and the cluster string preceding this quoted pattern
179+
// cannot be associated with it.
180+
if (isFirstPattern == false) {
181+
clusterString = null;
182+
}
183+
178184
// Cluster alias was prefixed to the pattern and did not occur within the pattern.
179185
indices = Arrays.stream(indices)
180186
.map(IdentifierBuilder::breakPatternIntoIndices)

0 commit comments

Comments
 (0)