[ 
https://issues.apache.org/jira/browse/CASSANDRA-7563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14226557#comment-14226557
 ] 

Tyler Hobbs commented on CASSANDRA-7563:
----------------------------------------

There's one oddity around renaming a field in a UDT that's used by a UDFs.  The 
function will continue to work, even if it uses the old name for the renamed 
field.  For example:

{noformat}
cqlsh> CREATE TYPE ks1.type1 (a int);
cqlsh> CREATE FUNCTION ks1.func1 (a frozen<ks1.type1>) RETURNS int LANGUAGE 
java AS $$ return Integer.valueOf(a.getInt("a")); $$;
cqlsh> CREATE TABLE ks1.table1 (a int PRIMARY KEY, b frozen<ks1.type1>);
cqlsh> INSERT INTO ks1.table1 (a, b) VALUES (0, {a: 0});
cqlsh> SELECT ks1.func1(b) FROM ks1.table1;

 ks1.func1(b)
--------------
            0

(1 rows)
cqlsh> ALTER TEYPE ks1.type1 RENAME a TO b;
cqlsh> SELECT ks1.func1(b) FROM ks1.table1;

 ks1.func1(b)
--------------
            0

(1 rows)
{noformat}

Note that the function gets field "a", which was renamed to "b".  I think I'm 
okay with this behavior, but I'd like to check with [~slebresne] as well.

> UserType, TupleType and collections in UDFs
> -------------------------------------------
>
>                 Key: CASSANDRA-7563
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7563
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Robert Stupp
>            Assignee: Robert Stupp
>             Fix For: 3.0
>
>         Attachments: 7563-7740.txt, 7563.txt, 7563v2.txt, 7563v3.txt, 
> 7563v4.txt, 7563v5.txt, 7563v6.txt, 7563v7.txt, 7563v8-diff-diff.txt, 
> 7563v8.txt
>
>
> * is Java Driver as a dependency required ?
> * is it possible to extract parts of the Java Driver for UDT/TT/coll support ?
> * CQL {{DROP TYPE}} must check UDFs
> * must check keyspace access permissions (if those exist)



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

Reply via email to