Robert Stupp created CASSANDRA-8289:
---------------------------------------

             Summary: Allow users to debug/test UDF
                 Key: CASSANDRA-8289
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8289
             Project: Cassandra
          Issue Type: New Feature
            Reporter: Robert Stupp
            Assignee: Robert Stupp
             Fix For: 3.0


Currently it's not possible to execute unit tests against UDFs nor is it 
possible to debug them.

Idea is to provide some kind of minimalistic "framework" to execute at least 
scalar UDFs from a unit test.

Basically that UDF-executor would take the information that 'CREATE FUNCTION' 
takes, compiles that UDF and allows the user to call it using plain java calls.

It case of the Java language it could also generate Java source files to enable 
users to set breakpoints.

For example:
{code}
import org.apache.cassandra.udfexec.*

public class MyUnitTest {
  @Test
  public void testIt() {
    UDFExec sinExec = UDFExec.compile("sin", "java",
      Double.class, // return type
      Double.class  // argument type(s)
    );
    sinExec.call(2.0d);
    sinExec.call(null);
  }
}
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to