Grokbase Groups Hive user August 2011
FAQ

On Thu, Aug 25, 2011 at 12:11 PM, Ayon Sinha wrote:

You need
select one.a, two.b from one join two on one.a=two.a group by one.a,*two.b
*;

-Ayon
See My Photos on Flickr <http://www.flickr.com/photos/ayonsinha/>
Also check out my Blog for answers to commonly asked questions.<http://dailyadvisor.blogspot.com>

------------------------------
*From:* Edward Capriolo <edlinuxguru@gmail.com>
*To:* user@hive.apache.org
*Sent:* Thursday, August 25, 2011 8:16 AM
*Subject:* hive-0.7.0 semantic analysis inside catalogs

The parser can not handle certain queries inside catlogs.

[11:09:51] <ecapriolo> hive> create table one (a int,b int) fields
terminated by '\t';
[11:09:51] <ecapriolo> FAILED: Parse Error: line 1:31 mismatched input
'fields' expecting EOF
[11:09:51] <ecapriolo>
[11:09:51] <ecapriolo> hive> create table one (a int,b int) row format
delimited fields terminated by '\t';
[11:09:51] <ecapriolo> OK
[11:09:51] <ecapriolo> Time taken: 0.459 seconds
[11:09:51] <ecapriolo> hive> create table two (a int,b int) row format
delimited fields terminated by '\t';
[11:09:51] <ecapriolo> OK
[11:09:51] <ecapriolo> Time taken: 0.039 seconds
[11:09:51] <ecapriolo> hive> select one.a, two.b from one join two on
one.a=two.a group by one.a;
[11:09:51] <ecapriolo> FAILED: Error in semantic analysis: line 1:14
Expression Not In Group By Key two

Is there a fix/workaround?

Edward

Shame on me. Of course all select columns have to be in group by.

I was using many aliases in a query and sometimes the above error gets
masked by something like this:
FAILED: Error in semantic analysis: line 20:81 Invalid Column Reference
host_name

Thank you again,
Edward

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
Discussion Overview
groupuser @
categorieshive, hadoop
postedAug 25, '11 at 3:16p
activeAug 25, '11 at 6:24p
posts3
users2
websitehive.apache.org

2 users in discussion

Edward Capriolo: 2 posts Ayon Sinha: 1 post

People

Translate

site design / logo © 2022 Grokbase