[ 
https://issues.apache.org/jira/browse/CASSANDRA-8289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Stupp updated CASSANDRA-8289:
------------------------------------
    Description: 
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.

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

It could also check for timeouts to identify e.g. "endless loop" scenarios or 
do some byte code analysis to check for "evil" package usage.

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}

Note: this one is not intended to do some "magic" to start a debugger on a C* 
node and debug it there.

  was:
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.

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

It could also check for timeouts to identify e.g. "endless loop" scenarios or 
do some byte code analysis to check for "evil" package usage.

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}



> 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
>              Labels: udf
>             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.
> In case of the Java language it could also generate Java source files to 
> enable users to set breakpoints.
> It could also check for timeouts to identify e.g. "endless loop" scenarios or 
> do some byte code analysis to check for "evil" package usage.
> 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}
> Note: this one is not intended to do some "magic" to start a debugger on a C* 
> node and debug it there.



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

Reply via email to