[ 
https://issues.apache.org/jira/browse/CASSANDRA-7395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14056350#comment-14056350
 ] 

Sylvain Lebresne commented on CASSANDRA-7395:
---------------------------------------------

bq. Using something like CREATE FUNCTION sum(a bigint, b bigint) AS ( return a 
+ b; ) is much easier to understand and to maintain than AS foo.bar.Class.method

I've never used BCEL so I'm not sure how easy it would be to use it for that. 
I'm not entirely sure it will be trivial however. And I suspect some people 
will prefer the {{AS foo.bar.Class.method}} to be here anyway (maybe because 
deploying the class file is not a big deal for them a). So I think it's a 
simple first step. What I would do here is start with that {{AS 
foo.bar.Class.method}} support. This does not preclude any further improvement, 
it's just about dealing with one problem at a time. Then we can extend thing to 
support BCEL in CASSANDRA-7526 (I'm not absolutely set on using nashorn in that 
ticket).

I guess if using BCEL is trivial and if we're all convinced that it's not worth 
providing the ability to define the function from a class, then I guess I won't 
fight the idea of starting with BCEL right away. But otherwise, I'd have a 
preference for focusing on the first part first, and moving the rest to 
CASSANDRA-7526. 

> Support for pure user-defined functions (UDF)
> ---------------------------------------------
>
>                 Key: CASSANDRA-7395
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7395
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Jonathan Ellis
>              Labels: cql
>             Fix For: 3.0
>
>         Attachments: 7395-v2.diff, 7395.diff
>
>
> We have some tickets for various aspects of UDF (CASSANDRA-4914, 
> CASSANDRA-5970, CASSANDRA-4998) but they all suffer from various degrees of 
> ocean-boiling.
> Let's start with something simple: allowing pure user-defined functions in 
> the SELECT clause of a CQL query.  That's it.
> By "pure" I mean, must depend only on the input parameters.  No side effects. 
>  No exposure to C* internals.  Column values in, result out.  
> http://en.wikipedia.org/wiki/Pure_function



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to