2

I have a timestamp column in a Cassandra table, how do i get the day of week from the timestamp column using cql?

Shankar
  • 7,709
  • 25
  • 81
  • 152

1 Answers1

3

There isn't support out of the box for this but

If using the CQL is a must you can have a look at the User Defined Functions:

http://cassandra.apache.org/doc/latest/cql/functions.html

http://www.datastax.com/dev/blog/user-defined-functions-in-cassandra-3-0

http://docs.datastax.com/en//cql/latest/cql/cql_using/useCreateUDF.html

Then you could use something as simple as:

How to determine day of week by passing specific date?

or even something like

Aggregation with Group By date in Spark SQL

And then you have a UDF that gives you day of the week when you are working with a dates.

Community
  • 1
  • 1
Marko Švaljek
  • 2,033
  • 13
  • 26