Skip to content

Commit db2234b

Browse files
committed
simplify
1 parent 9056ad4 commit db2234b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/IdentifierGenerator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ public static String randomIndexPattern(Feature... features) {
7979
}
8080

8181
var pattern = maybeQuote(index.toString());
82+
if (pattern.contains("|")) {
83+
pattern = quote(unquoteIndexPattern(pattern));
84+
}
85+
8286
if (canAdd(Features.CROSS_CLUSTER, features)) {
8387
var cluster = maybeQuote(randomIdentifier());
8488
pattern = maybeQuote(cluster + ":" + pattern);
8589
}
8690

87-
if (pattern.contains("|") && pattern.endsWith("\"") == false) {
88-
pattern = quote(unquoteIndexPattern(pattern));
89-
}
90-
9191
return pattern;
9292
}
9393

0 commit comments

Comments
 (0)