Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # user >> Executing queries on rows from multiple tables


+
Sameer Agarwal 2012-02-14, 03:10
Copy link to this message
-
Re: Executing queries on rows from multiple tables
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
+
Sameer Agarwal 2012-02-14, 07:07
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB