首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Elassandra中创建映射时出错

在Elassandra中创建映射时出错
EN

Stack Overflow用户
提问于 2019-02-04 15:16:33
回答 0查看 253关注 0票数 0

我正在测试Elassandra,在现有的Cassandra表和Elasticsearch之间创建映射时遇到了一些问题。

根据文档,我使用了这个PUT请求:

PUT to http://localhost:9200/my_index/_mapping/my_table:

代码语言:javascript
复制
{
    "my_table" : {
        "discover" : ".*",
        "properties" : {
            "deviceid" : {
                "type" : "text",
            "timestamp": {
                "type": "date"
            }
        }
    }
}

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

代码语言:javascript
复制
{
    "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的摘录

代码语言:javascript
复制
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的帮助,并解释为什么会发生这个错误?提前谢谢。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54511589

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档