如何在 Amazon Keyspaces/Cassandra 中列出不同键空间中的可用表?

How to list the available tables in different keyspaces in Amazon Keyspaces/Cassandra?

我正在尝试使用 AWS Keyspace Cassandra 和 Cassandra Python 驱动程序实施应用程序。我在我的 AWS 控制台中创建了 3 个键空间。

我正在尝试查找是否有任何查询可以一次性列出所有 3 个键空间中的所有可用表。 我尝试了以下查询,但它失败了。

SELECT table_name, keyspace_name from system_schema.tables where keyspace_name IN ('mykeyspace','cycling')

AWS Keyspace 中的 CQL 编辑器是否不允许使用 IN 关键字?有人知道这样的查询或命令吗?

它确实允许我们在 Cassandra 中使用 IN 子句,甚至我也可以使用相同的查询访问表。

cassandra@cqlsh> SELECT table_name, keyspace_name 来自 system_schema.tables 其中 keyspace_name 在 ('system_traces','youkudbhelper' );

table_name | keyspace_name ----------------------+----------------

(10 行) cassandra@cqlsh> 退出 bash-4.2$ cqlsh --version cqlsh 5.0.1 bash-4.2$

参考文献:

https://docs.datastax.com/en/cql-oss/3.3/cql/cql_using/useQueryIN.html

以下查询在 Cassandra 中运行,以列出不同键空间中的可用表。

SELECT table_name, keyspace_name from system_schema.tables where keyspace_name IN ('mykeyspace','cycling');

但 AWS Keyspaces 失败,因为 AWS Keyspaces 尚不支持 IN 关键字。