Details
-
Improvement
-
Status: Resolved
-
Low
-
Resolution: Fixed
-
Clients
Description
I have defined the following UDF
CREATE OR REPLACE FUNCTION maxOf(current int, testValue int) RETURNS NULL ON NULL INPUT RETURNS int LANGUAGE java AS 'return Math.max(current,testValue);' CREATE TABLE maxValue(id int primary key, val int); INSERT INTO maxValue(id, val) VALUES(1, 100); SELECT maxOf(val, 101) FROM maxValue WHERE id=1;
I got the following error message:
SyntaxException: <ErrorMessage code=2000 [Syntax error in CQL query] message="line 1:19 no viable alternative at input '101' (SELECT maxOf(val1, [101]...)">
It would be nice to allow literal value as parameter of UDF and UDA too.
I was thinking about an use-case for an UDA groupBy() function where the end user can inject at runtime a literal value to select which aggregation he want to display, something similar to GROUP BY ... HAVING <filter clause>
Attachments
Issue Links
- depends upon
-
CASSANDRA-7396 Allow selecting Map values and Set elements
- Resolved
- is depended upon by
-
CASSANDRA-11871 Allow to aggregate by time intervals
- Resolved
- is duplicated by
-
CASSANDRA-9243 Literals should be valid selectors in SELECT statements
- Resolved
-
CASSANDRA-9253 Bind markers should be allowed in function arguments of Selectors
- Resolved
- links to