hadoop-hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Kramer (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HIVE-801) row-wise IN would be useful
Date Wed, 26 Aug 2009 22:26:59 GMT

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

Adam Kramer commented on HIVE-801:

Using UNION ALL doesn't do the same as a disjunctive join, though, because in the case of
key1 = key2 = key3 = 12345, union all would end up with 3 rows in the output instead of just
one row. If we can make assumptions about duplicate rows, we can sort and transform with 'uniq,'
but sometimes duplicate rows are meaningful.

The CASE usage is interesting and intuitive, but throws an error: FAILED: Error in semantic
analysis: line 3:38 Both Left and Right Aliases Encountered in Join 1. I don't really understand
what this means, but it is the same error I get if I use an IF statement like IF(key1=12345
OR key2=12345,True,False), which was my first attempt to "fool" hive into doing a disjunctive

(also, ELSE NULL END throws a separate error of "TOK_NULL encountered with 0 children")

> row-wise IN would be useful
> ---------------------------
>                 Key: HIVE-801
>                 URL: https://issues.apache.org/jira/browse/HIVE-801
>             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 https://issues.apache.org/jira/browse/HIVE-783, 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