0

I am testing Elassandra and have some problems with creating a mapping between the existincg Cassandra tables and Elasticsearch.

Accordingly to the documentation, I've used this PUT request:

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

{
    "my_table" : {
        "discover" : ".*",
        "properties" : {
            "deviceid" : {
                "type" : "text",
            "timestamp": {
                "type": "date"
            }
        }
    }
}

Unfortunately I get this error and I am not sure why:

{
    "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
}

The Cassandra table definitely contains a column wiht timestamp as datatype. Here you can see the extract of 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';

Can someone give me some help with Elassandra and explain why this error occurs? Thanks in advance.

kola32_
  • 27
  • 1
  • 3

2 Answers2

0

Try "timestamp": {"type" : "date", "format": "yyyy-MM-dd HH:mm:ssZZ"}

Pramod
  • 113
  • 2
  • 14
0

There is a bug with Elassandra v6.2.3.10 which makes impossible to index clustering keys sorted in descending order.

v6.2.3.11 is about to be released and fixes the issue. In the meantime you could use v6.2.3.9.

barth
  • 431
  • 2
  • 5