elassandra icon indicating copy to clipboard operation
elassandra copied to clipboard

Support for Cassandra Duration type

Open RyanQuey opened this issue 4 years ago • 3 comments

Describe the feature: Support for duration data type Currently, unless I am mistaken there does not seem to be support for Cassandra's duration data type. When I try to create an ES index for my existing C* table of type duration, I get the following error:

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

Furthermore, the duration type is not mentioned in Elassandra's docs related to type mapping.

It would be nice to have support for this if possible, though I'm not sure how it would be implemented exactly

RyanQuey avatar Jun 29 '20 07:06 RyanQuey

Cassandra duration is not supported, as far as I know, there is not corresponding types in Lucene for that.

On 29 Jun 2020, at 09:13, Ryan Quey [email protected] wrote:

Describe the feature: Support for duration data type Currently, unless I am mistaken there does not seem to be support for Cassandra's duration data type https://cassandra.apache.org/doc/3.11/cql/types.html#working-with-durations. When I try to create an ES index for my existing C* table of type duration, I get the following error:

{"error":{ "root_cause": [{"type":"mapper_parsing_exception","reason":"Failed to execute query:null : Existing column [duration] type [duration] mismatch with inferred type [text]"}], "type":"mapper_parsing_exception", "reason":"Failed to execute query:null : Existing column [duration] type [duration] mismatch with inferred type [text]", "caused_by": {"type":"configuration_exception","reason":"Existing column [duration] type [duration] mismatch with inferred type [text]"}}, "status":400 } Furthermore, the duration type is not mentioned in Elassandra's docs related to type mapping https://elassandra.readthedocs.io/en/latest/mapping.html#type-mapping.

It would be nice to have support for this if possible, though I'm not sure how it would be implemented exactly

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/strapdata/elassandra/issues/355, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOMPGJ265U3DIJDWLVXBJ3RZA5IJANCNFSM4OK7JGJA.

vroyer avatar Jun 29 '20 18:06 vroyer

Ok that makes sense. Is there a recommended best practice then for handling Cassandra durations? Or is there a way to convert one into an integer (probably integer in milliseconds or nanoseconds) or something like that?

RyanQuey avatar Jun 29 '20 19:06 RyanQuey

Yes, an integer or a long (bigint in Cassandra)...

On 29 Jun 2020, at 21:00, Ryan Quey [email protected] wrote:

Ok that makes sense. Is there a recommended best practice then for handling Cassandra durations? Or is there a way to convert one into an integer (probably integer in milliseconds or nanoseconds) or something like that?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/strapdata/elassandra/issues/355#issuecomment-651300950, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOMPGLDIOV2C5NBYIGQTITRZDQEHANCNFSM4OK7JGJA.

vroyer avatar Jun 29 '20 19:06 vroyer