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

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

When playing around with this, I discovered that you can trigger an assertion 
error when creating a function with a UDT without an explicit keyspace:

{noformat}
cqlsh> use ks1;
cqlsh:ks1> create type mytype (a int);
cqlsh:ks1> create function bar (a mytype) RETURNS mytype LANGUAGE java AS 
$$return a;$$;
<ErrorMessage code=0000 [Server error] message="java.lang.AssertionError">
{noformat}

{noformat}
java.lang.AssertionError: null
        at org.apache.cassandra.config.Schema.getKSMetaData(Schema.java:222) 
~[main/:na]
        at 
org.apache.cassandra.cql3.CQL3Type$Raw$RawUT.prepare(CQL3Type.java:510) 
~[main/:na]
        at 
org.apache.cassandra.cql3.statements.CreateFunctionStatement.announceMigration(CreateFunctionStatement.java:115)
 ~[main/:na]
        at 
org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(SchemaAlteringStatement.java:80)
 ~[main/:na]
        at 
org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:226)
 ~[main/:na]
        at 
org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:248) 
~[main/:na]
        at 
org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:118)
 ~[main/:na]
        at 
org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:439)
 [main/:na]
        at 
org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:335)
 [main/:na]
        at 
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
 [netty-all-4.0.23.Final.jar:4.0.23.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333)
 [netty-all-4.0.23.Final.jar:4.0.23.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:32)
 [netty-all-4.0.23.Final.jar:4.0.23.Final]
        at 
io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:324)
 [netty-all-4.0.23.Final.jar:4.0.23.Final]
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
[na:1.8.0_25]
        at 
org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$FutureTask.run(AbstractTracingAwareExecutorService.java:164)
 [main/:na]
        at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
[main/:na]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25]
{noformat}

A quick investigation shows that the keyspace being passed to {{prepare()}} is 
null.

Other than that, the post-test cleanup seems to have problems dropping some of 
the functions.  I believe it's due to a signature mismatch.  This doesn't show 
up as an error, since {{DROP IF EXISTS}} is used, but it causes {{DROP TYPE}} 
statements to fail later.  I'm not sure if this is due to the way the tests are 
working, or if it's an actual problem with dropping functions.  (I haven't 
narrowed it down to a particular set of functions, yet.)

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