Installation details
Scylla version (or git commit hash): 2.0
Add support for Datetime conversion functions
Example:
SELECT * FROM myTable WHERE date >= currentDate() - 2d
Source:
http://cassandra.apache.org/doc/latest/cql/functions.html#datetime-functions
need to validate / impl the following as well
Function name | Input type | Description
-- | -- | --
toDate | timeuuid | Converts the聽timeuuid聽argument into a聽date聽type
toDate | timestamp | Converts the聽timestamp聽argument into a聽date聽type
toTimestamp | timeuuid | Converts the聽timeuuid聽argument into a聽timestamp聽type
toTimestamp | date | Converts the聽date聽argument into a聽timestamp聽type
toUnixTimestamp | timeuuid | Converts the聽timeuuid聽argument into a聽bigInt聽raw value
toUnixTimestamp | timestamp | Converts the聽timestamp聽argument into a聽bigInt聽raw value
toUnixTimestamp | date | Converts the聽date聽argument into a聽bigInt聽raw value
dateOf | timeuuid | Similar to聽toTimestamp(timeuuid)聽(DEPRECATED)
unixTimestampOf | timeuuid | Similar to聽toUnixTimestamp(timeuuid)聽(DEPRECATED)
FYI: We just had an user in the users slack looking for that today
What version of C* do they use? I tried the example with -2d and it didn't work in Cassandra-3.11.2:
cqlsh:xyz> select * from dt where dt >= currentDate() - 2d;
SyntaxException: line 1:43 mismatched input '-' expecting EOF (...where dt >= currentData() [-]...)
C* documentation isn't clear whether only d is supported, probably ms, s, M, h, d, w, m, y would make sense.
It seems that toDate(.), titimestamp(.), toUnixTimestamp aren't supported by Scylla.
Most helpful comment
FYI: We just had an user in the users slack looking for that today