You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Andrey Konstantinov (JIRA)" <ji...@apache.org> on 2016/07/08 04:00:14 UTC
[jira] [Created] (CASSANDRA-12149) NullPointerException on SELECT
with SASI index
Andrey Konstantinov created CASSANDRA-12149:
-----------------------------------------------
Summary: NullPointerException on SELECT with SASI index
Key: CASSANDRA-12149
URL: https://issues.apache.org/jira/browse/CASSANDRA-12149
Project: Cassandra
Issue Type: Bug
Components: sasi
Reporter: Andrey Konstantinov
If I execute the following sequence of queries, Cassandra aborts a connection reporting NPE on server side.
CREATE KEYSPACE IF NOT EXISTS mykeyspace WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 1};
CREATE TABLE mykeyspace.myrecordtable (
namespace text,
entity text,
timestamp bigint,
feature1 bigint,
feature2 bigint,
PRIMARY KEY ((namespace, entity), timestamp)
) WITH CLUSTERING ORDER BY (timestamp ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
CREATE CUSTOM INDEX record_timestamp_90e05e6caa714f29 ON mykeyspace.myrecordtable (timestamp) USING 'org.apache.cassandra.index.sasi.SASIIndex';
CREATE CUSTOM INDEX record_feature1_90e05e6caa714f29 ON mykeyspace.myrecordtable (feature1) USING 'org.apache.cassandra.index.sasi.SASIIndex';
INSERT INTO mykeyspace.myrecordtable (feature1, feature2, namespace, entity, timestamp) VALUES (31, 32, 'ns2', 'entity3', 201606210131);
INSERT INTO mykeyspace.myrecordtable (feature1, feature2, namespace, entity, timestamp) VALUES (11, 12, 'ns1', 'entity1', 201606210129);
INSERT INTO mykeyspace.myrecordtable (feature1, feature2, namespace, entity, timestamp) VALUES (21, 22, 'ns2', 'entity2', 201606210130);
SELECT namespace, entity, timestamp, feature1, feature2 FROM mykeyspace.myrecordtable WHERE namespace = 'ns2' AND entity = 'entity2' AND feature1 > 11 AND feature1 < 31 AND token(namespace, entity) <= 9223372036854775807;
Output from cqlsh is the following:
cqlsh> CREATE KEYSPACE IF NOT EXISTS mykeyspace WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor' : 1};
cqlsh>
cqlsh> CREATE TABLE mykeyspace.myrecordtable (
... namespace text,
... entity text,
... timestamp bigint,
... feature1 bigint,
... feature2 bigint,
... PRIMARY KEY ((namespace, entity), timestamp)
... ) WITH CLUSTERING ORDER BY (timestamp ASC)
... AND bloom_filter_fp_chance = 0.01
... AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
... AND comment = ''
... AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
... AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
... AND crc_check_chance = 1.0
... AND dclocal_read_repair_chance = 0.1
... AND default_time_to_live = 0
... AND gc_grace_seconds = 864000
... AND max_index_interval = 2048
... AND memtable_flush_period_in_ms = 0
... AND min_index_interval = 128
... AND read_repair_chance = 0.0
... AND speculative_retry = '99PERCENTILE';
cqlsh> CREATE CUSTOM INDEX record_timestamp_90e05e6caa714f29 ON mykeyspace.myrecordtable (timestamp) USING 'org.apache.cassandra.index.sasi.SASIIndex';
cqlsh> CREATE CUSTOM INDEX record_feature1_90e05e6caa714f29 ON mykeyspace.myrecordtable (feature1) USING 'org.apache.cassandra.index.sasi.SASIIndex';
cqlsh>
cqlsh> INSERT INTO mykeyspace.myrecordtable (feature1, feature2, namespace, entity, timestamp) VALUES (31, 32, 'ns2', 'entity3', 201606210131);
cqlsh> INSERT INTO mykeyspace.myrecordtable (feature1, feature2, namespace, entity, timestamp) VALUES (11, 12, 'ns1', 'entity1', 201606210129);
cqlsh> INSERT INTO mykeyspace.myrecordtable (feature1, feature2, namespace, entity, timestamp) VALUES (21, 22, 'ns2', 'entity2', 201606210130);
cqlsh>
cqlsh> SELECT namespace, entity, timestamp, feature1, feature2 FROM mykeyspace.myrecordtable WHERE namespace = 'ns2' AND entity = 'entity2' AND feature1 > 11 AND feature1 < 31 AND token(namespace, entity) <= 9223372036854775807;
ServerError: <ErrorMessage code=0000 [Server error] message="java.lang.NullPointerException">
cqlsh>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)