Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive, mail # user - Executing queries on rows from multiple tables


Copy link to this message
-
Re: Executing queries on rows from multiple tables
Roberto Congiu 2012-02-14, 03:45
You can use UNION even if the tables are different:
SELECT *
FROM (
  select_statement
  UNION ALL
  select_statement
) unionResult
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Union

On Mon, Feb 13, 2012 at 7:10 PM, Sameer Agarwal
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there a straightforward way to execute a query on rows from multiple
> tables in Hive? Specifically, let's say that we have 2 tables A and B with
> exactly the same schema. Is it possible for me to execute a query on all the
> rows of A and B? If not, what could be the best way to alter the table-hdfs
> metastore mapping to enable this?
>
> Thanks!
> Sameer
>
> --
> Sameer Agarwal
> Algorithms, Machines, People Lab | OSNT Group
> Electrical Engineering and Computer Science, UC Berkeley
> http://www.cs.berkeley.edu/~sameerag