[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2020-04-18 Thread Josh McKenzie (Jira)


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

Josh McKenzie updated CASSANDRA-13246:
--
Bug Category: Parent values: Correctness(12982)Level 1 values: API / 
Semantic Implementation(12988)

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
>  Components: Feature/2i Index, Legacy/Local Write-Read Paths
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>Priority: Normal
>  Labels: easyfix
> Fix For: 3.0.13, 3.11.0, 4.0
>
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7.jar:3.7]
> 

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-20 Thread Benjamin Lerer (JIRA)

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

Benjamin Lerer updated CASSANDRA-13246:
---
Component/s: (was: CQL)
 Local Write-Read Paths

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local Write-Read Paths
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>  Labels: easyfix
> Fix For: 3.0.13, 3.11.0, 4.0
>
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.ja

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-20 Thread Benjamin Lerer (JIRA)

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

Benjamin Lerer updated CASSANDRA-13246:
---
Component/s: CQL

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
>  Components: Local Write-Read Paths
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>  Labels: easyfix
> Fix For: 3.0.13, 3.11.0, 4.0
>
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:123)
>  ~[apache-cassandra-3.7.jar:3.7]
>   

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-20 Thread Benjamin Lerer (JIRA)

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

Benjamin Lerer updated CASSANDRA-13246:
---
   Resolution: Fixed
Fix Version/s: 4.0
   3.11.0
   3.0.13
   Status: Resolved  (was: Ready to Commit)

Committed into 3.0 at 0eebc6e6b7cd7fc801579e57701608e7bf155ee0 and merged into 
3.11 and trunk.

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>  Labels: easyfix
> Fix For: 3.0.13, 3.11.0, 4.0
>
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:12

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-20 Thread Benjamin Lerer (JIRA)

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

Benjamin Lerer updated CASSANDRA-13246:
---
Status: Ready to Commit  (was: Patch Available)

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>  Labels: easyfix
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:123)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse.createDat

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-20 Thread Mikkel Andersen (JIRA)

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

Mikkel Andersen updated CASSANDRA-13246:


Sorry Benjamin - did not mean to cause problems... could you send me the
link to where the workflow is described?

On Mon, Mar 20, 2017 at 9:40 AM, Benjamin Lerer (JIRA) 




-- 
Venlig Hilsen
Mikkel T. Andersen
Skjoldborgvej 8
7100 Vejle
Mobil: +45 40 26 79 26


> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>  Labels: easyfix
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-20 Thread Benjamin Lerer (JIRA)

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

Benjamin Lerer updated CASSANDRA-13246:
---
Status: Open  (was: Ready to Commit)

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>  Labels: easyfix
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:123)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse.createDataResponse(R

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-20 Thread Benjamin Lerer (JIRA)

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

Benjamin Lerer updated CASSANDRA-13246:
---
Status: Patch Available  (was: Open)

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>  Labels: easyfix
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:123)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse.createDataResponse(R

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-16 Thread Mikkel Andersen (JIRA)

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

Mikkel Andersen updated CASSANDRA-13246:

Status: Ready to Commit  (was: Patch Available)

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>  Labels: easyfix
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:123)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse.createD

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-14 Thread Mikkel Andersen (JIRA)

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

Mikkel Andersen updated CASSANDRA-13246:

   Labels: easyfix  (was: )
Reproduced In: 3.0.x
   Status: Patch Available  (was: Open)

I hope is easy for you to review and apply otherwise please contact me.

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>  Labels: easyfix
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResp

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-14 Thread Mikkel Andersen (JIRA)

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

Mikkel Andersen updated CASSANDRA-13246:

Attachment: cassandra-13246.diff

Attaching the file so its easier to apply the patch.

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
> Attachments: cassandra-13246.diff
>
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:123)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-03-13 Thread Benjamin Lerer (JIRA)

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

Benjamin Lerer updated CASSANDRA-13246:
---
Reviewer: Benjamin Lerer

