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

Sam Tunnicliffe commented on CASSANDRA-9636:
--------------------------------------------

Thanks, you're right the mapping for {{count}} queries were definitely wrong 
for 2.0 & 2.1.
Also, there were some issues on 2.2 with selecting the same column with 
multiple distinct aliases & with selecting duplicate unaliased functions.

I've rebased & pushed fixes for 2.0 -> trunk; CI is running now

[2.0|https://github.com/beobal/cassandra/tree/9636-2.0] 
[utest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-9636-2.0-testall/]
 
[dtest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-9636-2.0-dtest/]
[2.1|https://github.com/beobal/cassandra/tree/9636-2.1] 
[utest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-9636-2.1-testall/]
 
[dtest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-9636-2.1-dtest/]
[2.2|https://github.com/beobal/cassandra/tree/9636-2.2] 
[utest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-9636-2.2-testall/]
 
[dtest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-9636-2.2-dtest/]
[trunk|https://github.com/beobal/cassandra/tree/9636-trunk] 
[utest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-9636-trunk-testall/]
 
[dtest|http://cassci.datastax.com/view/Dev/view/beobal/job/beobal-9636-trunk-dtest/]


> Duplicate columns in selection causes AssertionError
> ----------------------------------------------------
>
>                 Key: CASSANDRA-9636
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-9636
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Sam Tunnicliffe
>            Assignee: Sam Tunnicliffe
>             Fix For: 2.1.x, 2.0.x
>
>
> Prior to CASSANDRA-9532, unaliased duplicate fields in a selection would be 
> silently ignored. Now, they trigger a server side exception and an unfriendly 
> error response, which we should clean up. Duplicate columns *with* aliases 
> are not affected.
> {code}
> CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 
> 'replication_factor': 1};
> CREATE TABLE ks.t1 (k int PRIMARY KEY, v int);
> INSERT INTO ks.t2 (k, v) VALUES (0, 0);
> SELECT k, v FROM ks.t2;
> SELECT k, v, v AS other_v FROM ks.t2;
> SELECT k, v, v FROM ks.t2;
> {code}
> The final statement results in this error response & server side stacktrace:
> {code}
> ServerError: <ErrorMessage code=0000 [Server error] 
> message="java.lang.AssertionError">
> ERROR 13:01:30 Unexpected exception during request; channel = [id: 
> 0x44d22e61, /127.0.0.1:39463 => /127.0.0.1:9042]
> java.lang.AssertionError: null
>         at org.apache.cassandra.cql3.ResultSet.addRow(ResultSet.java:63) 
> ~[main/:na]
>         at 
> org.apache.cassandra.cql3.statements.Selection$ResultSetBuilder.build(Selection.java:355)
>  ~[main/:na]
>         at 
> org.apache.cassandra.cql3.statements.SelectStatement.process(SelectStatement.java:1226)
>  ~[main/:na]
>         at 
> org.apache.cassandra.cql3.statements.SelectStatement.processResults(SelectStatement.java:299)
>  ~[main/:na]
>         at 
> org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:238)
>  ~[main/:na]
>         at 
> org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:67)
>  ~[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:511) 
> [na:1.8.0_45]
>         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_45]
> {code}
> This issue also presents on the head of the 2.2 branch and on 2.0.16. 
> However, the prior behaviour is different on both of those branches.
> In the 2.0 line prior to CASSANDRA-9532, duplicate columns would actually be 
> included in the results, as opposed to being silently dropped as per 2.1.x
> In 2.2, the assertion error seen above precedes CASSANDRA-9532 and is also 
> triggered for both aliased and unaliased duplicate columns.



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

Reply via email to