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
Cassandra 如何使cqlsh正确显示文本?_Cassandra - Fatal编程技术网

Cassandra 如何使cqlsh正确显示文本?

Cassandra 如何使cqlsh正确显示文本?,cassandra,Cassandra,当我试图从Cassandra表中读取数据时,我得到了类似于二进制输出的结果: cqlsh 10.243.128.4 --debug -e "select enduser from test.cert limit 2;" enduser --------------------------------------- *7UDdnLg\x1135J"\x15%( \x10\x1c\x1aHa\x7fO\x19)1@3b\x17\x

当我试图从Cassandra表中读取数据时,我得到了类似于二进制输出的结果:

cqlsh 10.243.128.4 --debug -e "select enduser from test.cert limit 2;"

 enduser
---------------------------------------
                *7UDdnLg\x1135J"\x15%(
  \x10\x1c\x1aHa\x7fO\x19)1@3b\x17\x
我不知道为什么会这样。其他字段显示正确

表def:

CREATE TABLE test.cert (
    enduser text,
    cert_id int
    PRIMARY KEY (enduser, cert_id)
) WITH CLUSTERING ORDER BY (cert_id ASC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 1024
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';

我用命令行尝试了UTF8编码,但没有帮助。

CQL
text
数据类型是UTF-8编码的字符串,因此它只在单元格中显示数据


看起来你已经用十六进制编码存储了一些数据。如果您发布了数据应该是什么以及它是如何显示的示例,它将提供关于发生了什么的线索。干杯

CQL
text
数据类型是UTF-8编码的字符串,因此它只显示单元格中的数据


看起来你已经用十六进制编码存储了一些数据。如果您发布了数据应该是什么以及它是如何显示的示例,它将提供关于发生了什么的线索。干杯

数据由cassandra stress生成为文本。不确定为什么显示不正确。数据是由cassandra stress以文本形式生成的。不确定它为什么不能正确显示。