Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

arsooo avatar image
arsooo asked Erick Ramirez answered

Why is the CQL function FLOOR() only available in DataStax Enterprise?

Does anyone know, is the "floor" function available in Apache Cassandra?

This query works on Datastax's Cassandra

SELECT min(value) AS min, timestamp  FROM test WHERE id=2020 AND timestamp>=1596240000073 AND timestamp<1598917999073 GROUP BY floor(timestamp, 10s);

But I can't run the same on Apache Cassandra.

dsecqlaggregation
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

The FLOOR() function for aggregating GROUP BY results was added in DSE 6.0 (DB-75).

It has not been added to open-source Apache Cassandra. The equivalent implementation is CASSANDRA-11871 originally planned for Cassandra 3.11 but did not make the cut. It has been slotted for C* 4.0 but has not been done yet. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.