Skip to content

Commit f6ec54f

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 2c28a86 commit f6ec54f

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
@@ -227,11 +227,13 @@ private void validateNamedArgs() {
227227
/**
228228
* Reject table names with characters that could corrupt the WrapperQueryBuilder JSON or escape
229229
* the target index name. Allows alphanumeric, dots, underscores, and hyphens (the characters
230-
* OpenSearch index names already permit). Explicitly rejects the `_all` routing target and the
231-
* pathologic `.` / `..` names because those either fan out to every index or are not valid
232-
* concrete index names. Other native-invalid names (leading dot, leading hyphen, bare underscore,
233-
* uppercase, and so on) are intentionally passed through for the OpenSearch client to reject with
234-
* its own error message.
230+
* OpenSearch index names already permit). Explicitly rejects wildcards ('*') and multi-target
231+
* patterns (comma-separated) with a dedicated message, because vectorSearch() targets a single
232+
* concrete index or alias and fan-out patterns would otherwise fall through to the generic regex
233+
* message. Also rejects the `_all` routing target and the pathologic `.` / `..` names because
234+
* those either fan out to every index or are not valid concrete index names. Other native-invalid
235+
* names (leading dot, leading hyphen, bare underscore, uppercase, and so on) are intentionally
236+
* passed through for the OpenSearch client to reject with its own error message.
235237
*/
236238
private void validateTableName(String tableName) {
237239
// Dedicated error for fan-out patterns ('*' and ',') before the generic regex; see Javadoc

0 commit comments

Comments
 (0)