cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Chochol (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-6607) Unable to prepare statement with batch and delete from collection
Date Tue, 28 Jan 2014 08:11:40 GMT

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

Jan Chochol commented on CASSANDRA-6607:
----------------------------------------

Thanks for resolution.

> Unable to prepare statement with batch and delete from collection
> -----------------------------------------------------------------
>
>                 Key: CASSANDRA-6607
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6607
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Jan Chochol
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.2.14
>
>
> It is not possible to prepare statement with batch containing delete operation on one
item of collection, e.g.:
> {noformat}
> BEGIN BATCH
> DELETE colection[?] FROM table WHERE key = ?;
> APPLY BATCH
> {noformat}
> Result of preparing such statement is:
> {noformat}
> java.lang.ArrayStoreException: org.apache.cassandra.cql3.ColumnSpecification
> {noformat}
> With stacktrace:
> {noformat}
> ERROR 16:26:36,816 Unexpected exception during request
> java.lang.ArrayStoreException: org.apache.cassandra.cql3.ColumnSpecification
> 	at org.apache.cassandra.cql3.AbstractMarker.collectMarkerSpecification(AbstractMarker.java:40)
> 	at org.apache.cassandra.cql3.Operation.collectMarkerSpecification(Operation.java:75)
> 	at org.apache.cassandra.cql3.statements.DeleteStatement.prepare(DeleteStatement.java:160)
> 	at org.apache.cassandra.cql3.statements.BatchStatement.prepare(BatchStatement.java:125)
> 	at org.apache.cassandra.cql3.statements.BatchStatement.prepare(BatchStatement.java:133)
> 	at org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:273)
> 	at org.apache.cassandra.cql3.QueryProcessor.prepare(QueryProcessor.java:201)
> 	at org.apache.cassandra.transport.messages.PrepareMessage.execute(PrepareMessage.java:77)
> 	at org.apache.cassandra.transport.Message$Dispatcher.messageReceived(Message.java:287)
> 	at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
> 	at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
> 	at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
> 	at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
> 	at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:724)
> {noformat}
> This fix seems to help:
> {noformat}
> diff --git a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
> index f93eb63..74c0a45 100644
> --- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
> +++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
> @@ -129,7 +129,7 @@ public class BatchStatement extends ModificationStatement
>  
>      public ParsedStatement.Prepared prepare() throws InvalidRequestException
>      {
> -        CFDefinition.Name[] boundNames = new CFDefinition.Name[getBoundsTerms()];
> +        ColumnSpecification[] boundNames = new ColumnSpecification[getBoundsTerms()];
>          return prepare(boundNames);
>      }
> {noformat}
> It is probably corrected in Cassandra 2.0 by commit {{e431fb722f80d8957a0a7fd2ecf80333e9275c53}}
(CASSANDRA-5443).
> We  are facing this issue with Cassandra version 1.2.11.
> Would it be possible to fix this issue in branch 1.2?



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message