cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Manasseh (JIRA)" <>
Subject [jira] [Created] (CASSANDRA-11458) Complete support for CustomExpression
Date Tue, 29 Mar 2016 20:51:25 GMT
Henry Manasseh created CASSANDRA-11458:

             Summary: Complete support for CustomExpression
                 Key: CASSANDRA-11458
             Project: Cassandra
          Issue Type: Improvement
          Components: Core
            Reporter: Henry Manasseh
            Priority: Minor

This is a proposal to complete the CustomExpression support first introduced as part of

The current support for custom expressions is partial. There is no clean way to implement
queries making use of the "exp('index', 'value)" syntax due to the fact CustomExpression is
declared as final and there is no way to for developers to cleanly plug-in their own expressions.

The proposal is to make CustomExpression not final so that developers can extend and create
their own subclass and provide their own isSatisfiedBy operation (which currently always returns

Introducing a new custom expression would be done as follows:

1. Developer would create a subclass of CustomExpression and override isSatisfiedBy method
with their logic (public boolean isSatisfiedBy(CFMetaData metadata, DecoratedKey partitionKey,
Row row))

2. This class would be packaged in a jar and copied to the cassandra lib directory along with
a secondary index class which overrides Index.customExpressionValueType

2. Create the custom index with an option which identifies the CustomExpression subclass (custom_expression_class).

CREATE CUSTOM INDEX ON keyspace.my_table(my_indexed_column) USING 'org.custom.MyCustomIndex'
WITH OPTIONS = { 'custom_expression_class': 'org.custom.MyCustomExpression' };

I have prototyped the change and works as designed. In my case I do a type of "IN" query filter
which will simplify my client logic significantly.

The default behavior of using the CustomExpression class would be maintained if the developer
does not provide a custom class in the create index options.

This message was sent by Atlassian JIRA

View raw message