<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/OLAP+Translator">OLAP 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 (22)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h1. {color:#000000}{*}OLAP Translator{*}{color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1. {*}OLAP Translator{*} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> OLAP Services translator, known by the type <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">name&amp;nbsp;{color}{color:#333333}{_}olap{_}{color}{color:#333333},</span> <span class="diff-added-words"style="background-color: #dfd;">name&amp;nbsp;{_}olap{_},</span> exposes stored procedures for calling analysis sevices backed by a OLAP server using MDX query language. This translator exposes a stored procedure, invokeMDX, that returns a result set containing tuple array values for a given MDX query. invokeMDX will commonly be used with the ARRAYTABLE table function to extract the <span class="diff-changed-words">results.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>Since</span> the Cube metadata exposed by the OLAP servers and relational database metadata are so different, there is no single way to map the metadata from one to other. It is best to query OLAP system using its own native MDX language through. MDX queries my be defined statically or built dynamically in Teiid&#39;s abstraction <span class="diff-changed-words">layers.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >h3. <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#000000}{*}Usage{*}{color}</span> <span class="diff-added-words"style="background-color: #dfd;">{*}Usage{*}</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> olap translator exposes one low level procedure for accessing olap <span class="diff-changed-words">services.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. {color:#000000}{*}InvokeMDX Procedure{*}{color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3. {*}InvokeMDX Procedure{*} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}{{{}invokeMdx{}}}{color}{color:#333333}&amp;nbsp;returns</span> <span class="diff-added-words"style="background-color: #dfd;">{{{}invokeMdx{}}}&amp;nbsp;returns</span> a resultset of the tuples as array <span class="diff-changed-words">values.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >{code}Procedure invokeMdx(mdx in STRING, params VARIADIC OBJECT) returns table (tuple object){code} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> mdx parameter is a MDX query to be executed on the OLAP <span class="diff-changed-words">server.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> results of the query will be returned such that each row on the row axis will be packed into an array value that will first contain each hierarchy member name on the row axis then each measure value from the column <span class="diff-changed-words">axis.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" >{note} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> use <span class="diff-changed-words">of&amp;nbsp;<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span>[Data</span> Roles]&amp;nbsp;should be considered to prevent arbitrary MDX from being submitted to the invokeMDX procedure.{note} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. {color:#000000}{*}Native Queries{*}{color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3. {*}Native Queries{*} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>OLAP</span> source procedures may be created using the teiid_rel:native-query extension - <span class="diff-changed-words">see&amp;nbsp;<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span>[Parameterizable</span> Native Queries|Translators#native].{note} <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> parameter value substitution directly inserts boolean, and number values, and treats all other values as string <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">literals.{color}{note}{color:#333333}The</span> <span class="diff-added-words"style="background-color: #dfd;">literals.{note}The</span> procedure will invoke the native-query similar to an invokeMdx 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 <span class="diff-changed-words">functionality.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h4. {color:#000000}{*}Native Procedure{*}{color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4. {*}Direct Query Procedure{*} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> invokeMdx procedure is the <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">native</span> <span class="diff-added-words"style="background-color: #dfd;">direct query</span> procedure for the OLAP translator. It may be disabled or have it&#39;s name changed via the common <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">native</span> <span class="diff-added-words"style="background-color: #dfd;">direct query</span> translator properties just like any other source. A call to <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">a native</span> <span class="diff-added-words"style="background-color: #dfd;">the direct query</span> procedure without any parameters will not attempt to parse the mdx query for parameterization. If parameters are used, the value substitution directly inserts boolean, and number values, and treats all other values as string <span class="diff-changed-words">literals.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h3. {color:#000000}{*}JCA Resource Adapter{*}{color} <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h3. {*}JCA Resource Adapter{*} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color:#333333}</span>The</span> resource adapter for this translator provided through data source in JBoss AS, Refer to Admin Guide for &quot;JDBC Data Sources&quot; configuration section. Two sample \-ds.xml files provided for accessing OLAP servers in teiid-examples section. One is Mondrian specific, when Mondrian server is deployed in the same JBoss AS as Teiid (mondrian-ds.xml). To access any other OLAP servers using XMLA interface, the data source for them can be created using them example template <span class="diff-changed-words">olap-xmla-ds.xml<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">{color}</span></span> <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="OLAPTranslator-%7B%7DOLAPTranslator%7B%7D"></a><b>OLAP Translator</b></h1>

<p>The OLAP Services translator, known by the type name&nbsp;<em>olap</em>, exposes stored procedures for calling analysis sevices backed by a OLAP server using MDX query language. This translator exposes a stored procedure, invokeMDX, that returns a result set containing tuple array values for a given MDX query. invokeMDX will commonly be used with the ARRAYTABLE table function to extract the results.</p>

<p>Since the Cube metadata exposed by the OLAP servers and relational database metadata are so different, there is no single way to map the metadata from one to other. It is best to query OLAP system using its own native MDX language through. MDX queries my be defined statically or built dynamically in Teiid's abstraction layers.</p>

<h3><a name="OLAPTranslator-%7B%7DUsage%7B%7D"></a><b>Usage</b></h3>

<p>The olap translator exposes one low level procedure for accessing olap services.</p>

<h3><a name="OLAPTranslator-%7B%7DInvokeMDXProcedure%7B%7D"></a><b>InvokeMDX Procedure</b></h3>

<p><tt>invokeMdx</tt>&nbsp;returns a resultset of the tuples as array values.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">Procedure invokeMdx(mdx in STRING, params VARIADIC OBJECT) returns table (tuple object)</pre>
</div></div>
<p>The mdx parameter is a MDX query to be executed on the OLAP server.</p>

<p>The results of the query will be returned such that each row on the row axis will be packed into an array value that will first contain each hierarchy member name on the row axis then each measure value from the column axis.</p>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>The use of&nbsp;<a href="/author/display/TEIID/Data+Roles" title="Data Roles">Data Roles</a>&nbsp;should be considered to prevent arbitrary MDX from being submitted to the invokeMDX procedure.</td></tr></table></div>

<h3><a name="OLAPTranslator-%7B%7DNativeQueries%7B%7D"></a><b>Native Queries</b></h3>

<p>OLAP 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>.</p>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>The parameter value substitution directly inserts boolean, and number values, and treats all other values as string literals.</td></tr></table></div>
<p>The procedure will invoke the native-query similar to an invokeMdx 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="OLAPTranslator-%7B%7DDirectQueryProcedure%7B%7D"></a><b>Direct Query Procedure</b></h4>

<p>The invokeMdx procedure is the direct query procedure for the OLAP translator. It may be disabled or have it's name changed via the common direct query translator properties just like any other source. A call to the direct query procedure without any parameters will not attempt to parse the mdx query for parameterization. If parameters are used, the value substitution directly inserts boolean, and number values, and treats all other values as string literals.</p>

<h3><a name="OLAPTranslator-%7B%7DJCAResourceAdapter%7B%7D"></a><b>JCA Resource Adapter</b></h3>

<p>The resource adapter for this translator provided through data source in JBoss AS, Refer to Admin Guide for "JDBC Data Sources" configuration section. Two sample &#45;ds.xml files provided for accessing OLAP servers in teiid-examples section. One is Mondrian specific, when Mondrian server is deployed in the same JBoss AS as Teiid (mondrian-ds.xml). To access any other OLAP servers using XMLA interface, the data source for them can be created using them example template olap-xmla-ds.xml</p>
    </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/OLAP+Translator">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=55477044&revisedVersion=4&originalVersion=3">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/OLAP+Translator?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>