cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Stupp (JIRA)" <>
Subject [jira] [Updated] (CASSANDRA-7395) Support for pure user-defined functions (UDF)
Date Thu, 26 Jun 2014 06:59:25 GMT


Robert Stupp updated CASSANDRA-7395:

    Attachment: 7395-v2.diff

Here's enhanced version of the patch. Contract for this experimental prototype:
* UDFs must be {{public static}}
* UDF name either explicitly set in annotation or derived from Java method name
* UDFs must be annotated (basic types are detected - collections, udt, tuple not)
* types in UDF annotations must be parsable by {{TypeParser}} (CQL syntax not yet)
* Bundle name is defined using tools/bin/udfloader (see above)

The udf-demo contains a _MathBundle_ with some functions.

public class MathBundle {
    @UDF(deterministic = false)
    public static Double random() { ... }

    public static BigInteger min(BigInteger a, BigInteger b) { ... }

    public static Integer min(Integer a, Integer b) { ... }

I've got a [working solution|] that scans classes for
"evil" code. It's based on regex pattern against classes used by byte code (scanned using
ASM). Maybe useful to prevent "evil" code to be loaded as UDFs.

> Support for pure user-defined functions (UDF)
> ---------------------------------------------
>                 Key: CASSANDRA-7395
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>            Reporter: Jonathan Ellis
>             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.

This message was sent by Atlassian JIRA

View raw message