You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "wu taiyin (JIRA)" <ji...@apache.org> on 2019/06/24 13:28:00 UTC

[jira] [Commented] (CASSANDRA-15180) SASI: Cant retrieve the result when the condition is Mixed query condition when one conditon is "=" for a int type and other condition is ">" for a string type

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

wu taiyin commented on CASSANDRA-15180:
---------------------------------------

And I aslo try to use casandra secondly index , I find that it can get the result in a same query condition : 

hope your reply, thanks

CREATE TABLE app105.complextestff (
 a int,
 b int,
 c int,
 d text,
 PRIMARY KEY (a, b)
) WITH CLUSTERING ORDER BY (b 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 INDEX sasi_105_findtest4_c ON app105.complextestff (c);
CREATE INDEX sasi_105_findtest4_d ON app105.complextestff (d);

cassandra@cqlsh:app105> INSERT INTO complextestff(a , b , c , d ) VALUES ( 1,1,1,'1');
cassandra@cqlsh:app105> INSERT INTO complextestff(a , b , c , d ) VALUES ( 1,2,1,'1');
cassandra@cqlsh:app105> INSERT INTO complextestff(a , b , c , d ) VALUES ( 1,3,1,'2');
cassandra@cqlsh:app105> INSERT INTO complextestff(a , b , c , d ) VALUES ( 1,4,1,'2');
cassandra@cqlsh:app105> select * from complextestff ;

a | b | c | d
---+---+---+---
 1 | 1 | 1 | 1
 1 | 2 | 1 | 1
 1 | 3 | 1 | 2
 1 | 4 | 1 | 2

(4 rows)
cassandra@cqlsh:app105> select * from complextestff *{color:#FF0000}WHERE a=1 and c=1 and d >= '1' ALLOW FILTERING;{color}*

a | b | c | d
---+---+---+---
 1 | 1 | 1 | 1
 1 | 2 | 1 | 1
 1 | 3 | 1 | 2
 1 | 4 | 1 | 2

> SASI: Cant retrieve the result when the condition is Mixed query condition when one conditon is "=" for a int type and other condition is ">" for a string type
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-15180
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15180
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: wu taiyin
>            Priority: Normal
>
> I have a SASI scene and I am not sure if this is a problem. 
> I also create two SASI indexes for two column in one table, One column is int type and one is text type. 
> When i use the query condition by these two index cloumn with ununequal conditon , the result cannot be retrieved.
> and the schema and query cql as follow :
> 1: create a table and SASI index for two column:
> cassandra@cqlsh:app105> CREATE TABLE app105.complextestff(
>  ... a int,
>  ... b int,
>  ... c int,
>  ... d text,
>  ... PRIMARY KEY (a,b)
>  ... );
> cassandra@cqlsh:app105> CREATE CUSTOM INDEX sasi_105_findtest4_c ON app105.complextestff (c) USING 'org.apache.cassandra.index.sasi.SASIIndex';
> cassandra@cqlsh:app105> CREATE CUSTOM INDEX sasi_105_findtest4_d ON app105.complextestff (d) USING 'org.apache.cassandra.index.sasi.SASIIndex';
> 2: insert some data to this table 
> cassandra@cqlsh:app105> INSERT INTO complextestff(a , b , c , d ) VALUES ( 1,1,1,'1');
> cassandra@cqlsh:app105> INSERT INTO complextestff(a , b , c , d ) VALUES ( 1,2,1,'1');
> cassandra@cqlsh:app105> INSERT INTO complextestff(a , b , c , d ) VALUES ( 1,3,1,'2');
> cassandra@cqlsh:app105> INSERT INTO complextestff(a , b , c , d ) VALUES ( 1,4,1,'2');
> cassandra@cqlsh:app105> select * from complextestff ;
>  a | b | c | d
> ---+---+---+---
>  1 | 1 | 1 | 1
>  1 | 2 | 1 | 1
>  1 | 3 | 1 | 2
>  1 | 4 | 1 | 2
> 3: query by condition. all the index column use "=" , and it can retrieve the result succefully.
> cassandra@cqlsh:app105> select * from complextestff WHERE a=1 and c=1;
>  a | b | c | d
> ---+---+---+---
>  1 | 1 | 1 | 1
>  1 | 2 | 1 | 1
>  1 | 3 | 1 | 2
>  1 | 4 | 1 | 2
> 4、but when i use the ">" operator to a index column which is text type , it cant retrieve the result succefully
> cassandra@cqlsh:app105> select * from complextestff WHERE a=1 and c=1 and d >= '1' ALLOW FILTERING;
>  a | b | c | d
> ---+---+---+---
> (0 rows)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org