Migration from Cassandra 2.x to 3.x: schema_keyspaces table is gone. How do you query system keyspaces?
There is a new system keyspace called "system_schema", but there are only two tables in it:
Ok something must have gone wrong in your upgrade, because that's not right. When I check my system_schema 3.4, I see this:
[cqlsh 5.0.1 | Cassandra 3.4 | CQL spec 3.4.0 | Native protocol v4]
Use HELP for help.
aploetz@cqlsh> use system_schema ;
aploetz@cqlsh:system_schema> desc tables;
tables triggers views keyspaces dropped_columns
functions aggregates indexes types columns
There are definitely more than two tables in that keyspace.
How do I query to see what keyspaces are available?
The new way to do this, is to query system_schema.keyspaces:
aploetz@cqlsh:system_schema> SELECT * FROM keyspaces;
keyspace_name | durable_writes | replication
------------------------+----------------+-------------------------------------------------------------------------------------
zeroreplication | True | {'DC1': '0', 'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy'}
system_auth | True | {'class': 'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy'}
system_schema | True | {'class': 'org.apache.cassandra.locator.LocalStrategy'}
experfy_class | True | {'DC1': '1', 'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy'}
system | True | {'class': 'org.apache.cassandra.locator.LocalStrategy'}
stackoverflow | True | {'DC1': '1', 'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy'}
eqcontrol | True | {'DC1': '1', 'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy'}
The main difference between system.schema_keyspaces and system_schema.keyspaces, is that system_schema.keyspaces only has 3 columns instead of two (strategy_class
and strategy_options
were combined into replication
).