Apache Cassandra 3.11.6:集群键错误,cass-stress写入后表中的未定义列名

问题描述

我目前遇到一个问题,尽管在查看表时列名是集群键,但我还是尝试从cassandra中选择或插入特定列数据,并不断出现未定义的列名错误。但是,其他列的行为正常。

keyspace_name | table_name | column_name | clustering_order | column_name_bytes | kind          | position | type
---------------+------------+-------------+------------------+-------------------+---------------+----------+------
    keyspace1 |  standard1 |          C0 |             none |            0x4330 |        static |       -1 | blob
    keyspace1 |  standard1 |     column1 |              asc |  0x636f6c756d6e31 |    clustering |        0 | text
    keyspace1 |  standard1 |         key |             none |          0x6b6579 | partition_key |        0 | blob
    keyspace1 |  standard1 |       value |             none |      0x76616c7565 |       regular |       -1 | blob

cqlsh> SELECT  "column1" from keyspace1.standard1;
InvalidRequest: Error from server: code=2200 [Invalid query] message="Undefined column name column1"

cqlsh> SELECT  "C0" from keyspace1.standard1;

 C0
------------------------
 0xdc9e1bf05eab897f470a
 0x5ff08459ccd892a25f91
 0x85182fdfe7f86306cd58
 0x10f1dd6febff8cbcf3ad
 0xb8e05320cd1037d6e317

此外,在插入数据时,尽管column1是“ undefined”,但仍需要作为聚簇键

cqlsh> insert into keyspace1.standard1 (key) VALUES (0xcccc) ;
InvalidRequest: Error from server: code=2200 [Invalid query] message="Some clustering keys are missing: column1"

但是,当将数据插入其他列时,行为是正常的

cqlsh> insert into keyspace1.standard1 (key,"C0") VALUES (0xcccc,0xbbbb) ;  
cqlsh> SELECT  "C0" from keyspace1.standard1;

 C0                      key
 ----------------------- ------------------------
 0xdc9e1bf05eab897f470a 0x37373539364d4f323330
                 0xbbbb                 0xcccc
 0x5ff08459ccd892a25f91 0x4f503030314c35393330
 0x85182fdfe7f86306cd58 0x30503337373039503231
 0x10f1dd6febff8cbcf3ad 0x394e35344e4b34383631
 0xb8e05320cd1037d6e317 0x4f384c4b37394c4f3631

这是在我运行cassandra-stress之后,并且我在3.11.4中运行了类似的测试,并且运行良好,但是当查询column1(集群键)条目全部为空时,这是我不认为的可能。

此预期行为是否从3.11.4开始更改?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)