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

Tyler Hobbs commented on CASSANDRA-7395:
----------------------------------------

Comments on 7395.txt:
* UFMetadata
** Class docstring is bad
** Commented out code: {{//CompositeType.getInstance(UTF8Type.instance, 
UTF8Type.instance);}}
** toString(): missing opening curly and class name?  Signature format is a bit 
strange as well.
* CreateFunctionStatement
** doExecute():
*** ifNotExists is not used correctly
*** add comment about why you add to the registry first and then check invalid
* UDFFunctionOverloads
** License header needs to be ASF
* StdLibMath
** License header needs to be ASF
** Could move these into UFTest if we don't intend keep these long-term. (I'm 
not sure if we do.)
* UDFunction
** Capitalize "invalid UDF language" => "Invalid UDF language"
** When invocation fails, don't throw an IRE.  Rethrow the "cause" exception 
instead.
*** Instead of responding with a full stacktrace, log the error and just use 
the classname/message for the response.
* DefsTables
** mergeFunctions(): refers to keyspaces, but each partition is actually a set 
of overloaded functions with the same name.  Just needs cleanup of comments and 
variable names.
* UFTest
** Cover {{CREATE IF NOT EXISTS}}
** Check failure of normal CREATE when function exists
** Cover {{DROP IF EXISTS}}

What's the purpose of {{keyspaceRefs}}?

Regarding schema change events, we do want to return a SCHEMA_CHANGE Event for 
UDF DDL operations, and we want to push the same event to listeners.  However, 
we only want to do this when protocol_version >= 4. (I think we should go ahead 
and bump the protocol version in transport.Server and QueryOptions)  I would 
add FUNCTION to the TARGET enum instead of making a new Event subclass.

The reason we need to respond with a schema change message is so that drivers 
can know they should wait for schema agreement.  Pushed notifications are a 
little less useful (IMO), but I spoke with Sylvain and we agreed these should 
still happen in some fashion.  If you feel like you want to split this work 
out, it's okay, just open another ticket.

Dtests:
* Bad docstring on test_migration
* Commented out code at the bottom

bq. UFMetaData/compatibleArgs: I'd like to defer the change to a separate 
commit because it touches a lot of files. But I'm +1 to do that.

Okay, but it should probably be done as part of this ticket.  Feel free to 
split that out into a separate patch.

> 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
>            Assignee: Robert Stupp
>              Labels: cql
>             Fix For: 3.0
>
>         Attachments: 7395-dtest.txt, 7395.txt, udf-create-syntax.png, 
> udf-drop-syntax.png
>
>
> 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