cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-10818) Evaluate exposure of DataType instances from JavaUDF class
Date Fri, 12 Feb 2016 13:41:18 GMT


Sylvain Lebresne commented on CASSANDRA-10818:

Not sure how I feel about silently injecting bindings, that sounds like a bit hacky to me.
Not that I have a much cleaner to suggest.

But if we're gonna silently inject something, I'd have a preference for injecting a single
"environment" object that would be used for this but could be reused later if we realize there
is more such information that could be useful inside UDF bodies.  So for instance, we'd just
expose some {{getEnv()}} method usable inside UDF which would return an {{Environment}} object
looking something like:
interface Environment
    UDTValue newArgUDTValue(String argName);
    UDTValue newReturnUDTValue();

    TupleValue newArgTupleValue(String argName);
    TupleValue newReturnTupleValue();
and to which we could add more function along the way.

I still don't love this solution, but it feels a bit less hacky than exposing a bunch of generated
names and has some future-proofness advantage. Also feels a bit easier to document (because
it's slightly less magic).

> Evaluate exposure of DataType instances from JavaUDF class
> ----------------------------------------------------------
>                 Key: CASSANDRA-10818
>                 URL:
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: CQL
>            Reporter: Robert Stupp
>            Assignee: Robert Stupp
>            Priority: Minor
>             Fix For: 3.x
> Currently UDF implementations cannot create new UDT instances.
> There's no way to create a new UT instance without having the {{com.datastax.driver.core.DataType}}
to be able to call {{com.datastax.driver.core.UserType.newValue()}}.
> From a quick look into the related code in {{JavaUDF}}, {{DataType}} and {{UserType}}
classes it looks fine to expose information about return and argument types via {{JavaUDF}}.
> Have to find some solution for script UDFs - but feels doable, too.

This message was sent by Atlassian JIRA

View raw message