> Querying by secondary index on collection column returns NullPointerException 
> sometimes
> ---
>
> Key: CASSANDRA-13246
> URL: https://issues.apache.org/jira/browse/CASSANDRA-13246
> Project: Cassandra
>  Issue Type: Bug
> Environment: [cqlsh 5.0.1 | Cassandra 3.7 | CQL spec 3.4.2 | Native 
> protocol v4] 
> One cassandra node up, with consistency ONE
>Reporter: hochung
>
> Not sure if this is the absolute minimal case that produces the bug, but here 
> are the steps for reproducing.
> 1. Create table
> {code}
> CREATE TABLE test (
> id text,
> ck1 text,
> ck2 text,
> static_value text static,
> set_value set,
> primary key (id, ck1, ck2)
> );
> {code}
> 2. Create secondary indices on the clustering columns, static column, and 
> collection column
> {code}
> create index on test (set_value);
> create index on test (static_value);
> create index on test (ck1);
> create index on test (ck2);
> {code}
> 3. Insert a null value into the `set_value` column
> {code}
> insert into test (id, ck1, ck2, static_value, set_value) values ('id', 
> 'key1', 'key2', 'static', {'one', 'two'} );
> {code}
> Sanity check: 
> {code}
> select * from test;
>  id | ck1  | ck2  | static_value | set_value
> +--+--+--+
>  id | key1 | key2 |   static | {'one', 'two'}
> {code}
> 4. Set the set_value to be empty
> {code}
> update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
> 'key2';
> {code}
> 5. Make a select query that uses `CONTAINS` in the `set_value` column
> {code}
> select * from test where ck2 = 'key2' and static_value = 'static' and 
> set_value contains 'one' allow filtering;
> {code}
> Here we get a ReadFailure:
> {code}
> ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
> message="Operation failed - received 0 responses and 1 failures" 
> info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
> 'consistency': 'ONE'}
> {code}
> Logs show a NullPointerException
> {code}
> java.lang.RuntimeException: java.lang.NullPointerException
>   at 
> org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> ~[na:1.8.0_101]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
>  [apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
> [apache-cassandra-3.7.jar:3.7]
>   at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
> Caused by: java.lang.NullPointerException: null
>   at 
> org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:123)
>  ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.cassandra.db.ReadResponse.createDataResponse(ReadResponse.java:65) 
> ~[apache-cassandra-3.7.jar:3.7]
>   at 
> org.apache.

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-02-21 Thread hochung (JIRA)

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

hochung updated CASSANDRA-13246:

Description: 
Not sure if this is the absolute minimal case that produces the bug, but here 
are the steps for reproducing.

1. Create table
{code}
CREATE TABLE test (
id text,
ck1 text,
ck2 text,
static_value text static,
set_value set,
primary key (id, ck1, ck2)
);
{code}
2. Create secondary indices on the clustering columns, static column, and 
collection column
{code}
create index on test (set_value);
create index on test (static_value);
create index on test (ck1);
create index on test (ck2);
{code}
3. Insert a null value into the `set_value` column
{code}
insert into test (id, ck1, ck2, static_value, set_value) values ('id', 'key1', 
'key2', 'static', {'one', 'two'} );
{code}
Sanity check: 
{code}
select * from test;

 id | ck1  | ck2  | static_value | set_value
+--+--+--+
 id | key1 | key2 |   static | {'one', 'two'}
{code}
4. Set the set_value to be empty
{code}
update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
'key2';
{code}
5. Make a select query that uses `CONTAINS` in the `set_value` column
{code}
select * from test where ck2 = 'key2' and static_value = 'static' and set_value 
contains 'one' allow filtering;
{code}
Here we get a ReadFailure:
{code}
ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
message="Operation failed - received 0 responses and 1 failures" 
info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
'consistency': 'ONE'}
{code}
Logs show a NullPointerException
{code}
java.lang.RuntimeException: java.lang.NullPointerException
at 
org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
 ~[apache-cassandra-3.7.jar:3.7]
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
~[na:1.8.0_101]
at 
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
 [apache-cassandra-3.7.jar:3.7]
at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
[apache-cassandra-3.7.jar:3.7]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.lang.NullPointerException: null
at 
org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:123)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.ReadResponse.createDataResponse(ReadResponse.java:65) 
~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.ReadCommand.createResponse(ReadCommand.java:292) 
~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(StorageProxy.java:1799)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2466)
 ~[apache-cassandra-3.7.jar:3.7]
... 5 common frames omitted
{code}

  was:
