cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Stepura (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-7670) selecting field from empty UDT cell using dot notation triggers exception
Date Sat, 02 Aug 2014 14:43:11 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-7670?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mikhail Stepura updated CASSANDRA-7670:
---------------------------------------

    Attachment: CASSANDRA-2.1.0-7670.patch

We can check the value for null before splitting it, attaching a patch for that

> selecting field from empty UDT cell using dot notation triggers exception
> -------------------------------------------------------------------------
>
>                 Key: CASSANDRA-7670
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7670
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Russ Hatch
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 2.1.1
>
>         Attachments: CASSANDRA-2.1.0-7670.patch
>
>
> Hopefully the title explains the issue.
> Basically if a row has a user type which is undefined, using the "dot notation" syntax
causes cqlsh to show a NPE, and an exception ends up in the log as well.
> I would expect the behavior here to execute the query and return null, since the user
type itself is null, then it's fields are null as well (the downside here is there would be
no way to distinguish between a null UDT and a null UDT field, without making an initial query
to check if the UDT is non-null).
> Steps to repro:
> {noformat}
> create keyspace test with replication = {'class':'SimpleStrategy', 'replication_factor':1};
> use test;
> CREATE TYPE t_item (subitem text);
> create table mytable (value1 text PRIMARY KEY, value2 text, item t_item);
> insert into mytable (value1, value2 ) values ('foo', 'bar');
> select item.subitem from mytable;
> <ErrorMessage code=0000 [Server error] message="java.lang.NullPointerException">
> {noformat}
> Here's the exception logged:
> {noformat}
> ERROR [SharedPool-Worker-1] 2014-08-01 15:49:00,514 ErrorMessage.java:218 - Unexpected
exception during request
> java.lang.NullPointerException: null
>         at org.apache.cassandra.db.marshal.TupleType.split(TupleType.java:146) ~[main/:na]
>         at org.apache.cassandra.cql3.statements.Selection$FieldSelector.compute(Selection.java:469)
~[main/:na]
>         at org.apache.cassandra.cql3.statements.Selection$SelectionWithFunctions.handleRow(Selection.java:537)
~[main/:na]
>         at org.apache.cassandra.cql3.statements.Selection$ResultSetBuilder.build(Selection.java:333)
~[main/:na]
>         at org.apache.cassandra.cql3.statements.SelectStatement.process(SelectStatement.java:1149)
~[main/:na]
>         at org.apache.cassandra.cql3.statements.SelectStatement.processResults(SelectStatement.java:283)
~[main/:na]
>         at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:225)
~[main/:na]
>         at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:60)
~[main/:na]
>         at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:187)
~[main/:na]
>         at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:206)
~[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:421)
[main/:na]
>         at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:318)
[main/:na]
>         at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103)
[netty-all-4.0.20.Final.jar:4.0.20.Final]
>         at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:332)
[netty-all-4.0.20.Final.jar:4.0.20.Final]
>         at io.netty.channel.AbstractChannelHandlerContext.access$700(AbstractChannelHandlerContext.java:31)
[netty-all-4.0.20.Final.jar:4.0.20.Final]
>         at io.netty.channel.AbstractChannelHandlerContext$8.run(AbstractChannelHandlerContext.java:323)
[netty-all-4.0.20.Final.jar:4.0.20.Final]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_65]
>         at org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$FutureTask.run(AbstractTracingAwareExecutorService.java:163)
[main/:na]
>         at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:103) [main/:na]
>         at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message