Skip to content

Commit a9463b5

Browse files
committed
Extend validateTableName Javadoc to cover wildcard/multi-target rejection
The Javadoc previously described only the regex allow-list and the _all / . / .. rejections; update it to also mention the dedicated wildcard ('*') and comma-separated multi-target rejection branch introduced in this PR, so the doc matches the method body. Signed-off-by: Eric Wei <mengwei.eric@gmail.com>
1 parent 9a6c06a commit a9463b5

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

opensearch/src/main/java/org/opensearch/sql/opensearch/storage/VectorSearchTableFunctionImplementation.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,13 @@ private void validateNamedArgs() {
196196
/**
197197
* Reject table names with characters that could corrupt the WrapperQueryBuilder JSON or escape
198198
* the target index name. Allows alphanumeric, dots, underscores, and hyphens (the characters
199-
* OpenSearch index names already permit). Explicitly rejects the `_all` routing target and the
200-
* pathologic `.` / `..` names because those either fan out to every index or are not valid
201-
* concrete index names. Other native-invalid names (leading dot, leading hyphen, bare underscore,
202-
* uppercase, and so on) are intentionally passed through for the OpenSearch client to reject with
203-
* its own error message.
199+
* OpenSearch index names already permit). Explicitly rejects wildcards ('*') and multi-target
200+
* patterns (comma-separated) with a dedicated message, because vectorSearch() targets a single
201+
* concrete index or alias and fan-out patterns would otherwise fall through to the generic regex
202+
* message. Also rejects the `_all` routing target and the pathologic `.` / `..` names because
203+
* those either fan out to every index or are not valid concrete index names. Other native-invalid
204+
* names (leading dot, leading hyphen, bare underscore, uppercase, and so on) are intentionally
205+
* passed through for the OpenSearch client to reject with its own error message.
204206
*/
205207
private void validateTableName(String tableName) {
206208
// Dedicated error for fan-out patterns ('*' and ',') before the generic regex; see Javadoc

0 commit comments

Comments
 (0)