0

I have a table, one column is a UDT

CREATE TYPE baseinfo (
    head_commission_nr text,
    internal_source text,
    internal_changed date,
);

ES mapping for that part of the table:

    "internal_changed": {
      "type": "date",
      "cql_collection": "singleton"
    }

Indexing fails with:

"type": "mapper_parsing_exception", "reason": "Failed to execute query:null : Field "internal_changed" with type date does not match type timestamp", "caused_by": { "type": "invalid_request_exception", "reason": "Field "internal_changed" with type date does not match type timestamp" }

What am I doing wrong?

Alex Tbk
  • 2,042
  • 2
  • 20
  • 38
  • please share a sample record of date format in UDT. obviously date format between UDT and elasticsearch are different. are you using logstash? – hamid bayat Nov 24 '20 at 07:35
  • Example data: { head_commission_nr : '90021', internal_source : 'C16', internal_changed : '1996-08-01' }. I am using elassandra. – Alex Tbk Nov 24 '20 at 07:40
  • how do you index data? – hamid bayat Nov 24 '20 at 07:42
  • PUT http://10.164.0.53:9200/deviceinfo { "settings" : { "keyspace" : "iot_data" }, "mappings" : { "deviceinfo": { "properties": { "baseinfo": { "type": "nested", "cql_collection": "singleton", "cql_udt_name": "baseinfo", "properties": { "internal_changed": { "type": "date", "cql_collection": "singleton" } } } } } } } – Alex Tbk Nov 24 '20 at 07:57

1 Answers1

0

delete the indices have been created and change the mapping like this:

 "internal_changed": {
      "type": "date",
      "format": "yyyy-MM-dd ",
      "cql_collection": "singleton"
    }
    
hamid bayat
  • 2,029
  • 11
  • 20
  • Already tried that, this returns the same error as above: "caused_by": { "type": "invalid_request_exception", "reason": "Field \"internal_changed\" with type date does not match type timestamp" } – Alex Tbk Nov 24 '20 at 08:36
  • @AlexTbk are you check via _mapping or _template? – hamid bayat Nov 24 '20 at 09:00
  • Im sending the exact PUT query as in my last comment on the question above, with the added "format" field – Alex Tbk Nov 24 '20 at 09:01
  • please check the mapping is applied? via XGET 10.164.0.53:9200/deviceinfo/_mapping – hamid bayat Nov 24 '20 at 09:05
  • The mapping is not applied. Bad request. I helped myself for now by converting the field to a Long - Date().getMillisSinceEpoch() – Alex Tbk Nov 24 '20 at 09:18