You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Robert Stupp (JIRA)" <ji...@apache.org> on 2014/11/11 09:43:33 UTC

[jira] [Updated] (CASSANDRA-8289) Allow users to debug/test UDF

     [ 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}


  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.

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}



> 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}



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