我正在测试 Elassandra,在现有 Cassandra 表和 Elasticsearch 之间创建映射时遇到了一些问题。
根据文档,我使用了这个 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 的帮助并解释为什么会发生此错误吗?提前谢谢。
尝试 "timestamp": {"type" : "date", "format": "yyyy-MM-dd HH:mm:ssZZ"}
Elassandra v6.2.3.10 存在一个错误,使得无法索引按降序排序的聚类键。
v6.2.3.11 即将发布并修复了该问题。同时,您可以使用v6.2.3.9。