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

Andres de la Peña commented on CASSANDRA-19492:
-----------------------------------------------

Filtering is also applied to SAI results on the coordinator, so we can miss 
results in SAI queries because both types of filtering cancel each other due to 
the different ordering. We can have rows that are unreachable through 
complementary range queries covering all the possible values:
{code:java}
CREATE TABLE t (k int PRIMARY KEY, v inet);
CREATE CUSTOM INDEX ON t(v) USING 'StorageAttachedIndex';
INSERT INTO t (k, v) VALUES (1, '2002:4559:1fe2::4559:1fe3');

SELECT * FROM t WHERE v < '127.0.0.1'; -- no rows
SELECT * FROM t WHERE v >= '127.0.0.1'; -- no rows either
{code}
I think we can't solve this only with SAI's post-filtering. We should either 
have the same behaviour in SAI and {{{}RowFilter{}}}, or delegate 
coordinator-side filtering to the index.

> Allow configurable v4/v6 address matching behavior for SAI indexes on CQL 
> inet columns
> --------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-19492
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19492
>             Project: Apache Cassandra
>          Issue Type: Improvement
>          Components: Feature/SAI
>            Reporter: Caleb Rackliffe
>            Assignee: Ekaterina Dimitrova
>            Priority: Normal
>             Fix For: 5.0.x, 5.x
>
>
> The {{inet}} type in CQL allows ipv4 and ipv6 address formats to mix in the 
> same column, and while there is a standard conversion between v4 and v6, 
> equivalent addresses are not considered equal by Cassandra, when it comes to 
> their usage in keys or in filtering queries. However, in SAI queries, 
> equivalent v4 and v6 addresses ARE considered equal. Even if this behavior is 
> useful, it might be a good idea to make the default behavior consistent with 
> filtering, and allow the index configuration to control whether or not to 
> consider them equal. (We have precedent for this w/ case-insensitive indexing 
> of text columns, etc.)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to