GrafanaCassandraDatasource
GrafanaCassandraDatasource copied to clipboard
Support non timestamp type time field
It's realy a great work, but unfortunately i had a legacy cassandra table that use "bigint" as the only "Time Column" and it seemed the "Time Column" only support "timestamp" type.
It would be great if it can support "$__unixEpochFrom" and "$__unixEpochFrom" such as other database data source.
Thank You.
A workaround could be to use blobAsTimestamp(bigintAsBlob(someColumn))
. See https://docs.datastax.com/en/cql-oss/3.3/cql/cql_reference/blob_r.html.
@unflag This one is closed by #172, is it?
Not exactly, unfortunately. There are two problems:
- Support
$__unixEpochFrom
/$__unixEpochTo
macros to use their values in query, which should be easy to implement. - Convert returned
bigint
value totimestamp
, because without this grafana will consider it a value, not a time. And there is a question - how to decide which numeric value in a row is a timestamp and which is a numeric value? I guess, we should rely on cassandra functions and convert types in query, not in datasource.
Theoretically we can decide based on the argument's order, can we?