hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghotham Murthy (JIRA)" <>
Subject [jira] Commented: (HIVE-801) row-wise IN would be useful
Date Wed, 26 Aug 2009 21:14:59 GMT


Raghotham Murthy commented on HIVE-801:

Couldnt you do exactly the same thing with IF or CASE constructs in the WHERE clause? A general
disjunctive join can be written as a UNION ALL of several join queries. And a general theta
join can be done (inefficiently) with a cross product.

However, you should be able to achieve what you want in HIVE-783 in the ON clause by doing
something like the following. Although its a little verbose, you end up with a single map-reduce
job and is probably the most efficient way to doit.

JOIN ON (12345 = (case 12345 when key1 then 12345 when key2 then 12345 when key3 then 12345
else null end))

> row-wise IN would be useful
> ---------------------------
>                 Key: HIVE-801
>                 URL:
>             Project: Hadoop Hive
>          Issue Type: New Feature
>            Reporter: Adam Kramer
> SELECT * FROM tablename t
> WHERE IN(12345,key1,key2,key3);
> ...IN would operate on a given row, and return True when the first argument equaled at
least one of the other arguments. So here IN would return true if 12345=key1 OR 12345=key2
OR 12345=key3 (but wouldn't test the latter two if the first matched).
> This would also help with, if IN were
implemented in a manner that allows it to be used in an ON clause.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message