Details
-
Bug
-
Status: Resolved
-
Low
-
Resolution: Duplicate
-
None
-
None
-
Low
Description
When trying to ALTER a COMPACT TABLE without clustering keys (i.e. non-dense one), you'll get an exception.
Adding regular columns to non-dense compact tables should be forbidden (adding static ones already fails with Static columns are not allowed in COMPACT STORAGE tables), just as adding columns to dense compact tables which throws Cannot add new column to a COMPACT STORAGE table (or the error message should be adjusted).
dtest to reproduce:
from cql_tests import CQLTester class StorageProxyCQLTester(CQLTester): def test_sparse_compact(self): session = self.prepare(nodes=2, rf=2) session.execute("CREATE TABLE sparse_compact_table (k int PRIMARY KEY, v1 int, v2 int) WITH COMPACT STORAGE;") session.execute("ALTER TABLE sparse_compact_table ADD wat int",)
Exception:
java.lang.AssertionError: null at org.apache.cassandra.db.CompactTables.getCompactValueColumn(CompactTables.java:67) ~[main/:na] at org.apache.cassandra.config.CFMetaData.rebuild(CFMetaData.java:337) ~[main/:na] at org.apache.cassandra.config.CFMetaData.validate(CFMetaData.java:935) ~[main/:na] at org.apache.cassandra.service.MigrationManager.announceColumnFamilyUpdate(MigrationManager.java:421) ~[main/:na] at org.apache.cassandra.cql3.statements.AlterTableStatement.announceMigration(AlterTableStatement.java:288) ~[main/:na] at org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:93) ~[main/:na] at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:206) ~[main/:na] at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:237) ~[main/:na] at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:222) ~[main/:na] at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:115) ~[main/:na] at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:513) [main/:na] at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:407) [main/:na] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [netty-all-4.0.44.Final.jar:4.0.44.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357) [netty-all-4.0.44.Final.jar:4.0.44.Final] at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:35) [netty-all-4.0.44.Final.jar:4.0.44.Final] at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:348) [netty-all-4.0.44.Final.jar:4.0.44.Final] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121] at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164) [main/:na] at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) [main/:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Attachments
Issue Links
- duplicates
-
CASSANDRA-14564 Adding regular column to COMPACT tables without clustering columns should trigger an InvalidRequestException
- Resolved
- is duplicated by
-
CASSANDRA-14564 Adding regular column to COMPACT tables without clustering columns should trigger an InvalidRequestException
- Resolved