根据名称从Cassandra中选择特定列

根据名称从Cassandra中选择特定列,cassandra,Cassandra,我有一个cassandra数据库,其中的列可以根据应用程序的需要添加或删除。列名以前缀RSSI开头。我想知道是否可以选择列名类似%RSSI%的所有列。在MYSQL中,您可以从INFORMATION\u SCHEMA.COLUMNS中执行类似于的操作,其中table\u name='MACTrain'和column\u name类似于'%RSSI%'。在卡桑德拉有可能吗?如果不是,那么什么解决方案可以基于特定通配符选择列。您可以通过查询系统键空间来获取表的列元数据: select * from s

我有一个cassandra数据库,其中的列可以根据应用程序的需要添加或删除。列名以前缀
RSSI
开头。我想知道是否可以选择列名类似
%RSSI%
的所有列。在MYSQL中,您可以从INFORMATION\u SCHEMA.COLUMNS中执行类似于
的操作,其中table\u name='MACTrain'和column\u name类似于'%RSSI%'
。在卡桑德拉有可能吗?如果不是,那么什么解决方案可以基于特定通配符选择列。

您可以通过查询
系统
键空间来获取表的列元数据:

select * from system.schema_columns 
where keyspace_name = 'yourks' and columnfamily_name = 'yourtable';
select * from system_schema.columns 
where keyspace_name = 'yourks' and table_name = 'yourtable';
对于Cassandra v3.0及更高版本,您可以使用新的
system\u模式
keyspace:

select * from system.schema_columns 
where keyspace_name = 'yourks' and columnfamily_name = 'yourtable';
select * from system_schema.columns 
where keyspace_name = 'yourks' and table_name = 'yourtable';