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

Switch to Threaded View
Hive, mail # user - Hive Query


Copy link to this message
-
RE: Hive Query
yogesh.kumar13@... 2012-07-24, 07:52
Hi Bejoy,

It shows error

Error in semantic analysis:  Expression not in GROUP BY key 'name'

Please suggest

Regards
Yogesh Kumar
________________________________
From: Bejoy KS [[EMAIL PROTECTED]]
Sent: Tuesday, July 24, 2012 12:52 PM
To: [EMAIL PROTECTED]
Subject: Re: Hive Query
Hi Yogesh

Can you try out this?

select count(*), site.name from sitealias join site on (site_alias.site_id=site.site_id) Group By site.name;

Regards
Bejoy KS

Sent from handheld, please excuse typos.
________________________________
From: <[EMAIL PROTECTED]>
Date: Tue, 24 Jul 2012 07:14:25 +0000
To: <[EMAIL PROTECTED]>
ReplyTo: [EMAIL PROTECTED]
Subject: Hive Query

Hi all,

I have two tables
1) sitealias
2) site
sitealias contains
-------------------------
id                   site_id
----------------------------
1                        15
2                        12
3                        12
4                        15
---------------------------

site contains

-----------------------------
site_id                        name
-------------------------------
12                        google
13                        wiki
14                        yahoo
15                        flipcart
---------------------------------

I am runing a query to perform equi join and to result  how many times same site_id repeats and its name and it gets group bi site id.

result of query I want

---------------------------------
site_id                name
---------------------------------
2                        google
2                        flipcart
----------------------------------
I performed
select sitealias.count(*), site.name from sitealias join site on (site_alias.site_id=site.site_id);

it shows error :  Parse Error:  mismatched input '(' expecting FROM near 'count' in from clause
Please help and suggest a query of this kind of operations.
Thanks & Regards
Yogesh Kumar

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com