[
https://issues.jboss.org/browse/TEIID-4717?page=com.atlassian.jira.plugin...
]
Vijay K edited comment on TEIID-4717 at 2/3/17 7:15 AM:
--------------------------------------------------------
I have two possible solutions
* Add config property for the cassandra resource adapter as below. In
CassandraMetadataProcessor we can get this flag value through CassandraConnection and
setup the metadata. But the disadvantage with this approach is "ALLOW FILTERING"
will be appended to all the select queries, users will not be able to control at table
level
{code:xml}
<config-property name="AllowFiltering">
true
</config-property>
{code}
* The second approach is to add ALLOWFILTERING as Option of table metadata. Then in the
CassandraSQLVisitor we can get this value and prepare the query
{code:xml}
<metadata type="DDL">
<![CDATA[
CREATE FOREIGN TABLE Person (
nr integer,
country varchar,
name varchar,
PRIMARY KEY (nr)
) OPTIONS(ALLOWFILTERING TRUE);
]]>
</metadata>
{code}
The second option suits my project requirement.
Please let me know, if the proposal is OK as per Teiid design, I can create pull request?
was (Author: vijaynm):
I have two possible solutions
* Add config property for the cassandra resource adapter as below. In
CassandraMetadataProcessor we can get this flag value through CassandraConnection and
setup the metadata. But the disadvantage with this approach is "ALLOW FILTERING"
will be appended to all the select queries, users will not be able to control at table
level
{code:xml}
<config-property name="AllowFiltering">
true
</config-property>
{code}
* The second approach is to add ALLOWFILTERING as Option of table metadata. Then in the
CassandraSQLVisitor we can get this value and prepare the query
{code:xml}
<metadata type="DDL"><![CDATA[
CREATE FOREIGN TABLE Person (
nr integer,
country varchar,
name varchar,
PRIMARY KEY (nr)
) OPTIONS(ALLOWFILTERING TRUE);
]]>
</metadata>
{code}
The second option suits my project requirement.
Please let me know, if the proposal is OK as per Teiid design, I can create pull request?
Add Support for 'ALLOW FILTERING' in Teiid Cassandra
Translator
---------------------------------------------------------------
Key: TEIID-4717
URL:
https://issues.jboss.org/browse/TEIID-4717
Project: Teiid
Issue Type: Enhancement
Components: Misc. Connectors
Reporter: Vijay K
Labels: cassandra
Fix For: 9.3
At certain times it is unavoidable to use few columns in the where clause which are not
part of the index, in that case Cassandra driver throws error
{color:red}Bad Request: Cannot execute this query as it might involve data filtering and
thus may have unpredictable performance. If you want to execute this query despite the
performance unpredictability, use ALLOW FILTERING{color}
As a user I should be able to configure the Cassandra translator to append *ALLOW
FILTERING* to the generated query (CQL)
References:
https://www.datastax.com/dev/blog/allow-filtering-explained-2
https://developer.jboss.org/thread/239011
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)