Hive Error: FAILED: SemanticException [Error 10017]: Line 4:28 Both left and right aliases encountered in JOIN 'status_cd'
<p>I have the following query in HIVE which throwing "FAILED: SemanticException [Error 10017]: Line 4:28 Both left and right aliases encountered in JOIN 'status_cd'" Error.</p>

<p>Whole query seems to be correct, I executed similar query in MYSQL also which is working fine. Only in Hive it throwing error.</p>

<p>Is there any limitation in HIVE which causing the problem.</p>

<p>Please look into below query, Any help will be appreciated.</p>

<pre><code>INSERT INTO TABLE stg_dim_gate_package SELECT
    `16_1693_418`.`package_id` AS `6896_package_id`,
    `16_1723_432`.`status_cd` AS `7075_status_cd`,
    `16_1723_432`.`load_dt` AS `7076_load_dt`,
    `16_1723_432`.`mod_dt` AS `7077_mod_dt`,
    (
        COUNT(`16_1693_418`.`package_id`)
    ) AS `7078_package_count`
FROM
    `16_1693_418`
LEFT JOIN `16_1723_432` ON `16_1693_418`.`candidateid` &gt; `16_1723_432`.`status_cd`
GROUP BY
    `16_1693_418`.`package_id`,
    `16_1723_432`.`status_cd`,
    `16_1723_432`.`load_dt`,
    `16_1723_432`.`mod_dt`;
</code></pre>