You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by rohan monga <mo...@gmail.com> on 2011/12/13 07:09:41 UTC

Confusion about IN clause

Hi,
I though that 'IN' clause was not supported by hive ( version 0.7 )
according to the documentation
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select#LanguageManualSelect-WHEREClause

but a friend of mine showed me that queries like the following
<snip>
select * from table where row in (1,2,3);
</snip>
work. and I found this JIRA
https://issues.apache.org/jira/browse/HIVE-801which kinda shows that
it should work.

Was this feature deprecated in the later version ( 0.7.1) or is the
documentation out of sync?

Thanks,
--
Rohan Monga

Re: Confusion about IN clause

Posted by rohan monga <mo...@gmail.com>.
Yup, sub-queries don't work in the where clause.
Is there another document and/or JIRA that i can look at for the
implementation of IN clause?

Regards,
--
Rohan Monga


On Mon, Dec 12, 2011 at 10:19 PM, Igor Tatarinov <ig...@decide.com> wrote:

> I think the doc refers to an IN subquery
> WHERE x IN (SELECT blah FROM ...)
>
> the simple WHERE col IN ('x', 'y', 'z') works fine.
>
> I  imagine none of these work:
> http://www.dba-oracle.com/sql/t_subquery_not_in_exists.htm
>
>
> igor
> decide.com
>
>
> On Mon, Dec 12, 2011 at 10:09 PM, rohan monga <mo...@gmail.com>wrote:
>
>> Hi,
>> I though that 'IN' clause was not supported by hive ( version 0.7 )
>> according to the documentation
>> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select#LanguageManualSelect-WHEREClause
>>
>> but a friend of mine showed me that queries like the following
>> <snip>
>> select * from table where row in (1,2,3);
>> </snip>
>> work. and I found this JIRA
>> https://issues.apache.org/jira/browse/HIVE-801 which kinda shows that it
>> should work.
>>
>> Was this feature deprecated in the later version ( 0.7.1) or is the
>> documentation out of sync?
>>
>> Thanks,
>> --
>> Rohan Monga
>>
>
>

Re: Confusion about IN clause

Posted by Igor Tatarinov <ig...@decide.com>.
I think the doc refers to an IN subquery
WHERE x IN (SELECT blah FROM ...)

the simple WHERE col IN ('x', 'y', 'z') works fine.

I  imagine none of these work:
http://www.dba-oracle.com/sql/t_subquery_not_in_exists.htm


igor
decide.com

On Mon, Dec 12, 2011 at 10:09 PM, rohan monga <mo...@gmail.com> wrote:

> Hi,
> I though that 'IN' clause was not supported by hive ( version 0.7 )
> according to the documentation
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select#LanguageManualSelect-WHEREClause
>
> but a friend of mine showed me that queries like the following
> <snip>
> select * from table where row in (1,2,3);
> </snip>
> work. and I found this JIRA https://issues.apache.org/jira/browse/HIVE-801which kinda shows that it should work.
>
> Was this feature deprecated in the later version ( 0.7.1) or is the
> documentation out of sync?
>
> Thanks,
> --
> Rohan Monga
>