cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyler Hobbs (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CASSANDRA-8451) NPE when writetime() or ttl() are nested inside function call
Date Wed, 10 Dec 2014 00:20:13 GMT
Tyler Hobbs created CASSANDRA-8451:
--------------------------------------

             Summary: NPE when writetime() or ttl() are nested inside function call
                 Key: CASSANDRA-8451
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8451
             Project: Cassandra
          Issue Type: Bug
          Components: Core
            Reporter: Tyler Hobbs
            Assignee: Tyler Hobbs
            Priority: Minor
             Fix For: 2.0.12, 2.1.3


When the {{writetime()}} or {{ttl()}} functions are nested inside another function, the query
will result in a NullPointerException:

{noformat}
cqlsh> select bigintAsBlob(writetime(durable_writes)) from system.schema_keyspaces;
<ErrorMessage code=0000 [Server error] message="java.lang.NullPointerException">
{noformat}

Here's the stacktrace:

{noformat}
ERROR 00:14:56 Unexpected exception during request
java.lang.NullPointerException: null
	at org.apache.cassandra.cql3.statements.Selection$WritetimeOrTTLSelector.compute(Selection.java:538)
~[main/:na]
	at org.apache.cassandra.cql3.statements.Selection$FunctionSelector.compute(Selection.java:462)
~[main/:na]
	at org.apache.cassandra.cql3.statements.Selection$SelectionWithProcessing.handleRow(Selection.java:434)
~[main/:na]
	at org.apache.cassandra.cql3.statements.Selection$ResultSetBuilder.newRow(Selection.java:331)
~[main/:na]
	at org.apache.cassandra.cql3.statements.SelectStatement.processColumnFamily(SelectStatement.java:1243)
~[main/:na]
	at org.apache.cassandra.cql3.statements.SelectStatement.process(SelectStatement.java:1177)
~[main/:na]
	at org.apache.cassandra.cql3.statements.SelectStatement.processResults(SelectStatement.java:274)
~[main/:na]
	at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:213)
~[main/:na]
	at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:62)
~[main/:na]
	at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:238) ~[main/:na]
	at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:260) ~[main/:na]
	at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:119) ~[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:471) [na:1.7.0_40]
	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:724) [na:1.7.0_40]
{noformat}

Basically, it's failing to collect timestamps (or TTLs) when the function is wrapped.  A similar
query that additionally selects {{writetime()}} directly will succeed (because the timestamps
will get collected):

{noformat}
cqlsh> select bigintAsBlob(writetime(durable_writes)), writetime(durable_writes) from system.schema_keyspaces
;

 bigintAsBlob(writetime(durable_writes)) | writetime(durable_writes)
-----------------------------------------+---------------------------
                      0x000509d1865c67f9 |          1418170390571001
                      0x0000000000000000 |                         0
{noformat}



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

Mime
View raw message