You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Bhuvana Bellala <Bh...@cormac-corp.com> on 2014/07/07 22:01:09 UTC

Querying a time stamp

Hi,

I have a column called dateofbirth in my hive table and the date of birth is stored as a BigInt (Unix_timestamp). Now I want to query this table using this query

SELECT * FROM mytable WHERE dataofbirth=unix_timestamp('2011-10-08');

However, this query is returning 0 results but I know there are 11 entries whose date of birth is 2011-10-08. Is there any way I can query hive for this information?

[Cormac_logo]

Bhuvana Bellala| Intern
________________________________
13921 Park Center Road, Suite 180, Herndon VA 20171|
CMMI Maturity Level 3 Rated| GSA Schedule 70| SBA SDB, 8(a)|
www.cormac-corp.com<http://www.cormac-corp.com/>

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.



RE: Querying a time stamp

Posted by as...@wipro.com.
Try WHERE dataofbirth=unix_timestamp("2011-10-08 00:00:00");

From: Bhuvana Bellala [mailto:Bhuvana.Bellala@cormac-corp.com]
Sent: Monday, July 07, 2014 9:01 PM
To: user@hive.apache.org
Subject: Querying a time stamp

Hi,

I have a column called dateofbirth in my hive table and the date of birth is stored as a BigInt (Unix_timestamp). Now I want to query this table using this query

SELECT * FROM mytable WHERE dataofbirth=unix_timestamp('2011-10-08');

However, this query is returning 0 results but I know there are 11 entries whose date of birth is 2011-10-08. Is there any way I can query hive for this information?

[Cormac_logo]

Bhuvana Bellala| Intern
________________________________
13921 Park Center Road, Suite 180, Herndon VA 20171|
CMMI Maturity Level 3 Rated| GSA Schedule 70| SBA SDB, 8(a)|
www.cormac-corp.com<http://www.cormac-corp.com/>

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.



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