cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Tunnicliffe (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-9636) Duplicate columns in selection causes AssertionError
Date Fri, 26 Jun 2015 12:40:05 GMT


Sam Tunnicliffe commented on CASSANDRA-9636:

In both cases mentioned in the comments, the issue is that the Selection contains a result
column which doesn't map to any underlying column (as both use the no-arg {{now()}} function).
This was overlooked in the unit tests, but the unit testing wasn't quite rigorous enough anyway
as it only verified the mappings collected for a given query matched expectations. It needs
to go further and actually execute the query to ensure that the resultset can be properly
constructed from the mappings. I've made the necessary changes to the tests & pushed a
fix for the no-arg function case ([2.0|],
[2.1|]). I should note that this particular
problem doesn't affect 2.2.

Regarding the original problem regarding duplicates in the selection, my characterisation
of the pre-9532 behaviour was slightly off, so for the sake of clarity:

||Branch||pre-9532 behaviour||post-9532 behaviour||
|2.0|duplicates are included in results|AssertionError & error response|
|2.1|duplicates are collated|AssertionError & error response|
|2.2|AssertionError & error response|duplicates are collated|
The branches I've linked also revert 2.0 & 2.1 to their original behaviours.

> Duplicate columns in selection causes AssertionError
> ----------------------------------------------------
>                 Key: CASSANDRA-9636
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Sam Tunnicliffe
>            Assignee: Sam Tunnicliffe
>             Fix For: 2.1.x, 2.0.x, 2.2.0 rc2
> 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':
> 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, /
=> /]
> java.lang.AssertionError: null
>         at org.apache.cassandra.cql3.ResultSet.addRow( ~[main/:na]
>         at org.apache.cassandra.cql3.statements.Selection$
>         at org.apache.cassandra.cql3.statements.SelectStatement.process(
>         at org.apache.cassandra.cql3.statements.SelectStatement.processResults(
>         at org.apache.cassandra.cql3.statements.SelectStatement.execute(
>         at org.apache.cassandra.cql3.statements.SelectStatement.execute(
>         at org.apache.cassandra.cql3.QueryProcessor.processStatement(
>         at org.apache.cassandra.cql3.QueryProcessor.process(
>         at org.apache.cassandra.transport.messages.QueryMessage.execute(
>         at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(
>         at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(
>         at
>         at
>         at$700(
>         at$
>         at java.util.concurrent.Executors$ [na:1.8.0_45]
>         at org.apache.cassandra.concurrent.AbstractTracingAwareExecutorService$
>         at [main/:na]
>         at [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

View raw message