<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/Hive+Translator">Hive 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" >Hive has limited support for data types. It does not have native support for time/xml or LOBs. These limitations are reflected in the translator capabilities. A Teiid view can use these types, however the transformation would need to specify the necessary conversions. Note that in those situations, the evaluations will be done in Teiid engine. <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >The DatabaseTimeZone translator property <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">is</span> <span class="diff-added-words"style="background-color: #dfd;">should</span> not <span class="diff-added-words"style="background-color: #dfd;">be</span> used. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>Hive only supports EQUI join, so using any other joins types on its source tables will result in inefficient queries. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="HiveTranslator-HiveTranslator%28hive%29"></a><b>Hive Translator</b> (hive)</h1>

<p>Also see common <a href="/author/display/TEIID/JDBC+Translators" title="JDBC Translators">JDBC Translator Information</a></p>

<p>The Hive Translator, known by the type name <b><em>hive</em></b>, is for use with Hive v.10 and SparkSQL v1.0 and later.</p>

<h4><a name="HiveTranslator-Capabilities"></a>Capabilities</h4>

<p>Hive has limited support for data types. It does not have native support for time/xml or LOBs. These limitations are reflected in the translator capabilities. A Teiid view can use these types, however the transformation would need to specify the necessary conversions. Note that in those situations, the evaluations will be done in Teiid engine.</p>

<p>The DatabaseTimeZone translator property should not be used.</p>

<p>Hive only supports EQUI join, so using any other joins types on its source tables will result in inefficient queries.</p>

<p>To write criteria based on partitioned columns, modeled them on source table, but do not include them in selection columns.</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 Hive importer does not have concept of catalog or source schema, nor does it import keys, procedures, indexes, etc.</td></tr></table></div>

<h4><a name="HiveTranslator-ImportProperties"></a>Import Properties</h4>

<ul>
        <li><em>trimColumnNames</em>&#45; For Hive 0.11.0 and later the the DESCRIBE command metadata is <a href="https://issues.jboss.org/browse/TEIID-2524" class="external-link" rel="nofollow">inappropriately returned with padding</a>, set to true to strip trim white space from column names. Defaults to false.</li>
</ul>


<ul>
        <li><em>useDatabaseMetaData</em>&#45; For Hive 0.13.0 and later the normal JDBC DatabaseMetaData facilities are sufficient to perform an import.  Set to true to use the normal import logic with the option to import index information disabled.  Defaults to false.  When true, trimColumnNames has no effect.  
<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>If false the typical JDBC DatabaseMetaData calls are not used so not all of the common JDBC importer properties are applicable to Hive.  You may still use excludeTables regardless.</td></tr></table></div></li>
</ul>


<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>"Database Name"</b><br />When the database name used in the Hive is different than "default", the metadata retrieval and execution of queries does not work as expected in Teiid, as Hive JDBC driver seems to be implicitly connecting (tested with &lt; 0.12) to "default" database, thus ignoring the database name mentioned on connection URL. This can workaround in the Teiid in JBoss AS environment by setting the following in data source configuration.
<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;">
    &lt;new-connection-sql&gt;use {database-name}&lt;/new-connection-sql&gt;
</pre>
</div></div>
<p>This is fixed in &gt; 0.13 version Hive Driver. See <a href="https://issues.apache.org/jira/browse/HIVE-4256" class="external-link" rel="nofollow">https://issues.apache.org/jira/browse/HIVE-4256</a></p></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/Hive+Translator">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=94765430&revisedVersion=6&originalVersion=5">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Hive+Translator?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>