2016-08-22 68 views
1

我創建了用戶自定義函數fStringToDouble,它將字符串作爲參數並返回double。這個用戶定義的函數在select語句中工作正常。Cassandra是否允許在where子句中使用用戶定義的函數?

SELECT applieddatetime, fStringToDouble(variablevalue) from my_table WHERE locationid='xyz' and applieddatetime >= '2016-08-22' AND applieddatetime < '2016-08-23' ; 

當我把where子句中該用戶定義的函數,我得到的語法錯誤,如"no viable alternative at input"

SELECT applieddatetime from my_table WHERE locationid='xyz' and applieddatetime >= '2016-08-22' AND applieddatetime < '2016-08-23'and fStringToDouble(variablevalue)<6.0; 

有什麼不對上述查詢?是否有任何內置函數在Cassandra中將String轉換爲Double?

回答

相關問題