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

Switch to Threaded View
Hive, mail # user - How to perform arithmetic operations in hive


Copy link to this message
-
Re: How to perform arithmetic operations in hive
Sanjay Subramanian 2013-08-23, 02:57
Yes this will work
Also arithmetic operations will  work in a WHERE clause
Example

select channel_id from keyword_impressions_log where header_date_partition='2013-08-21' and channel_id*10=290640 limit 10

From: Justin Workman <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Reply-To: "[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Date: Thursday, August 22, 2013 7:17 AM
To: "[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>" <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>>
Subject: Re: How to perform arithmetic operations in hive

Try

select emp_name, (emp_no * 10) from emp_table;

Sent from my iPhone

On Aug 22, 2013, at 8:14 AM, Sandeep Nemuri <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote:

Hi all ,
         Can we perform arithmetic operator on select command.
I have a table emp_table with columns emp_name and emp_no
i want to multiply the data in a emp_no with 10 .

i tryed select * from emp_table where emp_no=emp_no*10;
But it did not work .
Help me out

Thanks in advance .
--Regards
  Sandeep Nemuri

CONFIDENTIALITY NOTICE
=====================This email message and any attachments are for the exclusive use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message along with any attachments, from your computer system. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's Email System Administrator.