Not sure if this is the absolute minimal case that produces the bug, but here 
are the steps for reproducing.

1. Create table
{code}
CREATE TABLE test (
id text,
ck1 text,
ck2 text,
static_value text static,
set_value set,
primary key (id, ck1, ck2)
);
{code}
2. Create secondary indices on the clustering columns, static column, and 
collection column
```
create index on test (set_value);
create index on test (static_value);
create index on test (ck1);
c

[jira] [Updated] (CASSANDRA-13246) Querying by secondary index on collection column returns NullPointerException sometimes

2017-02-21 Thread hochung (JIRA)

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

hochung updated CASSANDRA-13246:

Description: 
Not sure if this is the absolute minimal case that produces the bug, but here 
are the steps for reproducing.

1. Create table
{code}
CREATE TABLE test (
id text,
ck1 text,
ck2 text,
static_value text static,
set_value set,
primary key (id, ck1, ck2)
);
{code}
2. Create secondary indices on the clustering columns, static column, and 
collection column
```
create index on test (set_value);
create index on test (static_value);
create index on test (ck1);
create index on test (ck2);
```
3. Insert a null value into the `set_value` column
```
insert into test (id, ck1, ck2, static_value, set_value) values ('id', 'key1', 
'key2', 'static', {'one', 'two'} );
```
Sanity check: 
```
select * from test;

 id | ck1  | ck2  | static_value | set_value
+--+--+--+
 id | key1 | key2 |   static | {'one', 'two'}
```
4. Set the set_value to be empty
```
update test set set_value = {} where id = 'id' and ck1 = 'key1' and ck2 = 
'key2';
```
5. Make a select query that uses `CONTAINS` in the `set_value` column
```
select * from test where ck2 = 'key2' and static_value = 'static' and set_value 
contains 'one' allow filtering;
```
Here we get a ReadFailure:
```
ReadFailure: Error from server: code=1300 [Replica(s) failed to execute read] 
message="Operation failed - received 0 responses and 1 failures" 
info={'failures': 1, 'received_responses': 0, 'required_responses': 1, 
'consistency': 'ONE'}
```
Logs show a NullPointerException
```
java.lang.RuntimeException: java.lang.NullPointerException
at 
org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2470)
 ~[apache-cassandra-3.7.jar:3.7]
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
~[na:1.8.0_101]
at 
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:164)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$LocalSessionFutureTask.run(AbstractLocalAwareExecutorService.java:136)
 [apache-cassandra-3.7.jar:3.7]
at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:105) 
[apache-cassandra-3.7.jar:3.7]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_101]
Caused by: java.lang.NullPointerException: null
at 
org.apache.cassandra.db.filter.RowFilter$SimpleExpression.isSatisfiedBy(RowFilter.java:720)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToRow(RowFilter.java:303)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.transform.BaseRows.hasNext(BaseRows.java:120) 
~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:293)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.filter.RowFilter$CQLFilter$1IsSatisfiedFilter.applyToPartition(RowFilter.java:281)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.transform.BasePartitions.hasNext(BasePartitions.java:76)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.partitions.UnfilteredPartitionIterators$Serializer.serialize(UnfilteredPartitionIterators.java:289)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.ReadResponse$LocalDataResponse.build(ReadResponse.java:134)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:127)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.ReadResponse$LocalDataResponse.(ReadResponse.java:123)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.ReadResponse.createDataResponse(ReadResponse.java:65) 
~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.db.ReadCommand.createResponse(ReadCommand.java:292) 
~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.service.StorageProxy$LocalReadRunnable.runMayThrow(StorageProxy.java:1799)
 ~[apache-cassandra-3.7.jar:3.7]
at 
org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:2466)
 ~[apache-cassandra-3.7.jar:3.7]
... 5 common frames omitted
```

  was:
Not sure if this is the absolute minimal case that produces the bug, but here 
are the steps for reproducing.

1. 
```CREATE TABLE test (
id text,
ck1 text,
ck2 text,
static_value text static,
set_value set,
primary key (id, ck1, ck2)
);
```
2. Create secondary indices on the clustering columns, static column, and 
collection column
```
create index on test (set_value);
create index on test (static_value);
create index on test (ck1);
create index on test (ck2);
```
3. Insert a null value into th