# hive-dev mailing list archives

##### Site index · List index
Message view
Top
From "Alan Gates (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-6100) Introduce basic set operations as UDFs
Date Mon, 06 Jan 2014 20:51:52 GMT
```
[ https://issues.apache.org/jira/browse/HIVE-6100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13863394#comment-13863394
]

Alan Gates commented on HIVE-6100:
----------------------------------

INTERSECT, UNION, and EXCEPT are all SQL constructs.  Hive implements UNION ALL (only under
very limited circumstances).  I'm saying if you are going to add these to Hive (and I agree
they should be added) why not add them as part of the language itself, which is how most SQL
users will expect them to be, rather than bolting them on with a UDF.

> Introduce basic set operations as UDFs
> --------------------------------------
>
>                 Key: HIVE-6100
>                 URL: https://issues.apache.org/jira/browse/HIVE-6100
>             Project: Hive
>          Issue Type: New Feature
>          Components: UDF
>            Reporter: Kostiantyn Kudriavtsev
>            Priority: Minor
>             Fix For: 0.13.0
>
>
> Introduce basic set operations:
> 1. Intersection: The intersection of A and B, denoted by A ∩ B, is the set of all things
that are members of both A and B.
> select set_intersection(arr_a, arr_b) from dual
> 2. Union: The union of A and B, denoted by A ∪ B, is the set of all things that are
members of either A or B.
> select set_union(arr_a, arr_b) from dual
> 3. Symmetric difference: the symmetric difference of two sets is the set of elements
which are in either of the sets and not in their intersection.
> select set_symdiff(arr_a, arr_b) from dual

--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

```
Mime
View raw message