Skip to content

Commit

Permalink
validate schemaName must not have double underscore (#14511)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohityadav1993 authored Nov 21, 2024
1 parent 1eaf42c commit 18cd776
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ private void validateSchemaName(Schema schema) {
throw new ControllerApplicationException(LOGGER,
"Invalid schema. Reason: 'schemaName' should not be null or empty", Response.Status.BAD_REQUEST);
}
if (schema.getSchemaName().contains(TableConfig.TABLE_NAME_FORBIDDEN_SUBSTRING)) {
throw new IllegalStateException("'schemaName' cannot contain double underscore ('__')");
}
}

private void validateSchemaInternal(Schema schema) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class TableConfig extends BaseJsonConfig {
public static final String TIER_OVERWRITES_KEY = "tierOverwrites";

// Double underscore is reserved for real-time segment name delimiter
private static final String TABLE_NAME_FORBIDDEN_SUBSTRING = "__";
public static final String TABLE_NAME_FORBIDDEN_SUBSTRING = "__";

/* MANDATORY FIELDS */

Expand Down

0 comments on commit 18cd776

Please sign in to comment.