<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/Cassandra+Translator">Cassandra Translator</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>The Teiid specific Cassandra Resource Adapter should be used with this translator.  See [Cassandra Data Sources] for connecting to a Cassandra cluster. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>h3. Native Queries <br> <br>Cassandra source procedures may be created using the teiid_rel:native-query extension - see&amp;nbsp;[Parameterizable Native Queries|Translators#native]. The procedure will invoke the native-query similar to a direct procedure call with the benefits that the query is predetermined and that result column types are known, rather than requiring the use of ARRAYTABLE or similar functionality. <br> <br>h4. *Native Procedure* <br> <br>{warning} <br>This feature is turned off by default because of the security risk this exposes to execute any command against the source. To enable this feature, [override the execution property|Translators#Override Execution Properties] called &quot;SupportsNativeQueries&quot; to true. <br>{warning} <br> <br>The Cassandra translator provides a procedure with name *native* that gives ability to execute any ad-hoc CQL queries directly against the source without any Teiid parsing or resolving. Since the metadata of this procedure&#39;s results are not known to Teiid, they are returned as object array. [ARRAYTABLE] can be used construct tabular output for consumption by client applications. <br> <br>{info:tip=Name of the Native Procedure} <br>By default the name of the procedure that executes the queries directly is called *native*, however user can set [Override Execution Properties|Translators#Override Execution Properties] property on _NativeQueryProcedureName_ in vdb.xml file to change it to any other procedure name. <br>{info} <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="CassandraTranslator-CassandraTranslator"></a><b>Cassandra Translator</b></h1>

<p>The Cassandra Translator, known by the type name&nbsp;<em>cassandra</em>, exposes querying functionality to <a href="/author/display/TEIID/Cassandra+Data+Sources" title="Cassandra Data Sources">Cassandra Data Sources</a>.  The translator translates Teiid push down commands into <a href="http://cassandra.apache.org/doc/cql/CQL.html" class="external-link" rel="nofollow">Cassandra CQL</a>.</p>

<p><b>Properties</b></p>

<p>The Cassandra Translator currently has no import or execution properties.</p>

<h3><a name="CassandraTranslator-Usage"></a><b>Usage</b></h3>

<p>The Cassandra Translator supports only SELECT statements with a restrictive set of capabilities including: count&#40;&#42;&#41;, comparison predicates, IN predicates, ORDER BY, and LIMIT.  Consider a custom extension or create an enhancement request should your usage require additional capabilities.</p>

<h3><a name="CassandraTranslator-JCAResourceAdapter"></a><b>JCA Resource Adapter</b></h3>

<p>The Teiid specific Cassandra Resource Adapter should be used with this translator.  See <a href="/author/display/TEIID/Cassandra+Data+Sources" title="Cassandra Data Sources">Cassandra Data Sources</a> for connecting to a Cassandra cluster.</p>

<h3><a name="CassandraTranslator-NativeQueries"></a>Native Queries</h3>

<p>Cassandra source procedures may be created using the teiid_rel:native-query extension - see&nbsp;<a href="/author/display/TEIID/Translators#Translators-native">Parameterizable Native Queries</a>. The procedure will invoke the native-query similar to a direct procedure call with the benefits that the query is predetermined and that result column types are known, rather than requiring the use of ARRAYTABLE or similar functionality.</p>

<h4><a name="CassandraTranslator-NativeProcedure"></a><b>Native Procedure</b></h4>

<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>This feature is turned off by default because of the security risk this exposes to execute any command against the source. To enable this feature, <a href="/author/display/TEIID/Translators#Translators-OverrideExecutionProperties">override the execution property</a> called "SupportsNativeQueries" to true.</td></tr></table></div>

<p>The Cassandra translator provides a procedure with name <b>native</b> that gives ability to execute any ad-hoc CQL queries directly against the source without any Teiid parsing or resolving. Since the metadata of this procedure's results are not known to Teiid, they are returned as object array. <a href="/author/display/TEIID/ARRAYTABLE" title="ARRAYTABLE">ARRAYTABLE</a> can be used construct tabular output for consumption by client applications.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>By default the name of the procedure that executes the queries directly is called <b>native</b>, however user can set <a href="/author/display/TEIID/Translators#Translators-OverrideExecutionProperties">Override Execution Properties</a> property on <em>NativeQueryProcedureName</em> in vdb.xml file to change it to any other procedure name.</td></tr></table></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/Cassandra+Translator">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=74285389&revisedVersion=4&originalVersion=3">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Cassandra+Translator?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>