File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
doc/modules/cassandra/pages/cql
test/unit/org/apache/cassandra/schema Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,10 @@ include::example$BNF/ks_table.bnf[]
2222----
2323
2424Both keyspace and table name should be comprised of only alphanumeric
25- characters, cannot be empty and are limited in size to 48 characters
26- (that limit exists mostly to avoid filenames (which may include the
25+ or underscore characters and cannot be empty.
26+ Keyspace name is limited in size to 48 characters, while
27+ table name is limited in size to 222 characters
28+ (those limits exist mostly to avoid filenames (which may include the
2729keyspace and table name) to go over the limits of certain file systems).
2830By default, keyspace and table names are case-insensitive (`myTable` is
2931equivalent to `mytable`) but case sensitivity can be forced by using
Original file line number Diff line number Diff line change 4040import static org .apache .cassandra .schema .SchemaConstants .TABLE_NAME_LENGTH ;
4141import static org .assertj .core .api .Assertions .assertThat ;
4242import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
43+ import static org .junit .Assert .assertEquals ;
4344import static org .junit .Assert .assertTrue ;
4445import static org .junit .Assert .fail ;
4546
@@ -170,6 +171,9 @@ public void testCreatingTableWithLongName() throws Throwable
170171 String tableName = StringUtils .repeat ("t" , FILENAME_LENGTH - tableIdSuffix );
171172 String tooLongTableName = StringUtils .repeat ("l" , FILENAME_LENGTH - tableIdSuffix + 1 );
172173
174+ // Assert that the documented value of 222 corresponds to the actual constant.
175+ assertEquals (222 , TABLE_NAME_LENGTH );
176+
173177 execute (String .format ("CREATE KEYSPACE %s with replication = " +
174178 "{ 'class' : 'SimpleStrategy', 'replication_factor' : 1 }" ,
175179 keyspaceName ));
You can’t perform that action at this time.
0 commit comments