在elassandra中创建Map时出错

xoshrz7s  于 2021-06-10  发布在  Cassandra
关注(0)|答案(2)|浏览(310)

我正在测试elassandra,在创建现有的cg cassandra表和elasticsearch之间的Map时遇到了一些问题。
根据文档,我使用了这个put请求: PUT to http://localhost:9200/my_index/_mapping/my_table: ```
{
"my_table" : {
"discover" : ".*",
"properties" : {
"deviceid" : {
"type" : "text",
"timestamp": {
"type": "date"
}
}
}
}

不幸的是,我得到了这个错误,我不知道为什么:

{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Failed to execute query:null : Existing column [timestamp] type [timestamp] mismatch with inferred type [timestamp]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to execute query:null : Existing column [timestamp] type [timestamp] mismatch with inferred type [timestamp]",
"caused_by": {
"type": "configuration_exception",
"reason": "Existing column [timestamp] type [timestamp] mismatch with inferred type [timestamp]"
}
},
"status": 400
}

cassandra表肯定包含一个 `timestamp` 作为数据类型。在这里你可以看到 `desc my_keyspace` :

CREATE TABLE my_keyspace.my_table (
deviceid text,
timestamp timestamp,
other_column text,
PRIMARY KEY ((deviceid, other_column), timestamp)
) WITH CLUSTERING ORDER BY (timestamp DESC)
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 = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';

有人能给我一些关于elassandra的帮助并解释为什么会发生这个错误吗?提前谢谢。
iibxawm4

iibxawm41#

elassandrav6.2.3.10中存在一个bug,使得无法对按降序排序的集群键进行索引。
v6.2.3.11即将发布并修复了该问题。同时,您可以使用v6.2.3.9。

hsgswve4

hsgswve42#

试试“timestamp”:{“type”:“date”,“format”:“yyyy-mm-dd hh:mm:sszz”}

相关问题