Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用Cassandra 3中的CQL来确定表是否使用紧凑型存储?_Cassandra_Cql3 - Fatal编程技术网

如何使用Cassandra 3中的CQL来确定表是否使用紧凑型存储?

如何使用Cassandra 3中的CQL来确定表是否使用紧凑型存储?,cassandra,cql3,Cassandra,Cql3,如果我使用Cassandra 3附带的cqlsh工具,它可以告诉我是否使用压缩存储创建了表。我所要做的就是描述表名并显示用于创建表的CQL descripe功能是cqlsh的功能,而不是CQL语言的功能。我需要确定一个表是否只使用CQL使用压缩存储。我需要在system\u模式中查询什么来确定表是否使用压缩存储?根据cassandra python驱动程序中TableMetadataV3类的定义,确定压缩存储的逻辑如下 flags = row.get('flags', set())

如果我使用Cassandra 3附带的
cqlsh
工具,它可以告诉我是否使用压缩存储创建了表。我所要做的就是
描述表名并显示用于创建表的CQL


descripe
功能是
cqlsh
的功能,而不是CQL语言的功能。我需要确定一个表是否只使用CQL使用压缩存储。我需要在
system\u模式中查询什么来确定表是否使用压缩存储?

根据cassandra python驱动程序中
TableMetadataV3
类的定义,确定压缩存储的逻辑如下

 flags = row.get('flags', set())
            if flags:
                compact_static = False
                table_meta.is_compact_storage = 'dense' in flags or 'super' in flags or 'compound' not in flags
                is_dense = 'dense' in flags
            else:
                compact_static = True
                table_meta.is_compact_storage = True
                is_dense = False
对象是一个字典,它是查询
“SELECT*fromsystem\u schema.tables”

因此,要确定表是否使用压缩存储,需要执行以下步骤

  • 使用CQL查询
    从key space\u name=?和表名称=?
    。将中的键空间和表替换为参数
  • 如果标志为空,则表使用压缩存储
  • 如果标志以“稠密”或“超级”作为集合的成员出现,则表使用压缩存储
  • 如果集合中没有“component”,则表使用压缩存储
  • 否则,表不使用压缩存储

  • 在cassandra>3.0中,紧凑型存储只是一个占位符,没有任何意义。他们更新了存储引擎,现在一切都很紧凑。这是错误的。使用紧凑型存储对表的操作有很多限制。请检查和。“事实上,无论是否使用紧凑型存储,表的内部布局都完全相同,因此对磁盘上的大小没有任何影响。”。除了限制你的工作之外,这没有任何区别。如果你阅读雇主自己的文档,你会发现它明显地限制了主键:可能是因为它包括2.2版本,该版本仍然有紧凑的存储,但有点过时。在3.0之后,对创建/更改的限制是存在的,但这些限制是肤浅的,因为紧凑表和非紧凑表之间没有区别。我开了一张票来更新文档,谢谢