You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2016/08/17 15:34:20 UTC

[jira] [Comment Edited] (HIVE-11459) LEFT SEMI JOIN with SELECT * should not include right-side non-key columns

    [ https://issues.apache.org/jira/browse/HIVE-11459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15424724#comment-15424724 ] 

Jesus Camacho Rodriguez edited comment on HIVE-11459 at 8/17/16 3:33 PM:
-------------------------------------------------------------------------

In fact, query should fail now because _id_ and _q_ belong to the right table. To clarify, from the documentation:

{quote}
The restrictions of using LEFT SEMI JOIN is that the right-hand-side table should only be referenced in the join condition (ON-clause), but not in WHERE- or SELECT-clauses etc.
{quote}

The following query should compile:

{code:sql}
select * from tmp2 left semi join tmp1 on c1 = id and c0 = q
{code}


was (Author: jcamachorodriguez):
In fact, query should fail now because _id_ and _q_ belong to the right table. To clarify, from the documentation:

{quote}
The restrictions of using LEFT SEMI JOIN is that the right-hand-side table should only be referenced in the join condition (ON-clause), but not in WHERE- or SELECT-clauses etc.
{quote}

> LEFT SEMI JOIN with SELECT * should not include right-side non-key columns
> --------------------------------------------------------------------------
>
>                 Key: HIVE-11459
>                 URL: https://issues.apache.org/jira/browse/HIVE-11459
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>            Reporter: Matt McCline
>            Assignee: Matt McCline
>            Priority: Critical
>
> {code}
> select * from tmp2 left semi join tmp1 where c1 = id and c0 = q
> tmp2.id	tmp2.d	tmp2.q	tmp1.c0	tmp1.d	tmp1.c1
> 1	^	20134	20134	^	1
> 3	^	20134	20134	^	3
> 1	^	20135	20135	^	1
> 1	^	20138	20138	^	1
> 2	^	20139	20139	^	2
> {code}
> tmp1 column "d" is a non-key and should not be included.
> The LEFT SEMI JOIN clause is something Hive added.  We ought to define the semantics here
> Also see https://issues.apache.org/jira/browse/HIVE-11431.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)