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 Threaded View
Hive >> mail # dev >> Does Hive 0.11 have Query Flattening optimizations?


Copy link to this message
-
Re: Does Hive 0.11 have Query Flattening optimizations?
Hi Mihir,

I am almost certain that both the queries will compile to the same MR plan
in hive (I haven't checked though).

In fact, having clause is a syntactic sugar to achieve whats done in the
nested query. Take a look at:
https://issues.apache.org/jira/browse/HIVE-1790

Thanks,
Aniket
On Wed, Jun 26, 2013 at 10:46 PM, Mihir Kulkarni <[EMAIL PROTECTED]>wrote:

> Hello,
>
> Does hive support Query Flattening? For example a query like this:
>
> *SELECT alias.a0, alias.a1*
> *FROM*
> *            (SELECT COUNT(b) AS a0, c AS a1*
> *            FROM test*
> *            GROUP BY c) alias*
> *WHERE alias.a0 > 2;*
> *
> *
> would be flattened into:
>
> *SELECT COUNT(b), c*
> *FROM test*
> *GROUP BY c*
> *HAVING COUNT(b) > 2;*
>
> Does Hive (0.11) have such kind of optimizations or are they even useful
> considering all queries are ultimately converted into MapReduce jobs? At
> Informatica Corp we rely on Hive a lot and hence are interested to support
> such optimizations.
>
> Thanks in anticipation.
>
> Regards,
> *---*
> *Mihir Kulkarni
> **Software Engineer | Data Engine
> Informatica Corporation*
>

--
"...:::Aniket:::... Quetzalco@tl"
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